From de1e274eb81d8ff39f41aed0b130055e98595f28 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 30 Sep 2019 18:18:58 -0400 Subject: [PATCH] feat: add v1 protos (#11) --- google-cloud-automl/pom.xml | 9 + .../google/cloud/automl/v1/AutoMlClient.java | 2095 ++++++++++++++ .../cloud/automl/v1/AutoMlSettings.java | 407 +++ .../automl/v1/PredictionServiceClient.java | 304 ++ .../automl/v1/PredictionServiceSettings.java | 175 ++ .../google/cloud/automl/v1/package-info.java | 73 + .../cloud/automl/v1/stub/AutoMlStub.java | 169 ++ .../automl/v1/stub/AutoMlStubSettings.java | 1032 +++++++ .../v1/stub/GrpcAutoMlCallableFactory.java | 115 + .../cloud/automl/v1/stub/GrpcAutoMlStub.java | 668 +++++ .../GrpcPredictionServiceCallableFactory.java | 115 + .../v1/stub/GrpcPredictionServiceStub.java | 153 + .../automl/v1/stub/PredictionServiceStub.java | 41 + .../stub/PredictionServiceStubSettings.java | 266 ++ .../cloud/automl/v1/AutoMlClientTest.java | 769 +++++ .../google/cloud/automl/v1/MockAutoMl.java | 57 + .../cloud/automl/v1/MockAutoMlImpl.java | 263 ++ .../automl/v1/MockPredictionService.java | 57 + .../automl/v1/MockPredictionServiceImpl.java | 72 + .../v1/PredictionServiceClientTest.java | 123 + grpc-google-cloud-automl-v1/pom.xml | 60 + .../google/cloud/automl/v1/AutoMlGrpc.java | 2023 +++++++++++++ .../automl/v1/PredictionServiceGrpc.java | 382 +++ pom.xml | 12 + proto-google-cloud-automl-v1/pom.xml | 33 + .../cloud/automl/v1/AnnotationPayload.java | 808 ++++++ .../automl/v1/AnnotationPayloadOrBuilder.java | 58 + .../v1/AnnotationPayloadOuterClass.java | 86 + .../google/cloud/automl/v1/AutoMlProto.java | 393 +++ .../cloud/automl/v1/CreateDatasetRequest.java | 875 ++++++ .../v1/CreateDatasetRequestOrBuilder.java | 77 + .../v1/CreateModelOperationMetadata.java | 451 +++ ...CreateModelOperationMetadataOrBuilder.java | 24 + .../cloud/automl/v1/CreateModelRequest.java | 868 ++++++ .../v1/CreateModelRequestOrBuilder.java | 77 + .../com/google/cloud/automl/v1/DataItems.java | 104 + .../com/google/cloud/automl/v1/Dataset.java | 2229 +++++++++++++++ .../google/cloud/automl/v1/DatasetName.java | 210 ++ .../cloud/automl/v1/DatasetOrBuilder.java | 279 ++ .../cloud/automl/v1/DatasetOuterClass.java | 113 + .../cloud/automl/v1/DeleteDatasetRequest.java | 612 ++++ .../v1/DeleteDatasetRequestOrBuilder.java | 46 + .../cloud/automl/v1/DeleteModelRequest.java | 611 ++++ .../v1/DeleteModelRequestOrBuilder.java | 46 + .../automl/v1/DeleteOperationMetadata.java | 450 +++ .../v1/DeleteOperationMetadataOrBuilder.java | 24 + .../cloud/automl/v1/ExamplePayload.java | 806 ++++++ .../automl/v1/ExamplePayloadOrBuilder.java | 58 + .../cloud/automl/v1/ExportDataRequest.java | 878 ++++++ .../automl/v1/ExportDataRequestOrBuilder.java | 77 + .../cloud/automl/v1/GcsDestination.java | 646 +++++ .../automl/v1/GcsDestinationOrBuilder.java | 56 + .../com/google/cloud/automl/v1/GcsSource.java | 717 +++++ .../cloud/automl/v1/GcsSourceOrBuilder.java | 74 + .../cloud/automl/v1/GetDatasetRequest.java | 611 ++++ .../automl/v1/GetDatasetRequestOrBuilder.java | 46 + .../automl/v1/GetModelEvaluationRequest.java | 613 ++++ .../GetModelEvaluationRequestOrBuilder.java | 46 + .../cloud/automl/v1/GetModelRequest.java | 611 ++++ .../automl/v1/GetModelRequestOrBuilder.java | 46 + .../cloud/automl/v1/ImportDataRequest.java | 896 ++++++ .../automl/v1/ImportDataRequestOrBuilder.java | 82 + .../google/cloud/automl/v1/InputConfig.java | 1197 ++++++++ .../cloud/automl/v1/InputConfigOrBuilder.java | 128 + .../java/com/google/cloud/automl/v1/Io.java | 134 + .../cloud/automl/v1/ListDatasetsRequest.java | 1072 +++++++ .../v1/ListDatasetsRequestOrBuilder.java | 116 + .../cloud/automl/v1/ListDatasetsResponse.java | 1107 ++++++++ .../v1/ListDatasetsResponseOrBuilder.java | 99 + .../v1/ListModelEvaluationsRequest.java | 1099 +++++++ .../ListModelEvaluationsRequestOrBuilder.java | 123 + .../v1/ListModelEvaluationsResponse.java | 1125 ++++++++ ...ListModelEvaluationsResponseOrBuilder.java | 102 + .../cloud/automl/v1/ListModelsRequest.java | 1075 +++++++ .../automl/v1/ListModelsRequestOrBuilder.java | 117 + .../cloud/automl/v1/ListModelsResponse.java | 1103 +++++++ .../v1/ListModelsResponseOrBuilder.java | 99 + .../google/cloud/automl/v1/LocationName.java | 182 ++ .../com/google/cloud/automl/v1/Model.java | 2524 +++++++++++++++++ .../cloud/automl/v1/ModelEvaluation.java | 1552 ++++++++++ .../cloud/automl/v1/ModelEvaluationName.java | 251 ++ .../automl/v1/ModelEvaluationOrBuilder.java | 159 ++ .../automl/v1/ModelEvaluationOuterClass.java | 95 + .../com/google/cloud/automl/v1/ModelName.java | 210 ++ .../cloud/automl/v1/ModelOrBuilder.java | 296 ++ .../cloud/automl/v1/ModelOuterClass.java | 116 + .../cloud/automl/v1/OperationMetadata.java | 2271 +++++++++++++++ .../automl/v1/OperationMetadataOrBuilder.java | 229 ++ .../google/cloud/automl/v1/Operations.java | 137 + .../google/cloud/automl/v1/OutputConfig.java | 892 ++++++ .../automl/v1/OutputConfigOrBuilder.java | 73 + .../cloud/automl/v1/PredictRequest.java | 1216 ++++++++ .../automl/v1/PredictRequestOrBuilder.java | 139 + .../cloud/automl/v1/PredictResponse.java | 1274 +++++++++ .../automl/v1/PredictResponseOrBuilder.java | 136 + .../automl/v1/PredictionServiceProto.java | 152 + .../google/cloud/automl/v1/TextSnippet.java | 953 +++++++ .../cloud/automl/v1/TextSnippetOrBuilder.java | 94 + .../automl/v1/TranslationAnnotation.java | 717 +++++ .../v1/TranslationAnnotationOrBuilder.java | 56 + .../automl/v1/TranslationDatasetMetadata.java | 775 +++++ .../TranslationDatasetMetadataOrBuilder.java | 67 + .../v1/TranslationEvaluationMetrics.java | 618 ++++ ...TranslationEvaluationMetricsOrBuilder.java | 47 + .../automl/v1/TranslationModelMetadata.java | 970 +++++++ .../v1/TranslationModelMetadataOrBuilder.java | 98 + .../cloud/automl/v1/TranslationProto.java | 126 + .../cloud/automl/v1/UpdateDatasetRequest.java | 974 +++++++ .../v1/UpdateDatasetRequestOrBuilder.java | 87 + .../cloud/automl/v1/UpdateModelRequest.java | 967 +++++++ .../v1/UpdateModelRequestOrBuilder.java | 87 + .../cloud/automl/v1/annotation_payload.proto | 39 + .../google/cloud/automl/v1/data_items.proto | 55 + .../google/cloud/automl/v1/dataset.proto | 74 + .../proto/google/cloud/automl/v1/io.proto | 109 + .../proto/google/cloud/automl/v1/model.proto | 86 + .../cloud/automl/v1/model_evaluation.proto | 62 + .../google/cloud/automl/v1/operations.proto | 74 + .../cloud/automl/v1/prediction_service.proto | 78 + .../google/cloud/automl/v1/service.proto | 372 +++ .../google/cloud/automl/v1/translation.proto | 70 + synth.metadata | 16 +- synth.py | 2 +- versions.txt | 2 + 124 files changed, 52448 insertions(+), 4 deletions(-) create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceClient.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceSettings.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/package-info.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlCallableFactory.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceCallableFactory.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceStub.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStub.java create mode 100644 google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java create mode 100644 google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java create mode 100644 google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMl.java create mode 100644 google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMlImpl.java create mode 100644 google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionService.java create mode 100644 google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionServiceImpl.java create mode 100644 google-cloud-automl/src/test/java/com/google/cloud/automl/v1/PredictionServiceClientTest.java create mode 100644 grpc-google-cloud-automl-v1/pom.xml create mode 100644 grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AutoMlGrpc.java create mode 100644 grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceGrpc.java create mode 100644 proto-google-cloud-automl-v1/pom.xml create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayload.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOuterClass.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AutoMlProto.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelOperationMetadata.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelOperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DataItems.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Dataset.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetName.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOuterClass.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteDatasetRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteDatasetRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteModelRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteModelRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteOperationMetadata.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteOperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayload.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayloadOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestination.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestinationOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSource.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSourceOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetDatasetRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetDatasetRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelEvaluationRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelEvaluationRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfig.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfigOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Io.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsResponse.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsResponseOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsResponse.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsResponseOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsResponse.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsResponseOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/LocationName.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Model.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluation.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationName.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOuterClass.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelName.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOuterClass.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadata.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Operations.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OutputConfig.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OutputConfigOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponse.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponseOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceProto.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSnippet.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSnippetOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationAnnotation.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationAnnotationOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadata.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadataOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationEvaluationMetrics.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationEvaluationMetricsOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationModelMetadata.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationModelMetadataOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationProto.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateDatasetRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateDatasetRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateModelRequest.java create mode 100644 proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateModelRequestOrBuilder.java create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_payload.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/data_items.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/dataset.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/io.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model_evaluation.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/operations.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/prediction_service.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/service.proto create mode 100644 proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/translation.proto diff --git a/google-cloud-automl/pom.xml b/google-cloud-automl/pom.xml index c9df561cc..2f4d1259d 100644 --- a/google-cloud-automl/pom.xml +++ b/google-cloud-automl/pom.xml @@ -46,6 +46,10 @@ com.google.api.grpc proto-google-cloud-automl-v1beta1 + + com.google.api.grpc + proto-google-cloud-automl-v1 + com.google.guava guava @@ -75,6 +79,11 @@ grpc-google-cloud-automl-v1beta1 test + + com.google.api.grpc + grpc-google-cloud-automl-v1 + test + com.google.api 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 new file mode 100644 index 000000000..b45798fcf --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java @@ -0,0 +1,2095 @@ +/* + * 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.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.stub.AutoMlStub; +import com.google.cloud.automl.v1.stub.AutoMlStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: AutoML Server API. + * + *

The resource names are assigned by the server. The server never reuses names that it has + * created after the resources with those names are deleted. + * + *

An ID of a resource is the last element of the item's resource name. For + * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then the id for the item + * is `{dataset_id}`. + * + *

Currently the only supported `location_id` is "us-central1". + * + *

On any input that is documented to expect a string parameter in snake_case or kebab-case, + * either of those cases is accepted. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Dataset dataset = Dataset.newBuilder().build();
+ *   Operation response = autoMlClient.createDataset(parent, dataset);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the autoMlClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of AutoMlSettings to create(). + * For example: + * + *

To customize credentials: + * + *

+ * 
+ * AutoMlSettings autoMlSettings =
+ *     AutoMlSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AutoMlClient autoMlClient =
+ *     AutoMlClient.create(autoMlSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AutoMlSettings autoMlSettings =
+ *     AutoMlSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AutoMlClient autoMlClient =
+ *     AutoMlClient.create(autoMlSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AutoMlClient implements BackgroundResource { + private final AutoMlSettings settings; + private final AutoMlStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of AutoMlClient with default settings. */ + public static final AutoMlClient create() throws IOException { + return create(AutoMlSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AutoMlClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final AutoMlClient create(AutoMlSettings settings) throws IOException { + return new AutoMlClient(settings); + } + + /** + * Constructs an instance of AutoMlClient, using the given stub for making calls. This is for + * advanced usage - prefer to use AutoMlSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AutoMlClient create(AutoMlStub stub) { + return new AutoMlClient(stub); + } + + /** + * Constructs an instance of AutoMlClient, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected AutoMlClient(AutoMlSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AutoMlStubSettings) 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 AutoMlClient(AutoMlStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AutoMlSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AutoMlStub 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 + /** + * Creates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Operation response = autoMlClient.createDataset(parent, dataset);
+   * }
+   * 
+ * + * @param parent The resource name of the project to create the dataset for. + * @param dataset The dataset to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation createDataset(LocationName parent, Dataset dataset) { + + CreateDatasetRequest request = + CreateDatasetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDataset(dataset) + .build(); + return createDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Operation response = autoMlClient.createDataset(parent.toString(), dataset);
+   * }
+   * 
+ * + * @param parent The resource name of the project to create the dataset for. + * @param dataset The dataset to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation createDataset(String parent, Dataset dataset) { + + CreateDatasetRequest request = + CreateDatasetRequest.newBuilder().setParent(parent).setDataset(dataset).build(); + return createDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setDataset(dataset)
+   *     .build();
+   *   Operation response = autoMlClient.createDataset(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 Operation createDataset(CreateDatasetRequest request) { + return createDatasetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setDataset(dataset)
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.createDatasetCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createDatasetCallable() { + return stub.createDatasetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Dataset response = autoMlClient.updateDataset(dataset, updateMask);
+   * }
+   * 
+ * + * @param dataset The dataset which replaces the resource on the server. + * @param updateMask Required. The update mask applies to the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dataset updateDataset(Dataset dataset, FieldMask updateMask) { + + UpdateDatasetRequest request = + UpdateDatasetRequest.newBuilder().setDataset(dataset).setUpdateMask(updateMask).build(); + return updateDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
+   *     .setDataset(dataset)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Dataset response = autoMlClient.updateDataset(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 Dataset updateDataset(UpdateDatasetRequest request) { + return updateDatasetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
+   *     .setDataset(dataset)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
+   *   // Do something
+   *   Dataset response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateDatasetCallable() { + return stub.updateDatasetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a dataset. + * + *

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   GetDatasetRequest request = GetDatasetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Dataset response = autoMlClient.getDataset(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 Dataset getDataset(GetDatasetRequest request) { + return getDatasetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   GetDatasetRequest request = GetDatasetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Dataset> future = autoMlClient.getDatasetCallable().futureCall(request);
+   *   // Do something
+   *   Dataset response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getDatasetCallable() { + return stub.getDatasetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists datasets in a project. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The resource name of the project from which to list datasets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatasetsPagedResponse listDatasets(LocationName parent) { + ListDatasetsRequest request = + ListDatasetsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDatasets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists datasets in a project. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Dataset element : autoMlClient.listDatasets(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The resource name of the project from which to list datasets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatasetsPagedResponse listDatasets(String parent) { + ListDatasetsRequest request = ListDatasetsRequest.newBuilder().setParent(parent).build(); + return listDatasets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists datasets in a project. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Dataset element : autoMlClient.listDatasets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) { + return listDatasetsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists datasets in a project. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListDatasetsPagedResponse> future = autoMlClient.listDatasetsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Dataset element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listDatasetsPagedCallable() { + return stub.listDatasetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists datasets in a project. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request);
+   *     for (Dataset element : response.getDatasetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listDatasetsCallable() { + return stub.listDatasetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   autoMlClient.deleteDatasetAsync(name).get();
+   * }
+   * 
+ * + * @param name The resource name of the dataset to delete. + * @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 deleteDatasetAsync(DatasetName name) { + + DeleteDatasetRequest request = + DeleteDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteDatasetAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   autoMlClient.deleteDatasetAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name The resource name of the dataset to delete. + * @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 deleteDatasetAsync(String name) { + + DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder().setName(name).build(); + return deleteDatasetAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   autoMlClient.deleteDatasetAsync(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 deleteDatasetAsync( + DeleteDatasetRequest request) { + return deleteDatasetOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteDatasetOperationCallable().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 + deleteDatasetOperationCallable() { + return stub.deleteDatasetOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteDatasetCallable() { + return stub.deleteDatasetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Imports data into a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   autoMlClient.importDataAsync(name, inputConfig).get();
+   * }
+   * 
+ * + * @param name Required. Dataset name. Dataset must already exist. All imported annotations and + * examples will be added. + * @param inputConfig Required. The desired input location and its domain specific semantics, if + * any. + * @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 importDataAsync( + DatasetName name, InputConfig inputConfig) { + + ImportDataRequest request = + ImportDataRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setInputConfig(inputConfig) + .build(); + return importDataAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Imports data into a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   autoMlClient.importDataAsync(name.toString(), inputConfig).get();
+   * }
+   * 
+ * + * @param name Required. Dataset name. Dataset must already exist. All imported annotations and + * examples will be added. + * @param inputConfig Required. The desired input location and its domain specific semantics, if + * any. + * @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 importDataAsync( + String name, InputConfig inputConfig) { + + ImportDataRequest request = + ImportDataRequest.newBuilder().setName(name).setInputConfig(inputConfig).build(); + return importDataAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Imports data into a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataRequest request = ImportDataRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   autoMlClient.importDataAsync(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 importDataAsync( + ImportDataRequest request) { + return importDataOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Imports data into a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataRequest request = ImportDataRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.importDataOperationCallable().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 + importDataOperationCallable() { + return stub.importDataOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Imports data into a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataRequest request = ImportDataRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.importDataCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable importDataCallable() { + return stub.importDataCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   autoMlClient.exportDataAsync(name, outputConfig).get();
+   * }
+   * 
+ * + * @param name Required. The resource name of the dataset. + * @param outputConfig Required. The desired output location. + * @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 exportDataAsync( + DatasetName name, OutputConfig outputConfig) { + + ExportDataRequest request = + ExportDataRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setOutputConfig(outputConfig) + .build(); + return exportDataAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   autoMlClient.exportDataAsync(name.toString(), outputConfig).get();
+   * }
+   * 
+ * + * @param name Required. The resource name of the dataset. + * @param outputConfig Required. The desired output location. + * @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 exportDataAsync( + String name, OutputConfig outputConfig) { + + ExportDataRequest request = + ExportDataRequest.newBuilder().setName(name).setOutputConfig(outputConfig).build(); + return exportDataAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataRequest request = ExportDataRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   autoMlClient.exportDataAsync(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 exportDataAsync( + ExportDataRequest request) { + return exportDataOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataRequest request = ExportDataRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportDataOperationCallable().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 + exportDataOperationCallable() { + return stub.exportDataOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataRequest request = ExportDataRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.exportDataCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable exportDataCallable() { + return stub.exportDataCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   Model response = autoMlClient.createModelAsync(parent, model).get();
+   * }
+   * 
+ * + * @param parent Resource name of the parent project where the model is being created. + * @param model The model to create. + * @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 createModelAsync( + LocationName parent, Model model) { + + CreateModelRequest request = + CreateModelRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setModel(model) + .build(); + return createModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   Model response = autoMlClient.createModelAsync(parent.toString(), model).get();
+   * }
+   * 
+ * + * @param parent Resource name of the parent project where the model is being created. + * @param model The model to create. + * @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 createModelAsync( + String parent, Model model) { + + CreateModelRequest request = + CreateModelRequest.newBuilder().setParent(parent).setModel(model).build(); + return createModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   CreateModelRequest request = CreateModelRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setModel(model)
+   *     .build();
+   *   Model response = autoMlClient.createModelAsync(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 createModelAsync( + CreateModelRequest request) { + return createModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   CreateModelRequest request = CreateModelRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setModel(model)
+   *     .build();
+   *   OperationFuture<Model, OperationMetadata> future = autoMlClient.createModelOperationCallable().futureCall(request);
+   *   // Do something
+   *   Model response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createModelOperationCallable() { + return stub.createModelOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   CreateModelRequest request = CreateModelRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setModel(model)
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createModelCallable() { + return stub.createModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a model. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   Model response = autoMlClient.getModel(name);
+   * }
+   * 
+ * + * @param name Resource name of the model. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Model getModel(ModelName name) { + + GetModelRequest request = + GetModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a model. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   Model response = autoMlClient.getModel(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the model. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Model getModel(String name) { + + GetModelRequest request = GetModelRequest.newBuilder().setName(name).build(); + return getModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a model. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   GetModelRequest request = GetModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Model response = autoMlClient.getModel(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 Model getModel(GetModelRequest request) { + return getModelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a model. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   GetModelRequest request = GetModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Model> future = autoMlClient.getModelCallable().futureCall(request);
+   *   // Do something
+   *   Model response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getModelCallable() { + return stub.getModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a model. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Model model = Model.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Model response = autoMlClient.updateModel(model, updateMask);
+   * }
+   * 
+ * + * @param model The model which replaces the resource on the server. + * @param updateMask Required. The update mask applies to the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Model updateModel(Model model, FieldMask updateMask) { + + UpdateModelRequest request = + UpdateModelRequest.newBuilder().setModel(model).setUpdateMask(updateMask).build(); + return updateModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a model. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Model model = Model.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateModelRequest request = UpdateModelRequest.newBuilder()
+   *     .setModel(model)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Model response = autoMlClient.updateModel(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 Model updateModel(UpdateModelRequest request) { + return updateModelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a model. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Model model = Model.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateModelRequest request = UpdateModelRequest.newBuilder()
+   *     .setModel(model)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Model> future = autoMlClient.updateModelCallable().futureCall(request);
+   *   // Do something
+   *   Model response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateModelCallable() { + return stub.updateModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists models. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Model element : autoMlClient.listModels(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the project, from which to list the models. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelsPagedResponse listModels(LocationName parent) { + ListModelsRequest request = + ListModelsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listModels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists models. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Model element : autoMlClient.listModels(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the project, from which to list the models. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelsPagedResponse listModels(String parent) { + ListModelsRequest request = ListModelsRequest.newBuilder().setParent(parent).build(); + return listModels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists models. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListModelsRequest request = ListModelsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Model element : autoMlClient.listModels(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelsPagedResponse listModels(ListModelsRequest request) { + return listModelsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists models. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListModelsRequest request = ListModelsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListModelsPagedResponse> future = autoMlClient.listModelsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Model element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listModelsPagedCallable() { + return stub.listModelsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists models. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListModelsRequest request = ListModelsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListModelsResponse response = autoMlClient.listModelsCallable().call(request);
+   *     for (Model element : response.getModelList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listModelsCallable() { + return stub.listModelsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deleteModelAsync(name).get();
+   * }
+   * 
+ * + * @param name Resource name of the model being deleted. + * @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 deleteModelAsync(ModelName name) { + + DeleteModelRequest request = + DeleteModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deleteModelAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name Resource name of the model being deleted. + * @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 deleteModelAsync(String name) { + + DeleteModelRequest request = DeleteModelRequest.newBuilder().setName(name).build(); + return deleteModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   autoMlClient.deleteModelAsync(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 deleteModelAsync( + DeleteModelRequest request) { + return deleteModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteModelOperationCallable().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 + deleteModelOperationCallable() { + return stub.deleteModelOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteModelCallable() { + return stub.deleteModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a model evaluation. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
+   *   ModelEvaluation response = autoMlClient.getModelEvaluation(name);
+   * }
+   * 
+ * + * @param name Resource name for the model evaluation. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ModelEvaluation getModelEvaluation(ModelEvaluationName name) { + + GetModelEvaluationRequest request = + GetModelEvaluationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getModelEvaluation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a model evaluation. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
+   *   ModelEvaluation response = autoMlClient.getModelEvaluation(name.toString());
+   * }
+   * 
+ * + * @param name Resource name for the model evaluation. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ModelEvaluation getModelEvaluation(String name) { + + GetModelEvaluationRequest request = + GetModelEvaluationRequest.newBuilder().setName(name).build(); + return getModelEvaluation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a model evaluation. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
+   *   GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ModelEvaluation response = autoMlClient.getModelEvaluation(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 ModelEvaluation getModelEvaluation(GetModelEvaluationRequest request) { + return getModelEvaluationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a model evaluation. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
+   *   GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<ModelEvaluation> future = autoMlClient.getModelEvaluationCallable().futureCall(request);
+   *   // Do something
+   *   ModelEvaluation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getModelEvaluationCallable() { + return stub.getModelEvaluationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists model evaluations. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   String filter = "";
+   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the model to list the model evaluations for. If modelId is set + * as "-", this will list model evaluations from across all models of the parent location. + * @param filter An expression for filtering the results of the request. + *

* `annotation_spec_id` - for =, != or existence. See example below for the last. + *

Some examples of using the filter are: + *

* `annotation_spec_id!=4` --> The model evaluation was done for annotation spec + * with ID different than 4. * `NOT annotation_spec_id:*` --> The model evaluation + * was done for aggregate of all annotation specs. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelEvaluationsPagedResponse listModelEvaluations( + ModelName parent, String filter) { + ListModelEvaluationsRequest request = + ListModelEvaluationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setFilter(filter) + .build(); + return listModelEvaluations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists model evaluations. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   String filter = "";
+   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent.toString(), filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the model to list the model evaluations for. If modelId is set + * as "-", this will list model evaluations from across all models of the parent location. + * @param filter An expression for filtering the results of the request. + *

* `annotation_spec_id` - for =, != or existence. See example below for the last. + *

Some examples of using the filter are: + *

* `annotation_spec_id!=4` --> The model evaluation was done for annotation spec + * with ID different than 4. * `NOT annotation_spec_id:*` --> The model evaluation + * was done for aggregate of all annotation specs. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelEvaluationsPagedResponse listModelEvaluations( + String parent, String filter) { + ListModelEvaluationsRequest request = + ListModelEvaluationsRequest.newBuilder().setParent(parent).setFilter(filter).build(); + return listModelEvaluations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists model evaluations. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   String filter = "";
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setFilter(filter)
+   *     .build();
+   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelEvaluationsPagedResponse listModelEvaluations( + ListModelEvaluationsRequest request) { + return listModelEvaluationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists model evaluations. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   String filter = "";
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setFilter(filter)
+   *     .build();
+   *   ApiFuture<ListModelEvaluationsPagedResponse> future = autoMlClient.listModelEvaluationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ModelEvaluation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listModelEvaluationsPagedCallable() { + return stub.listModelEvaluationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists model evaluations. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   String filter = "";
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setFilter(filter)
+   *     .build();
+   *   while (true) {
+   *     ListModelEvaluationsResponse response = autoMlClient.listModelEvaluationsCallable().call(request);
+   *     for (ModelEvaluation element : response.getModelEvaluationList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listModelEvaluationsCallable() { + return stub.listModelEvaluationsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListDatasetsPagedResponse + extends AbstractPagedListResponse< + ListDatasetsRequest, + ListDatasetsResponse, + Dataset, + ListDatasetsPage, + ListDatasetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDatasetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListDatasetsPagedResponse apply(ListDatasetsPage input) { + return new ListDatasetsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListDatasetsPagedResponse(ListDatasetsPage page) { + super(page, ListDatasetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDatasetsPage + extends AbstractPage { + + private ListDatasetsPage( + PageContext context, + ListDatasetsResponse response) { + super(context, response); + } + + private static ListDatasetsPage createEmptyPage() { + return new ListDatasetsPage(null, null); + } + + @Override + protected ListDatasetsPage createPage( + PageContext context, + ListDatasetsResponse response) { + return new ListDatasetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDatasetsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDatasetsRequest, + ListDatasetsResponse, + Dataset, + ListDatasetsPage, + ListDatasetsFixedSizeCollection> { + + private ListDatasetsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDatasetsFixedSizeCollection createEmptyCollection() { + return new ListDatasetsFixedSizeCollection(null, 0); + } + + @Override + protected ListDatasetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDatasetsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListModelsPagedResponse + extends AbstractPagedListResponse< + ListModelsRequest, + ListModelsResponse, + Model, + ListModelsPage, + ListModelsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListModelsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListModelsPagedResponse apply(ListModelsPage input) { + return new ListModelsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListModelsPagedResponse(ListModelsPage page) { + super(page, ListModelsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListModelsPage + extends AbstractPage { + + private ListModelsPage( + PageContext context, + ListModelsResponse response) { + super(context, response); + } + + private static ListModelsPage createEmptyPage() { + return new ListModelsPage(null, null); + } + + @Override + protected ListModelsPage createPage( + PageContext context, + ListModelsResponse response) { + return new ListModelsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListModelsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListModelsRequest, + ListModelsResponse, + Model, + ListModelsPage, + ListModelsFixedSizeCollection> { + + private ListModelsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListModelsFixedSizeCollection createEmptyCollection() { + return new ListModelsFixedSizeCollection(null, 0); + } + + @Override + protected ListModelsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListModelsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListModelEvaluationsPagedResponse + extends AbstractPagedListResponse< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ModelEvaluation, + ListModelEvaluationsPage, + ListModelEvaluationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListModelEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListModelEvaluationsPagedResponse apply(ListModelEvaluationsPage input) { + return new ListModelEvaluationsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListModelEvaluationsPagedResponse(ListModelEvaluationsPage page) { + super(page, ListModelEvaluationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListModelEvaluationsPage + extends AbstractPage< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ModelEvaluation, + ListModelEvaluationsPage> { + + private ListModelEvaluationsPage( + PageContext + context, + ListModelEvaluationsResponse response) { + super(context, response); + } + + private static ListModelEvaluationsPage createEmptyPage() { + return new ListModelEvaluationsPage(null, null); + } + + @Override + protected ListModelEvaluationsPage createPage( + PageContext + context, + ListModelEvaluationsResponse response) { + return new ListModelEvaluationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListModelEvaluationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ModelEvaluation, + ListModelEvaluationsPage, + ListModelEvaluationsFixedSizeCollection> { + + private ListModelEvaluationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListModelEvaluationsFixedSizeCollection createEmptyCollection() { + return new ListModelEvaluationsFixedSizeCollection(null, 0); + } + + @Override + protected ListModelEvaluationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListModelEvaluationsFixedSizeCollection(pages, collectionSize); + } + } +} 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 new file mode 100644 index 000000000..ad1616670 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java @@ -0,0 +1,407 @@ +/* + * 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 static com.google.cloud.automl.v1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.automl.v1.stub.AutoMlStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AutoMlClient}. + * + *

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

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

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

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

+ * 
+ * AutoMlSettings.Builder autoMlSettingsBuilder =
+ *     AutoMlSettings.newBuilder();
+ * autoMlSettingsBuilder.createDatasetSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AutoMlSettings autoMlSettings = autoMlSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AutoMlSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createDataset. */ + public UnaryCallSettings createDatasetSettings() { + return ((AutoMlStubSettings) getStubSettings()).createDatasetSettings(); + } + + /** Returns the object with the settings used for calls to updateDataset. */ + public UnaryCallSettings updateDatasetSettings() { + return ((AutoMlStubSettings) getStubSettings()).updateDatasetSettings(); + } + + /** Returns the object with the settings used for calls to getDataset. */ + public UnaryCallSettings getDatasetSettings() { + return ((AutoMlStubSettings) getStubSettings()).getDatasetSettings(); + } + + /** Returns the object with the settings used for calls to listDatasets. */ + public PagedCallSettings + listDatasetsSettings() { + return ((AutoMlStubSettings) getStubSettings()).listDatasetsSettings(); + } + + /** Returns the object with the settings used for calls to deleteDataset. */ + public UnaryCallSettings deleteDatasetSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteDatasetSettings(); + } + + /** Returns the object with the settings used for calls to deleteDataset. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteDatasetOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteDatasetOperationSettings(); + } + + /** Returns the object with the settings used for calls to importData. */ + public UnaryCallSettings importDataSettings() { + return ((AutoMlStubSettings) getStubSettings()).importDataSettings(); + } + + /** Returns the object with the settings used for calls to importData. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + importDataOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).importDataOperationSettings(); + } + + /** Returns the object with the settings used for calls to exportData. */ + public UnaryCallSettings exportDataSettings() { + return ((AutoMlStubSettings) getStubSettings()).exportDataSettings(); + } + + /** Returns the object with the settings used for calls to exportData. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + exportDataOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).exportDataOperationSettings(); + } + + /** Returns the object with the settings used for calls to createModel. */ + public UnaryCallSettings createModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).createModelSettings(); + } + + /** Returns the object with the settings used for calls to createModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createModelOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).createModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to getModel. */ + public UnaryCallSettings getModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).getModelSettings(); + } + + /** Returns the object with the settings used for calls to updateModel. */ + public UnaryCallSettings updateModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).updateModelSettings(); + } + + /** Returns the object with the settings used for calls to listModels. */ + public PagedCallSettings + listModelsSettings() { + return ((AutoMlStubSettings) getStubSettings()).listModelsSettings(); + } + + /** Returns the object with the settings used for calls to deleteModel. */ + public UnaryCallSettings deleteModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteModelSettings(); + } + + /** Returns the object with the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteModelOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to getModelEvaluation. */ + public UnaryCallSettings + getModelEvaluationSettings() { + return ((AutoMlStubSettings) getStubSettings()).getModelEvaluationSettings(); + } + + /** Returns the object with the settings used for calls to listModelEvaluations. */ + public PagedCallSettings< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings() { + return ((AutoMlStubSettings) getStubSettings()).listModelEvaluationsSettings(); + } + + public static final AutoMlSettings create(AutoMlStubSettings stub) throws IOException { + return new AutoMlSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AutoMlStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AutoMlStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AutoMlStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AutoMlStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AutoMlStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AutoMlStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AutoMlStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AutoMlSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AutoMlSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AutoMlStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AutoMlStubSettings.newBuilder()); + } + + protected Builder(AutoMlSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AutoMlStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public AutoMlStubSettings.Builder getStubSettingsBuilder() { + return ((AutoMlStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createDataset. */ + public UnaryCallSettings.Builder createDatasetSettings() { + return getStubSettingsBuilder().createDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to updateDataset. */ + public UnaryCallSettings.Builder updateDatasetSettings() { + return getStubSettingsBuilder().updateDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to getDataset. */ + public UnaryCallSettings.Builder getDatasetSettings() { + return getStubSettingsBuilder().getDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to listDatasets. */ + public PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings() { + return getStubSettingsBuilder().listDatasetsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDataset. */ + public UnaryCallSettings.Builder deleteDatasetSettings() { + return getStubSettingsBuilder().deleteDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDataset. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteDatasetOperationSettings() { + return getStubSettingsBuilder().deleteDatasetOperationSettings(); + } + + /** Returns the builder for the settings used for calls to importData. */ + public UnaryCallSettings.Builder importDataSettings() { + return getStubSettingsBuilder().importDataSettings(); + } + + /** Returns the builder for the settings used for calls to importData. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + importDataOperationSettings() { + return getStubSettingsBuilder().importDataOperationSettings(); + } + + /** Returns the builder for the settings used for calls to exportData. */ + public UnaryCallSettings.Builder exportDataSettings() { + return getStubSettingsBuilder().exportDataSettings(); + } + + /** Returns the builder for the settings used for calls to exportData. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportDataOperationSettings() { + return getStubSettingsBuilder().exportDataOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createModel. */ + public UnaryCallSettings.Builder createModelSettings() { + return getStubSettingsBuilder().createModelSettings(); + } + + /** Returns the builder for the settings used for calls to createModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createModelOperationSettings() { + return getStubSettingsBuilder().createModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getModel. */ + public UnaryCallSettings.Builder getModelSettings() { + return getStubSettingsBuilder().getModelSettings(); + } + + /** Returns the builder for the settings used for calls to updateModel. */ + public UnaryCallSettings.Builder updateModelSettings() { + return getStubSettingsBuilder().updateModelSettings(); + } + + /** Returns the builder for the settings used for calls to listModels. */ + public PagedCallSettings.Builder + listModelsSettings() { + return getStubSettingsBuilder().listModelsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + public UnaryCallSettings.Builder deleteModelSettings() { + return getStubSettingsBuilder().deleteModelSettings(); + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteModelOperationSettings() { + return getStubSettingsBuilder().deleteModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getModelEvaluation. */ + public UnaryCallSettings.Builder + getModelEvaluationSettings() { + return getStubSettingsBuilder().getModelEvaluationSettings(); + } + + /** Returns the builder for the settings used for calls to listModelEvaluations. */ + public PagedCallSettings.Builder< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings() { + return getStubSettingsBuilder().listModelEvaluationsSettings(); + } + + @Override + public AutoMlSettings build() throws IOException { + return new AutoMlSettings(this); + } + } +} 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 new file mode 100644 index 000000000..00d84135d --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceClient.java @@ -0,0 +1,304 @@ +/* + * 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.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.stub.PredictionServiceStub; +import com.google.cloud.automl.v1.stub.PredictionServiceStubSettings; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: AutoML Prediction API. + * + *

On any input that is documented to expect a string parameter in snake_case or kebab-case, + * either of those cases is accepted. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+ *   ExamplePayload payload = ExamplePayload.newBuilder().build();
+ *   Map<String, String> params = new HashMap<>();
+ *   PredictResponse response = predictionServiceClient.predict(name, payload, params);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the predictionServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of PredictionServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * PredictionServiceSettings predictionServiceSettings =
+ *     PredictionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * PredictionServiceClient predictionServiceClient =
+ *     PredictionServiceClient.create(predictionServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * PredictionServiceSettings predictionServiceSettings =
+ *     PredictionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PredictionServiceClient predictionServiceClient =
+ *     PredictionServiceClient.create(predictionServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionServiceClient implements BackgroundResource { + private final PredictionServiceSettings settings; + private final PredictionServiceStub stub; + + /** Constructs an instance of PredictionServiceClient with default settings. */ + public static final PredictionServiceClient create() throws IOException { + return create(PredictionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of PredictionServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final PredictionServiceClient create(PredictionServiceSettings settings) + throws IOException { + return new PredictionServiceClient(settings); + } + + /** + * Constructs an instance of PredictionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer to use PredictionServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final PredictionServiceClient create(PredictionServiceStub stub) { + return new PredictionServiceClient(stub); + } + + /** + * Constructs an instance of PredictionServiceClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected PredictionServiceClient(PredictionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((PredictionServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @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; + } + + public final PredictionServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PredictionServiceStub getStub() { + return stub; + } + + // 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. + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ExamplePayload payload = ExamplePayload.newBuilder().build();
+   *   Map<String, String> params = new HashMap<>();
+   *   PredictResponse response = predictionServiceClient.predict(name, payload, params);
+   * }
+   * 
+ * + * @param name Name of the model requested to serve the prediction. + * @param payload Required. Payload to perform a prediction on. The payload must match the problem + * type that the model was trained to solve. + * @param params Additional domain-specific parameters, any string must be up to 25000 characters + * long. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PredictResponse predict( + ModelName name, ExamplePayload payload, Map params) { + + PredictRequest request = + PredictRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setPayload(payload) + .putAllParams(params) + .build(); + return predict(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. + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ExamplePayload payload = ExamplePayload.newBuilder().build();
+   *   Map<String, String> params = new HashMap<>();
+   *   PredictResponse response = predictionServiceClient.predict(name.toString(), payload, params);
+   * }
+   * 
+ * + * @param name Name of the model requested to serve the prediction. + * @param payload Required. Payload to perform a prediction on. The payload must match the problem + * type that the model was trained to solve. + * @param params Additional domain-specific parameters, any string must be up to 25000 characters + * long. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PredictResponse predict( + String name, ExamplePayload payload, Map params) { + + PredictRequest request = + PredictRequest.newBuilder().setName(name).setPayload(payload).putAllParams(params).build(); + return predict(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. + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ExamplePayload payload = ExamplePayload.newBuilder().build();
+   *   PredictRequest request = PredictRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setPayload(payload)
+   *     .build();
+   *   PredictResponse response = predictionServiceClient.predict(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 PredictResponse predict(PredictRequest request) { + return predictCallable().call(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. + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ExamplePayload payload = ExamplePayload.newBuilder().build();
+   *   PredictRequest request = PredictRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setPayload(payload)
+   *     .build();
+   *   ApiFuture<PredictResponse> future = predictionServiceClient.predictCallable().futureCall(request);
+   *   // Do something
+   *   PredictResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable predictCallable() { + return stub.predictCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} 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 new file mode 100644 index 000000000..674f3f055 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceSettings.java @@ -0,0 +1,175 @@ +/* + * 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.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.automl.v1.stub.PredictionServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link PredictionServiceClient}. + * + *

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

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

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

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

+ * 
+ * PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceSettings.newBuilder();
+ * predictionServiceSettingsBuilder.predictSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to predict. */ + public UnaryCallSettings predictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).predictSettings(); + } + + public static final PredictionServiceSettings create(PredictionServiceStubSettings stub) + throws IOException { + return new PredictionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PredictionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PredictionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PredictionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PredictionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PredictionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PredictionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PredictionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected PredictionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PredictionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(PredictionServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(PredictionServiceStubSettings.newBuilder()); + } + + protected Builder(PredictionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PredictionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public PredictionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((PredictionServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to predict. */ + public UnaryCallSettings.Builder predictSettings() { + return getStubSettingsBuilder().predictSettings(); + } + + @Override + public PredictionServiceSettings build() throws IOException { + return new PredictionServiceSettings(this); + } + } +} diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/package-info.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/package-info.java new file mode 100644 index 000000000..247ee7b09 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/package-info.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. + */ + +/** + * A client to Cloud AutoML API. + * + *

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

============ AutoMlClient ============ + * + *

Service Description: AutoML Server API. + * + *

The resource names are assigned by the server. The server never reuses names that it has + * created after the resources with those names are deleted. + * + *

An ID of a resource is the last element of the item's resource name. For + * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then the id for the item + * is `{dataset_id}`. + * + *

Currently the only supported `location_id` is "us-central1". + * + *

On any input that is documented to expect a string parameter in snake_case or kebab-case, + * either of those cases is accepted. + * + *

Sample for AutoMlClient: + * + *

+ * 
+ * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Dataset dataset = Dataset.newBuilder().build();
+ *   Operation response = autoMlClient.createDataset(parent, dataset);
+ * }
+ * 
+ * 
+ * + * ======================= PredictionServiceClient ======================= + * + *

Service Description: AutoML Prediction API. + * + *

On any input that is documented to expect a string parameter in snake_case or kebab-case, + * either of those cases is accepted. + * + *

Sample for PredictionServiceClient: + * + *

+ * 
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+ *   ExamplePayload payload = ExamplePayload.newBuilder().build();
+ *   Map<String, String> params = new HashMap<>();
+ *   PredictResponse response = predictionServiceClient.predict(name, payload, params);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.automl.v1; + +import javax.annotation.Generated; 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 new file mode 100644 index 000000000..e8170e6be --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java @@ -0,0 +1,169 @@ +/* + * 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.stub; + +import static com.google.cloud.automl.v1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelsPagedResponse; + +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.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.ExportDataRequest; +import com.google.cloud.automl.v1.GetDatasetRequest; +import com.google.cloud.automl.v1.GetModelEvaluationRequest; +import com.google.cloud.automl.v1.GetModelRequest; +import com.google.cloud.automl.v1.ImportDataRequest; +import com.google.cloud.automl.v1.ListDatasetsRequest; +import com.google.cloud.automl.v1.ListDatasetsResponse; +import com.google.cloud.automl.v1.ListModelEvaluationsRequest; +import com.google.cloud.automl.v1.ListModelEvaluationsResponse; +import com.google.cloud.automl.v1.ListModelsRequest; +import com.google.cloud.automl.v1.ListModelsResponse; +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.UpdateDatasetRequest; +import com.google.cloud.automl.v1.UpdateModelRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud AutoML API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class AutoMlStub 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 createDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: createDatasetCallable()"); + } + + public UnaryCallable updateDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: updateDatasetCallable()"); + } + + public UnaryCallable getDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: getDatasetCallable()"); + } + + public UnaryCallable listDatasetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDatasetsPagedCallable()"); + } + + public UnaryCallable listDatasetsCallable() { + throw new UnsupportedOperationException("Not implemented: listDatasetsCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteDatasetOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDatasetOperationCallable()"); + } + + public UnaryCallable deleteDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDatasetCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + importDataOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importDataOperationCallable()"); + } + + public UnaryCallable importDataCallable() { + throw new UnsupportedOperationException("Not implemented: importDataCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportDataOperationCallable() { + throw new UnsupportedOperationException("Not implemented: exportDataOperationCallable()"); + } + + public UnaryCallable exportDataCallable() { + throw new UnsupportedOperationException("Not implemented: exportDataCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createModelOperationCallable()"); + } + + public UnaryCallable createModelCallable() { + throw new UnsupportedOperationException("Not implemented: createModelCallable()"); + } + + public UnaryCallable getModelCallable() { + throw new UnsupportedOperationException("Not implemented: getModelCallable()"); + } + + public UnaryCallable updateModelCallable() { + throw new UnsupportedOperationException("Not implemented: updateModelCallable()"); + } + + public UnaryCallable listModelsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listModelsPagedCallable()"); + } + + public UnaryCallable listModelsCallable() { + throw new UnsupportedOperationException("Not implemented: listModelsCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteModelOperationCallable()"); + } + + public UnaryCallable deleteModelCallable() { + throw new UnsupportedOperationException("Not implemented: deleteModelCallable()"); + } + + public UnaryCallable getModelEvaluationCallable() { + throw new UnsupportedOperationException("Not implemented: getModelEvaluationCallable()"); + } + + public UnaryCallable + listModelEvaluationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listModelEvaluationsPagedCallable()"); + } + + public UnaryCallable + listModelEvaluationsCallable() { + throw new UnsupportedOperationException("Not implemented: listModelEvaluationsCallable()"); + } + + @Override + public abstract void close(); +} 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 new file mode 100644 index 000000000..0da53b485 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java @@ -0,0 +1,1032 @@ +/* + * 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.stub; + +import static com.google.cloud.automl.v1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +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.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.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.ExportDataRequest; +import com.google.cloud.automl.v1.GetDatasetRequest; +import com.google.cloud.automl.v1.GetModelEvaluationRequest; +import com.google.cloud.automl.v1.GetModelRequest; +import com.google.cloud.automl.v1.ImportDataRequest; +import com.google.cloud.automl.v1.ListDatasetsRequest; +import com.google.cloud.automl.v1.ListDatasetsResponse; +import com.google.cloud.automl.v1.ListModelEvaluationsRequest; +import com.google.cloud.automl.v1.ListModelEvaluationsResponse; +import com.google.cloud.automl.v1.ListModelsRequest; +import com.google.cloud.automl.v1.ListModelsResponse; +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.UpdateDatasetRequest; +import com.google.cloud.automl.v1.UpdateModelRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AutoMlStub}. + * + *

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

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

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

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

+ * 
+ * AutoMlStubSettings.Builder autoMlSettingsBuilder =
+ *     AutoMlStubSettings.newBuilder();
+ * autoMlSettingsBuilder.createDatasetSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AutoMlStubSettings autoMlSettings = autoMlSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AutoMlStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createDatasetSettings; + private final UnaryCallSettings updateDatasetSettings; + private final UnaryCallSettings getDatasetSettings; + private final PagedCallSettings< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings; + private final UnaryCallSettings deleteDatasetSettings; + private final OperationCallSettings + deleteDatasetOperationSettings; + private final UnaryCallSettings importDataSettings; + private final OperationCallSettings + importDataOperationSettings; + private final UnaryCallSettings exportDataSettings; + private final OperationCallSettings + exportDataOperationSettings; + private final UnaryCallSettings createModelSettings; + private final OperationCallSettings + createModelOperationSettings; + private final UnaryCallSettings getModelSettings; + private final UnaryCallSettings updateModelSettings; + private final PagedCallSettings + listModelsSettings; + private final UnaryCallSettings deleteModelSettings; + private final OperationCallSettings + deleteModelOperationSettings; + private final UnaryCallSettings + getModelEvaluationSettings; + private final PagedCallSettings< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings; + + /** Returns the object with the settings used for calls to createDataset. */ + public UnaryCallSettings createDatasetSettings() { + return createDatasetSettings; + } + + /** Returns the object with the settings used for calls to updateDataset. */ + public UnaryCallSettings updateDatasetSettings() { + return updateDatasetSettings; + } + + /** Returns the object with the settings used for calls to getDataset. */ + public UnaryCallSettings getDatasetSettings() { + return getDatasetSettings; + } + + /** Returns the object with the settings used for calls to listDatasets. */ + public PagedCallSettings + listDatasetsSettings() { + return listDatasetsSettings; + } + + /** Returns the object with the settings used for calls to deleteDataset. */ + public UnaryCallSettings deleteDatasetSettings() { + return deleteDatasetSettings; + } + + /** Returns the object with the settings used for calls to deleteDataset. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteDatasetOperationSettings() { + return deleteDatasetOperationSettings; + } + + /** Returns the object with the settings used for calls to importData. */ + public UnaryCallSettings importDataSettings() { + return importDataSettings; + } + + /** Returns the object with the settings used for calls to importData. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + importDataOperationSettings() { + return importDataOperationSettings; + } + + /** Returns the object with the settings used for calls to exportData. */ + public UnaryCallSettings exportDataSettings() { + return exportDataSettings; + } + + /** Returns the object with the settings used for calls to exportData. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + exportDataOperationSettings() { + return exportDataOperationSettings; + } + + /** Returns the object with the settings used for calls to createModel. */ + public UnaryCallSettings createModelSettings() { + return createModelSettings; + } + + /** Returns the object with the settings used for calls to createModel. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createModelOperationSettings() { + return createModelOperationSettings; + } + + /** Returns the object with the settings used for calls to getModel. */ + public UnaryCallSettings getModelSettings() { + return getModelSettings; + } + + /** Returns the object with the settings used for calls to updateModel. */ + public UnaryCallSettings updateModelSettings() { + return updateModelSettings; + } + + /** Returns the object with the settings used for calls to listModels. */ + public PagedCallSettings + listModelsSettings() { + return listModelsSettings; + } + + /** Returns the object with the settings used for calls to deleteModel. */ + public UnaryCallSettings deleteModelSettings() { + return deleteModelSettings; + } + + /** Returns the object with the settings used for calls to deleteModel. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteModelOperationSettings() { + return deleteModelOperationSettings; + } + + /** Returns the object with the settings used for calls to getModelEvaluation. */ + public UnaryCallSettings + getModelEvaluationSettings() { + return getModelEvaluationSettings; + } + + /** Returns the object with the settings used for calls to listModelEvaluations. */ + public PagedCallSettings< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings() { + return listModelEvaluationsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AutoMlStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAutoMlStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "automl.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(AutoMlStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AutoMlStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createDatasetSettings = settingsBuilder.createDatasetSettings().build(); + updateDatasetSettings = settingsBuilder.updateDatasetSettings().build(); + getDatasetSettings = settingsBuilder.getDatasetSettings().build(); + listDatasetsSettings = settingsBuilder.listDatasetsSettings().build(); + deleteDatasetSettings = settingsBuilder.deleteDatasetSettings().build(); + deleteDatasetOperationSettings = settingsBuilder.deleteDatasetOperationSettings().build(); + importDataSettings = settingsBuilder.importDataSettings().build(); + importDataOperationSettings = settingsBuilder.importDataOperationSettings().build(); + exportDataSettings = settingsBuilder.exportDataSettings().build(); + exportDataOperationSettings = settingsBuilder.exportDataOperationSettings().build(); + createModelSettings = settingsBuilder.createModelSettings().build(); + createModelOperationSettings = settingsBuilder.createModelOperationSettings().build(); + getModelSettings = settingsBuilder.getModelSettings().build(); + updateModelSettings = settingsBuilder.updateModelSettings().build(); + listModelsSettings = settingsBuilder.listModelsSettings().build(); + deleteModelSettings = settingsBuilder.deleteModelSettings().build(); + deleteModelOperationSettings = settingsBuilder.deleteModelOperationSettings().build(); + getModelEvaluationSettings = settingsBuilder.getModelEvaluationSettings().build(); + listModelEvaluationsSettings = settingsBuilder.listModelEvaluationsSettings().build(); + } + + private static final PagedListDescriptor + LIST_DATASETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDatasetsRequest injectToken(ListDatasetsRequest payload, String token) { + return ListDatasetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDatasetsRequest injectPageSize(ListDatasetsRequest payload, int pageSize) { + return ListDatasetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDatasetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDatasetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDatasetsResponse payload) { + return payload.getDatasetsList() != null + ? payload.getDatasetsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + LIST_MODELS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListModelsRequest injectToken(ListModelsRequest payload, String token) { + return ListModelsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListModelsRequest injectPageSize(ListModelsRequest payload, int pageSize) { + return ListModelsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListModelsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListModelsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListModelsResponse payload) { + return payload.getModelList() != null + ? payload.getModelList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> + LIST_MODEL_EVALUATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListModelEvaluationsRequest injectToken( + ListModelEvaluationsRequest payload, String token) { + return ListModelEvaluationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListModelEvaluationsRequest injectPageSize( + ListModelEvaluationsRequest payload, int pageSize) { + return ListModelEvaluationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListModelEvaluationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListModelEvaluationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListModelEvaluationsResponse payload) { + return payload.getModelEvaluationList() != null + ? payload.getModelEvaluationList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + LIST_DATASETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDatasetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DATASETS_PAGE_STR_DESC, request, context); + return ListDatasetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListModelsRequest, ListModelsResponse, ListModelsPagedResponse> + LIST_MODELS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListModelsRequest, ListModelsResponse, ListModelsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListModelsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_MODELS_PAGE_STR_DESC, request, context); + return ListModelsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + LIST_MODEL_EVALUATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListModelEvaluationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> + pageContext = + PageContext.create( + callable, LIST_MODEL_EVALUATIONS_PAGE_STR_DESC, request, context); + return ListModelEvaluationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for AutoMlStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder createDatasetSettings; + private final UnaryCallSettings.Builder updateDatasetSettings; + private final UnaryCallSettings.Builder getDatasetSettings; + private final PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings; + private final UnaryCallSettings.Builder deleteDatasetSettings; + private final OperationCallSettings.Builder + deleteDatasetOperationSettings; + private final UnaryCallSettings.Builder importDataSettings; + private final OperationCallSettings.Builder + importDataOperationSettings; + private final UnaryCallSettings.Builder exportDataSettings; + private final OperationCallSettings.Builder + exportDataOperationSettings; + private final UnaryCallSettings.Builder createModelSettings; + private final OperationCallSettings.Builder + createModelOperationSettings; + private final UnaryCallSettings.Builder getModelSettings; + private final UnaryCallSettings.Builder updateModelSettings; + private final PagedCallSettings.Builder< + ListModelsRequest, ListModelsResponse, ListModelsPagedResponse> + listModelsSettings; + private final UnaryCallSettings.Builder deleteModelSettings; + private final OperationCallSettings.Builder + deleteModelOperationSettings; + private final UnaryCallSettings.Builder + getModelEvaluationSettings; + private final PagedCallSettings.Builder< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createDatasetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateDatasetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getDatasetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listDatasetsSettings = PagedCallSettings.newBuilder(LIST_DATASETS_PAGE_STR_FACT); + + deleteDatasetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteDatasetOperationSettings = OperationCallSettings.newBuilder(); + + importDataSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + importDataOperationSettings = OperationCallSettings.newBuilder(); + + exportDataSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + exportDataOperationSettings = OperationCallSettings.newBuilder(); + + createModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createModelOperationSettings = OperationCallSettings.newBuilder(); + + getModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listModelsSettings = PagedCallSettings.newBuilder(LIST_MODELS_PAGE_STR_FACT); + + deleteModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteModelOperationSettings = OperationCallSettings.newBuilder(); + + getModelEvaluationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listModelEvaluationsSettings = + PagedCallSettings.newBuilder(LIST_MODEL_EVALUATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDatasetSettings, + updateDatasetSettings, + getDatasetSettings, + listDatasetsSettings, + deleteDatasetSettings, + importDataSettings, + exportDataSettings, + createModelSettings, + getModelSettings, + updateModelSettings, + listModelsSettings, + deleteModelSettings, + getModelEvaluationSettings, + listModelEvaluationsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listDatasetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .importDataSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .exportDataSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listModelsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getModelEvaluationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listModelEvaluationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .deleteDatasetOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("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())); + builder + .importDataOperationSettings() + .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 + .exportDataOperationSettings() + .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())); + builder + .createModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Model.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())); + builder + .deleteModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("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; + } + + protected Builder(AutoMlStubSettings settings) { + super(settings); + + createDatasetSettings = settings.createDatasetSettings.toBuilder(); + updateDatasetSettings = settings.updateDatasetSettings.toBuilder(); + getDatasetSettings = settings.getDatasetSettings.toBuilder(); + listDatasetsSettings = settings.listDatasetsSettings.toBuilder(); + deleteDatasetSettings = settings.deleteDatasetSettings.toBuilder(); + deleteDatasetOperationSettings = settings.deleteDatasetOperationSettings.toBuilder(); + importDataSettings = settings.importDataSettings.toBuilder(); + importDataOperationSettings = settings.importDataOperationSettings.toBuilder(); + exportDataSettings = settings.exportDataSettings.toBuilder(); + exportDataOperationSettings = settings.exportDataOperationSettings.toBuilder(); + createModelSettings = settings.createModelSettings.toBuilder(); + createModelOperationSettings = settings.createModelOperationSettings.toBuilder(); + getModelSettings = settings.getModelSettings.toBuilder(); + updateModelSettings = settings.updateModelSettings.toBuilder(); + listModelsSettings = settings.listModelsSettings.toBuilder(); + deleteModelSettings = settings.deleteModelSettings.toBuilder(); + deleteModelOperationSettings = settings.deleteModelOperationSettings.toBuilder(); + getModelEvaluationSettings = settings.getModelEvaluationSettings.toBuilder(); + listModelEvaluationsSettings = settings.listModelEvaluationsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDatasetSettings, + updateDatasetSettings, + getDatasetSettings, + listDatasetsSettings, + deleteDatasetSettings, + importDataSettings, + exportDataSettings, + createModelSettings, + getModelSettings, + updateModelSettings, + listModelsSettings, + deleteModelSettings, + getModelEvaluationSettings, + listModelEvaluationsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createDataset. */ + public UnaryCallSettings.Builder createDatasetSettings() { + return createDatasetSettings; + } + + /** Returns the builder for the settings used for calls to updateDataset. */ + public UnaryCallSettings.Builder updateDatasetSettings() { + return updateDatasetSettings; + } + + /** Returns the builder for the settings used for calls to getDataset. */ + public UnaryCallSettings.Builder getDatasetSettings() { + return getDatasetSettings; + } + + /** Returns the builder for the settings used for calls to listDatasets. */ + public PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings() { + return listDatasetsSettings; + } + + /** Returns the builder for the settings used for calls to deleteDataset. */ + public UnaryCallSettings.Builder deleteDatasetSettings() { + return deleteDatasetSettings; + } + + /** Returns the builder for the settings used for calls to deleteDataset. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteDatasetOperationSettings() { + return deleteDatasetOperationSettings; + } + + /** Returns the builder for the settings used for calls to importData. */ + public UnaryCallSettings.Builder importDataSettings() { + return importDataSettings; + } + + /** Returns the builder for the settings used for calls to importData. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + importDataOperationSettings() { + return importDataOperationSettings; + } + + /** Returns the builder for the settings used for calls to exportData. */ + public UnaryCallSettings.Builder exportDataSettings() { + return exportDataSettings; + } + + /** Returns the builder for the settings used for calls to exportData. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportDataOperationSettings() { + return exportDataOperationSettings; + } + + /** Returns the builder for the settings used for calls to createModel. */ + public UnaryCallSettings.Builder createModelSettings() { + return createModelSettings; + } + + /** Returns the builder for the settings used for calls to createModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createModelOperationSettings() { + return createModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to getModel. */ + public UnaryCallSettings.Builder getModelSettings() { + return getModelSettings; + } + + /** Returns the builder for the settings used for calls to updateModel. */ + public UnaryCallSettings.Builder updateModelSettings() { + return updateModelSettings; + } + + /** Returns the builder for the settings used for calls to listModels. */ + public PagedCallSettings.Builder + listModelsSettings() { + return listModelsSettings; + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + public UnaryCallSettings.Builder deleteModelSettings() { + return deleteModelSettings; + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteModelOperationSettings() { + return deleteModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to getModelEvaluation. */ + public UnaryCallSettings.Builder + getModelEvaluationSettings() { + return getModelEvaluationSettings; + } + + /** Returns the builder for the settings used for calls to listModelEvaluations. */ + public PagedCallSettings.Builder< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings() { + return listModelEvaluationsSettings; + } + + @Override + public AutoMlStubSettings build() throws IOException { + return new AutoMlStubSettings(this); + } + } +} diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlCallableFactory.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlCallableFactory.java new file mode 100644 index 000000000..bdd2f7167 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud AutoML API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcAutoMlCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} 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 new file mode 100644 index 000000000..1065fdeec --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java @@ -0,0 +1,668 @@ +/* + * 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.stub; + +import static com.google.cloud.automl.v1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +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.ExportDataRequest; +import com.google.cloud.automl.v1.GetDatasetRequest; +import com.google.cloud.automl.v1.GetModelEvaluationRequest; +import com.google.cloud.automl.v1.GetModelRequest; +import com.google.cloud.automl.v1.ImportDataRequest; +import com.google.cloud.automl.v1.ListDatasetsRequest; +import com.google.cloud.automl.v1.ListDatasetsResponse; +import com.google.cloud.automl.v1.ListModelEvaluationsRequest; +import com.google.cloud.automl.v1.ListModelEvaluationsResponse; +import com.google.cloud.automl.v1.ListModelsRequest; +import com.google.cloud.automl.v1.ListModelsResponse; +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.UpdateDatasetRequest; +import com.google.cloud.automl.v1.UpdateModelRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud AutoML API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcAutoMlStub extends AutoMlStub { + + private static final MethodDescriptor + createDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/CreateDataset") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/UpdateDataset") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) + .build(); + private static final MethodDescriptor getDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/GetDataset") + .setRequestMarshaller(ProtoUtils.marshaller(GetDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listDatasetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/ListDatasets") + .setRequestMarshaller(ProtoUtils.marshaller(ListDatasetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDatasetsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/DeleteDataset") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor importDataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/ImportData") + .setRequestMarshaller(ProtoUtils.marshaller(ImportDataRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor exportDataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/ExportData") + .setRequestMarshaller(ProtoUtils.marshaller(ExportDataRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor createModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/CreateModel") + .setRequestMarshaller(ProtoUtils.marshaller(CreateModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor getModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/GetModel") + .setRequestMarshaller(ProtoUtils.marshaller(GetModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/UpdateModel") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listModelsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/ListModels") + .setRequestMarshaller(ProtoUtils.marshaller(ListModelsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListModelsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/DeleteModel") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getModelEvaluationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/GetModelEvaluation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetModelEvaluationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ModelEvaluation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listModelEvaluationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/ListModelEvaluations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListModelEvaluationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListModelEvaluationsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable createDatasetCallable; + private final UnaryCallable updateDatasetCallable; + private final UnaryCallable getDatasetCallable; + private final UnaryCallable listDatasetsCallable; + private final UnaryCallable + listDatasetsPagedCallable; + private final UnaryCallable deleteDatasetCallable; + private final OperationCallable + deleteDatasetOperationCallable; + private final UnaryCallable importDataCallable; + private final OperationCallable + importDataOperationCallable; + private final UnaryCallable exportDataCallable; + private final OperationCallable + exportDataOperationCallable; + private final UnaryCallable createModelCallable; + private final OperationCallable + createModelOperationCallable; + private final UnaryCallable getModelCallable; + private final UnaryCallable updateModelCallable; + private final UnaryCallable listModelsCallable; + private final UnaryCallable listModelsPagedCallable; + private final UnaryCallable deleteModelCallable; + private final OperationCallable + deleteModelOperationCallable; + private final UnaryCallable + getModelEvaluationCallable; + private final UnaryCallable + listModelEvaluationsCallable; + private final UnaryCallable + listModelEvaluationsPagedCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAutoMlStub create(AutoMlStubSettings settings) throws IOException { + return new GrpcAutoMlStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAutoMlStub create(ClientContext clientContext) throws IOException { + return new GrpcAutoMlStub(AutoMlStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAutoMlStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAutoMlStub( + AutoMlStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAutoMlStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcAutoMlStub(AutoMlStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAutoMlCallableFactory()); + } + + /** + * Constructs an instance of GrpcAutoMlStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcAutoMlStub( + AutoMlStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDatasetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateDatasetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDatasetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateDatasetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("dataset.name", String.valueOf(request.getDataset().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDatasetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDatasetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listDatasetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDatasetsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListDatasetsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDatasetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteDatasetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings importDataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importDataMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ImportDataRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings exportDataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportDataMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExportDataRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("model.name", String.valueOf(request.getModel().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listModelsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listModelsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListModelsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getModelEvaluationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getModelEvaluationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetModelEvaluationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listModelEvaluationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listModelEvaluationsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListModelEvaluationsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.createDatasetCallable = + callableFactory.createUnaryCallable( + createDatasetTransportSettings, settings.createDatasetSettings(), clientContext); + this.updateDatasetCallable = + callableFactory.createUnaryCallable( + updateDatasetTransportSettings, settings.updateDatasetSettings(), clientContext); + this.getDatasetCallable = + callableFactory.createUnaryCallable( + getDatasetTransportSettings, settings.getDatasetSettings(), clientContext); + this.listDatasetsCallable = + callableFactory.createUnaryCallable( + listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); + this.listDatasetsPagedCallable = + callableFactory.createPagedCallable( + listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); + this.deleteDatasetCallable = + callableFactory.createUnaryCallable( + deleteDatasetTransportSettings, settings.deleteDatasetSettings(), clientContext); + this.deleteDatasetOperationCallable = + callableFactory.createOperationCallable( + deleteDatasetTransportSettings, + settings.deleteDatasetOperationSettings(), + clientContext, + this.operationsStub); + this.importDataCallable = + callableFactory.createUnaryCallable( + importDataTransportSettings, settings.importDataSettings(), clientContext); + this.importDataOperationCallable = + callableFactory.createOperationCallable( + importDataTransportSettings, + settings.importDataOperationSettings(), + clientContext, + this.operationsStub); + this.exportDataCallable = + callableFactory.createUnaryCallable( + exportDataTransportSettings, settings.exportDataSettings(), clientContext); + this.exportDataOperationCallable = + callableFactory.createOperationCallable( + exportDataTransportSettings, + settings.exportDataOperationSettings(), + clientContext, + this.operationsStub); + this.createModelCallable = + callableFactory.createUnaryCallable( + createModelTransportSettings, settings.createModelSettings(), clientContext); + this.createModelOperationCallable = + callableFactory.createOperationCallable( + createModelTransportSettings, + settings.createModelOperationSettings(), + clientContext, + this.operationsStub); + this.getModelCallable = + callableFactory.createUnaryCallable( + getModelTransportSettings, settings.getModelSettings(), clientContext); + this.updateModelCallable = + callableFactory.createUnaryCallable( + updateModelTransportSettings, settings.updateModelSettings(), clientContext); + this.listModelsCallable = + callableFactory.createUnaryCallable( + listModelsTransportSettings, settings.listModelsSettings(), clientContext); + this.listModelsPagedCallable = + callableFactory.createPagedCallable( + listModelsTransportSettings, settings.listModelsSettings(), clientContext); + this.deleteModelCallable = + callableFactory.createUnaryCallable( + deleteModelTransportSettings, settings.deleteModelSettings(), clientContext); + this.deleteModelOperationCallable = + callableFactory.createOperationCallable( + deleteModelTransportSettings, + settings.deleteModelOperationSettings(), + clientContext, + this.operationsStub); + this.getModelEvaluationCallable = + callableFactory.createUnaryCallable( + getModelEvaluationTransportSettings, + settings.getModelEvaluationSettings(), + clientContext); + this.listModelEvaluationsCallable = + callableFactory.createUnaryCallable( + listModelEvaluationsTransportSettings, + settings.listModelEvaluationsSettings(), + clientContext); + this.listModelEvaluationsPagedCallable = + callableFactory.createPagedCallable( + listModelEvaluationsTransportSettings, + settings.listModelEvaluationsSettings(), + clientContext); + + 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 createDatasetCallable() { + return createDatasetCallable; + } + + public UnaryCallable updateDatasetCallable() { + return updateDatasetCallable; + } + + public UnaryCallable getDatasetCallable() { + return getDatasetCallable; + } + + public UnaryCallable listDatasetsPagedCallable() { + return listDatasetsPagedCallable; + } + + public UnaryCallable listDatasetsCallable() { + return listDatasetsCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteDatasetOperationCallable() { + return deleteDatasetOperationCallable; + } + + public UnaryCallable deleteDatasetCallable() { + return deleteDatasetCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + importDataOperationCallable() { + return importDataOperationCallable; + } + + public UnaryCallable importDataCallable() { + return importDataCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportDataOperationCallable() { + return exportDataOperationCallable; + } + + public UnaryCallable exportDataCallable() { + return exportDataCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createModelOperationCallable() { + return createModelOperationCallable; + } + + public UnaryCallable createModelCallable() { + return createModelCallable; + } + + public UnaryCallable getModelCallable() { + return getModelCallable; + } + + public UnaryCallable updateModelCallable() { + return updateModelCallable; + } + + public UnaryCallable listModelsPagedCallable() { + return listModelsPagedCallable; + } + + public UnaryCallable listModelsCallable() { + return listModelsCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteModelOperationCallable() { + return deleteModelOperationCallable; + } + + public UnaryCallable deleteModelCallable() { + return deleteModelCallable; + } + + public UnaryCallable getModelEvaluationCallable() { + return getModelEvaluationCallable; + } + + public UnaryCallable + listModelEvaluationsPagedCallable() { + return listModelEvaluationsPagedCallable; + } + + public UnaryCallable + listModelEvaluationsCallable() { + return listModelEvaluationsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceCallableFactory.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceCallableFactory.java new file mode 100644 index 000000000..0e97c1dc8 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud AutoML API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcPredictionServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} 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 new file mode 100644 index 000000000..8f09ac611 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceStub.java @@ -0,0 +1,153 @@ +/* + * 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.PredictRequest; +import com.google.cloud.automl.v1.PredictResponse; +import com.google.common.collect.ImmutableMap; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud AutoML API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcPredictionServiceStub extends PredictionServiceStub { + + private static final MethodDescriptor predictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.PredictionService/Predict") + .setRequestMarshaller(ProtoUtils.marshaller(PredictRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PredictResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable predictCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPredictionServiceStub create(PredictionServiceStubSettings settings) + throws IOException { + return new GrpcPredictionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPredictionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPredictionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcPredictionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings predictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(predictMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PredictRequest 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); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable predictCallable() { + return predictCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/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 new file mode 100644 index 000000000..ffc7897f1 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStub.java @@ -0,0 +1,41 @@ +/* + * 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.PredictRequest; +import com.google.cloud.automl.v1.PredictResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud AutoML API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class PredictionServiceStub implements BackgroundResource { + + public UnaryCallable predictCallable() { + throw new UnsupportedOperationException("Not implemented: predictCallable()"); + } + + @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 new file mode 100644 index 000000000..b9e30d001 --- /dev/null +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java @@ -0,0 +1,266 @@ +/* + * 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.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +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.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +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.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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link PredictionServiceStub}. + * + *

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

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

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

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

+ * 
+ * PredictionServiceStubSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceStubSettings.newBuilder();
+ * predictionServiceSettingsBuilder.predictSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * PredictionServiceStubSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings predictSettings; + + /** Returns the object with the settings used for calls to predict. */ + public UnaryCallSettings predictSettings() { + return predictSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PredictionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPredictionServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "automl.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(PredictionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected PredictionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + predictSettings = settingsBuilder.predictSettings().build(); + } + + /** Builder for PredictionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder predictSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + predictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(predictSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .predictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(PredictionServiceStubSettings settings) { + super(settings); + + predictSettings = settings.predictSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(predictSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to predict. */ + public UnaryCallSettings.Builder predictSettings() { + return predictSettings; + } + + @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 new file mode 100644 index 000000000..0a097bf5e --- /dev/null +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java @@ -0,0 +1,769 @@ +/* + * 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 static com.google.cloud.automl.v1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1.AutoMlClient.ListModelsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +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.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class AutoMlClientTest { + private static MockAutoMl mockAutoMl; + private static MockPredictionService mockPredictionService; + private static MockServiceHelper serviceHelper; + private AutoMlClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAutoMl = new MockAutoMl(); + mockPredictionService = new MockPredictionService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockAutoMl, mockPredictionService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + AutoMlSettings settings = + AutoMlSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AutoMlClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createDatasetTest() { + String name = "name3373707"; + boolean done = true; + Operation expectedResponse = Operation.newBuilder().setName(name).setDone(done).build(); + mockAutoMl.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dataset dataset = Dataset.newBuilder().build(); + + Operation actualResponse = client.createDataset(parent, dataset); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDatasetRequest actualRequest = (CreateDatasetRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(dataset, actualRequest.getDataset()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createDatasetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dataset dataset = Dataset.newBuilder().build(); + + client.createDataset(parent, dataset); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateDatasetTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + int exampleCount = 1517063674; + String etag = "etag3123477"; + Dataset expectedResponse = + Dataset.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setDescription(description) + .setExampleCount(exampleCount) + .setEtag(etag) + .build(); + mockAutoMl.addResponse(expectedResponse); + + Dataset dataset = Dataset.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Dataset actualResponse = client.updateDataset(dataset, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDatasetRequest actualRequest = (UpdateDatasetRequest) actualRequests.get(0); + + Assert.assertEquals(dataset, actualRequest.getDataset()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateDatasetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + Dataset dataset = Dataset.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateDataset(dataset, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getDatasetTest() { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + int exampleCount = 1517063674; + String etag = "etag3123477"; + Dataset expectedResponse = + Dataset.newBuilder() + .setName(name2) + .setDisplayName(displayName) + .setDescription(description) + .setExampleCount(exampleCount) + .setEtag(etag) + .build(); + mockAutoMl.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + + Dataset actualResponse = client.getDataset(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDatasetRequest actualRequest = (GetDatasetRequest) actualRequests.get(0); + + Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getDatasetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + + client.getDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listDatasetsTest() { + String nextPageToken = ""; + Dataset datasetsElement = Dataset.newBuilder().build(); + List datasets = Arrays.asList(datasetsElement); + ListDatasetsResponse expectedResponse = + ListDatasetsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllDatasets(datasets) + .build(); + mockAutoMl.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDatasetsPagedResponse pagedListResponse = client.listDatasets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().get(0), resources.get(0)); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDatasetsRequest actualRequest = (ListDatasetsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listDatasetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listDatasets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteDatasetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteDatasetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + + Empty actualResponse = client.deleteDatasetAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDatasetRequest actualRequest = (DeleteDatasetRequest) actualRequests.get(0); + + Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteDatasetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + + client.deleteDatasetAsync(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 importDataTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importDataTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + InputConfig inputConfig = InputConfig.newBuilder().build(); + + Empty actualResponse = client.importDataAsync(name, inputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportDataRequest actualRequest = (ImportDataRequest) actualRequests.get(0); + + Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); + Assert.assertEquals(inputConfig, actualRequest.getInputConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void importDataExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + InputConfig inputConfig = InputConfig.newBuilder().build(); + + client.importDataAsync(name, inputConfig).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 exportDataTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportDataTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + OutputConfig outputConfig = OutputConfig.newBuilder().build(); + + Empty actualResponse = client.exportDataAsync(name, outputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportDataRequest actualRequest = (ExportDataRequest) actualRequests.get(0); + + Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); + Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void exportDataExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + OutputConfig outputConfig = OutputConfig.newBuilder().build(); + + client.exportDataAsync(name, outputConfig).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 createModelTest() throws Exception { + String name = "name3373707"; + String displayName = "displayName1615086568"; + String datasetId = "datasetId-2115646910"; + Model expectedResponse = + Model.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setDatasetId(datasetId) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Model model = Model.newBuilder().build(); + + Model actualResponse = client.createModelAsync(parent, model).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateModelRequest actualRequest = (CreateModelRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(model, actualRequest.getModel()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Model model = Model.newBuilder().build(); + + client.createModelAsync(parent, model).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 getModelTest() { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + String datasetId = "datasetId-2115646910"; + Model expectedResponse = + Model.newBuilder() + .setName(name2) + .setDisplayName(displayName) + .setDatasetId(datasetId) + .build(); + mockAutoMl.addResponse(expectedResponse); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + Model actualResponse = client.getModel(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetModelRequest actualRequest = (GetModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.getModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateModelTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + String datasetId = "datasetId-2115646910"; + Model expectedResponse = + Model.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setDatasetId(datasetId) + .build(); + mockAutoMl.addResponse(expectedResponse); + + Model model = Model.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Model actualResponse = client.updateModel(model, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateModelRequest actualRequest = (UpdateModelRequest) actualRequests.get(0); + + Assert.assertEquals(model, actualRequest.getModel()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + Model model = Model.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateModel(model, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listModelsTest() { + String nextPageToken = ""; + Model modelElement = Model.newBuilder().build(); + List model = Arrays.asList(modelElement); + ListModelsResponse expectedResponse = + ListModelsResponse.newBuilder().setNextPageToken(nextPageToken).addAllModel(model).build(); + mockAutoMl.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListModelsPagedResponse pagedListResponse = client.listModels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getModelList().get(0), resources.get(0)); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListModelsRequest actualRequest = (ListModelsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listModelsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listModels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteModelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + Empty actualResponse = client.deleteModelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteModelRequest actualRequest = (DeleteModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.deleteModelAsync(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"; + int evaluatedExampleCount = 277565350; + ModelEvaluation expectedResponse = + ModelEvaluation.newBuilder() + .setName(name2) + .setAnnotationSpecId(annotationSpecId) + .setEvaluatedExampleCount(evaluatedExampleCount) + .build(); + mockAutoMl.addResponse(expectedResponse); + + ModelEvaluationName name = + ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]"); + + ModelEvaluation actualResponse = client.getModelEvaluation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetModelEvaluationRequest actualRequest = (GetModelEvaluationRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelEvaluationName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getModelEvaluationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelEvaluationName name = + ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]"); + + client.getModelEvaluation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listModelEvaluationsTest() { + String nextPageToken = ""; + ModelEvaluation modelEvaluationElement = ModelEvaluation.newBuilder().build(); + List modelEvaluation = Arrays.asList(modelEvaluationElement); + ListModelEvaluationsResponse expectedResponse = + ListModelEvaluationsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllModelEvaluation(modelEvaluation) + .build(); + mockAutoMl.addResponse(expectedResponse); + + ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + String filter = "filter-1274492040"; + + ListModelEvaluationsPagedResponse pagedListResponse = + client.listModelEvaluations(parent, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getModelEvaluationList().get(0), resources.get(0)); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListModelEvaluationsRequest actualRequest = (ListModelEvaluationsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ModelName.parse(actualRequest.getParent())); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listModelEvaluationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + String filter = "filter-1274492040"; + + client.listModelEvaluations(parent, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMl.java b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMl.java new file mode 100644 index 000000000..327f14f98 --- /dev/null +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMl.java @@ -0,0 +1,57 @@ +/* + * 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.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockAutoMl implements MockGrpcService { + private final MockAutoMlImpl serviceImpl; + + public MockAutoMl() { + serviceImpl = new MockAutoMlImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/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 new file mode 100644 index 000000000..7f1fa627b --- /dev/null +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMlImpl.java @@ -0,0 +1,263 @@ +/* + * 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.core.BetaApi; +import com.google.cloud.automl.v1.AutoMlGrpc.AutoMlImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockAutoMlImpl extends AutoMlImplBase { + private List requests; + private Queue responses; + + public MockAutoMlImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createDataset( + CreateDatasetRequest 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 getDataset(GetDatasetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Dataset) { + requests.add(request); + responseObserver.onNext((Dataset) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listDatasets( + ListDatasetsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListDatasetsResponse) { + requests.add(request); + responseObserver.onNext((ListDatasetsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateDataset( + UpdateDatasetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Dataset) { + requests.add(request); + responseObserver.onNext((Dataset) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteDataset( + DeleteDatasetRequest 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 importData(ImportDataRequest 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 exportData(ExportDataRequest 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 createModel(CreateModelRequest 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 getModel(GetModelRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Model) { + requests.add(request); + responseObserver.onNext((Model) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listModels( + ListModelsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListModelsResponse) { + requests.add(request); + responseObserver.onNext((ListModelsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteModel(DeleteModelRequest 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 updateModel(UpdateModelRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Model) { + requests.add(request); + responseObserver.onNext((Model) 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) { + Object response = responses.remove(); + if (response instanceof ModelEvaluation) { + requests.add(request); + responseObserver.onNext((ModelEvaluation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listModelEvaluations( + ListModelEvaluationsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListModelEvaluationsResponse) { + requests.add(request); + responseObserver.onNext((ListModelEvaluationsResponse) 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/MockPredictionService.java b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionService.java new file mode 100644 index 000000000..3c4f553fb --- /dev/null +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionService.java @@ -0,0 +1,57 @@ +/* + * 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.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockPredictionService implements MockGrpcService { + private final MockPredictionServiceImpl serviceImpl; + + public MockPredictionService() { + serviceImpl = new MockPredictionServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/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 new file mode 100644 index 000000000..04a5363e6 --- /dev/null +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionServiceImpl.java @@ -0,0 +1,72 @@ +/* + * 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.core.BetaApi; +import com.google.cloud.automl.v1.PredictionServiceGrpc.PredictionServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockPredictionServiceImpl extends PredictionServiceImplBase { + private List requests; + private Queue responses; + + public MockPredictionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void predict(PredictRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof PredictResponse) { + requests.add(request); + responseObserver.onNext((PredictResponse) 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 new file mode 100644 index 000000000..dbeb7b8fe --- /dev/null +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/PredictionServiceClientTest.java @@ -0,0 +1,123 @@ +/* + * 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.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +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.protobuf.AbstractMessage; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class PredictionServiceClientTest { + private static MockAutoMl mockAutoMl; + private static MockPredictionService mockPredictionService; + private static MockServiceHelper serviceHelper; + private PredictionServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAutoMl = new MockAutoMl(); + mockPredictionService = new MockPredictionService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockAutoMl, mockPredictionService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + PredictionServiceSettings settings = + PredictionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PredictionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void predictTest() { + PredictResponse expectedResponse = PredictResponse.newBuilder().build(); + mockPredictionService.addResponse(expectedResponse); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + ExamplePayload payload = ExamplePayload.newBuilder().build(); + Map params = new HashMap<>(); + + PredictResponse actualResponse = client.predict(name, payload, params); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PredictRequest actualRequest = (PredictRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertEquals(payload, actualRequest.getPayload()); + Assert.assertEquals(params, actualRequest.getParamsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void predictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + ExamplePayload payload = ExamplePayload.newBuilder().build(); + Map params = new HashMap<>(); + + client.predict(name, payload, params); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/grpc-google-cloud-automl-v1/pom.xml b/grpc-google-cloud-automl-v1/pom.xml new file mode 100644 index 000000000..2d993f8e8 --- /dev/null +++ b/grpc-google-cloud-automl-v1/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-automl-v1 + 0.76.1-SNAPSHOT + grpc-google-cloud-automl-v1 + GRPC library for grpc-google-cloud-automl-v1 + + com.google.cloud + google-cloud-automl-parent + 0.111.1-beta-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-automl-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file 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 new file mode 100644 index 000000000..d3882bc2c --- /dev/null +++ b/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AutoMlGrpc.java @@ -0,0 +1,2023 @@ +/* + * 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 static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * AutoML Server API.
+ * The resource names are assigned by the server.
+ * The server never reuses names that it has created after the resources with
+ * those names are deleted.
+ * An ID of a resource is the last element of the item's resource name. For
+ * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
+ * the id for the item is `{dataset_id}`.
+ * Currently the only supported `location_id` is "us-central1".
+ * On any input that is documented to expect a string parameter in
+ * snake_case or kebab-case, either of those cases is accepted.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/automl/v1/service.proto") +public final class AutoMlGrpc { + + private AutoMlGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.automl.v1.AutoMl"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateDatasetMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateDatasetRequest, com.google.longrunning.Operation> + METHOD_CREATE_DATASET = getCreateDatasetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateDatasetRequest, com.google.longrunning.Operation> + getCreateDatasetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateDatasetRequest, com.google.longrunning.Operation> + getCreateDatasetMethod() { + return getCreateDatasetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateDatasetRequest, com.google.longrunning.Operation> + getCreateDatasetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateDatasetRequest, com.google.longrunning.Operation> + getCreateDatasetMethod; + if ((getCreateDatasetMethod = AutoMlGrpc.getCreateDatasetMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getCreateDatasetMethod = AutoMlGrpc.getCreateDatasetMethod) == null) { + AutoMlGrpc.getCreateDatasetMethod = + getCreateDatasetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "CreateDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.CreateDatasetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("CreateDataset")) + .build(); + } + } + } + return getCreateDatasetMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetDatasetMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetDatasetRequest, com.google.cloud.automl.v1.Dataset> + METHOD_GET_DATASET = getGetDatasetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetDatasetRequest, com.google.cloud.automl.v1.Dataset> + getGetDatasetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetDatasetRequest, com.google.cloud.automl.v1.Dataset> + getGetDatasetMethod() { + return getGetDatasetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetDatasetRequest, com.google.cloud.automl.v1.Dataset> + getGetDatasetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetDatasetRequest, com.google.cloud.automl.v1.Dataset> + getGetDatasetMethod; + if ((getGetDatasetMethod = AutoMlGrpc.getGetDatasetMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getGetDatasetMethod = AutoMlGrpc.getGetDatasetMethod) == null) { + AutoMlGrpc.getGetDatasetMethod = + getGetDatasetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "GetDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.GetDatasetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.Dataset.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("GetDataset")) + .build(); + } + } + } + return getGetDatasetMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListDatasetsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListDatasetsRequest, + com.google.cloud.automl.v1.ListDatasetsResponse> + METHOD_LIST_DATASETS = getListDatasetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListDatasetsRequest, + com.google.cloud.automl.v1.ListDatasetsResponse> + getListDatasetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListDatasetsRequest, + com.google.cloud.automl.v1.ListDatasetsResponse> + getListDatasetsMethod() { + return getListDatasetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListDatasetsRequest, + com.google.cloud.automl.v1.ListDatasetsResponse> + getListDatasetsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListDatasetsRequest, + com.google.cloud.automl.v1.ListDatasetsResponse> + getListDatasetsMethod; + if ((getListDatasetsMethod = AutoMlGrpc.getListDatasetsMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getListDatasetsMethod = AutoMlGrpc.getListDatasetsMethod) == null) { + AutoMlGrpc.getListDatasetsMethod = + getListDatasetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "ListDatasets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ListDatasetsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ListDatasetsResponse.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("ListDatasets")) + .build(); + } + } + } + return getListDatasetsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateDatasetMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateDatasetRequest, com.google.cloud.automl.v1.Dataset> + METHOD_UPDATE_DATASET = getUpdateDatasetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateDatasetRequest, com.google.cloud.automl.v1.Dataset> + getUpdateDatasetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateDatasetRequest, com.google.cloud.automl.v1.Dataset> + getUpdateDatasetMethod() { + return getUpdateDatasetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateDatasetRequest, com.google.cloud.automl.v1.Dataset> + getUpdateDatasetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateDatasetRequest, com.google.cloud.automl.v1.Dataset> + getUpdateDatasetMethod; + if ((getUpdateDatasetMethod = AutoMlGrpc.getUpdateDatasetMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getUpdateDatasetMethod = AutoMlGrpc.getUpdateDatasetMethod) == null) { + AutoMlGrpc.getUpdateDatasetMethod = + getUpdateDatasetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "UpdateDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.UpdateDatasetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.Dataset.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("UpdateDataset")) + .build(); + } + } + } + return getUpdateDatasetMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteDatasetMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteDatasetRequest, com.google.longrunning.Operation> + METHOD_DELETE_DATASET = getDeleteDatasetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteDatasetRequest, com.google.longrunning.Operation> + getDeleteDatasetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteDatasetRequest, com.google.longrunning.Operation> + getDeleteDatasetMethod() { + return getDeleteDatasetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteDatasetRequest, com.google.longrunning.Operation> + getDeleteDatasetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteDatasetRequest, com.google.longrunning.Operation> + getDeleteDatasetMethod; + if ((getDeleteDatasetMethod = AutoMlGrpc.getDeleteDatasetMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getDeleteDatasetMethod = AutoMlGrpc.getDeleteDatasetMethod) == null) { + AutoMlGrpc.getDeleteDatasetMethod = + getDeleteDatasetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "DeleteDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.DeleteDatasetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("DeleteDataset")) + .build(); + } + } + } + return getDeleteDatasetMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getImportDataMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ImportDataRequest, com.google.longrunning.Operation> + METHOD_IMPORT_DATA = getImportDataMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ImportDataRequest, com.google.longrunning.Operation> + getImportDataMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ImportDataRequest, com.google.longrunning.Operation> + getImportDataMethod() { + return getImportDataMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ImportDataRequest, com.google.longrunning.Operation> + getImportDataMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ImportDataRequest, com.google.longrunning.Operation> + getImportDataMethod; + if ((getImportDataMethod = AutoMlGrpc.getImportDataMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getImportDataMethod = AutoMlGrpc.getImportDataMethod) == null) { + AutoMlGrpc.getImportDataMethod = + getImportDataMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "ImportData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ImportDataRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("ImportData")) + .build(); + } + } + } + return getImportDataMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getExportDataMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportDataRequest, com.google.longrunning.Operation> + METHOD_EXPORT_DATA = getExportDataMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportDataRequest, com.google.longrunning.Operation> + getExportDataMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportDataRequest, com.google.longrunning.Operation> + getExportDataMethod() { + return getExportDataMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportDataRequest, com.google.longrunning.Operation> + getExportDataMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportDataRequest, com.google.longrunning.Operation> + getExportDataMethod; + if ((getExportDataMethod = AutoMlGrpc.getExportDataMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getExportDataMethod = AutoMlGrpc.getExportDataMethod) == null) { + AutoMlGrpc.getExportDataMethod = + getExportDataMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "ExportData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ExportDataRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("ExportData")) + .build(); + } + } + } + return getExportDataMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateModelMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateModelRequest, com.google.longrunning.Operation> + METHOD_CREATE_MODEL = getCreateModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateModelRequest, com.google.longrunning.Operation> + getCreateModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateModelRequest, com.google.longrunning.Operation> + getCreateModelMethod() { + return getCreateModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateModelRequest, com.google.longrunning.Operation> + getCreateModelMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.CreateModelRequest, com.google.longrunning.Operation> + getCreateModelMethod; + if ((getCreateModelMethod = AutoMlGrpc.getCreateModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getCreateModelMethod = AutoMlGrpc.getCreateModelMethod) == null) { + AutoMlGrpc.getCreateModelMethod = + getCreateModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "CreateModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.CreateModelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("CreateModel")) + .build(); + } + } + } + return getCreateModelMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetModelMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelRequest, com.google.cloud.automl.v1.Model> + METHOD_GET_MODEL = getGetModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelRequest, com.google.cloud.automl.v1.Model> + getGetModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelRequest, com.google.cloud.automl.v1.Model> + getGetModelMethod() { + return getGetModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelRequest, com.google.cloud.automl.v1.Model> + getGetModelMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelRequest, com.google.cloud.automl.v1.Model> + getGetModelMethod; + if ((getGetModelMethod = AutoMlGrpc.getGetModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getGetModelMethod = AutoMlGrpc.getGetModelMethod) == null) { + AutoMlGrpc.getGetModelMethod = + getGetModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "GetModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.GetModelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.Model.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("GetModel")) + .build(); + } + } + } + return getGetModelMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListModelsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelsRequest, + com.google.cloud.automl.v1.ListModelsResponse> + METHOD_LIST_MODELS = getListModelsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelsRequest, + com.google.cloud.automl.v1.ListModelsResponse> + getListModelsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelsRequest, + com.google.cloud.automl.v1.ListModelsResponse> + getListModelsMethod() { + return getListModelsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelsRequest, + com.google.cloud.automl.v1.ListModelsResponse> + getListModelsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelsRequest, + com.google.cloud.automl.v1.ListModelsResponse> + getListModelsMethod; + if ((getListModelsMethod = AutoMlGrpc.getListModelsMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getListModelsMethod = AutoMlGrpc.getListModelsMethod) == null) { + AutoMlGrpc.getListModelsMethod = + getListModelsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "ListModels")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ListModelsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ListModelsResponse.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("ListModels")) + .build(); + } + } + } + return getListModelsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteModelMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteModelRequest, com.google.longrunning.Operation> + METHOD_DELETE_MODEL = getDeleteModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteModelRequest, com.google.longrunning.Operation> + getDeleteModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteModelRequest, com.google.longrunning.Operation> + getDeleteModelMethod() { + return getDeleteModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteModelRequest, com.google.longrunning.Operation> + getDeleteModelMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeleteModelRequest, com.google.longrunning.Operation> + getDeleteModelMethod; + if ((getDeleteModelMethod = AutoMlGrpc.getDeleteModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getDeleteModelMethod = AutoMlGrpc.getDeleteModelMethod) == null) { + AutoMlGrpc.getDeleteModelMethod = + getDeleteModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "DeleteModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.DeleteModelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("DeleteModel")) + .build(); + } + } + } + return getDeleteModelMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateModelMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateModelRequest, com.google.cloud.automl.v1.Model> + METHOD_UPDATE_MODEL = getUpdateModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateModelRequest, com.google.cloud.automl.v1.Model> + getUpdateModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateModelRequest, com.google.cloud.automl.v1.Model> + getUpdateModelMethod() { + return getUpdateModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateModelRequest, com.google.cloud.automl.v1.Model> + getUpdateModelMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UpdateModelRequest, com.google.cloud.automl.v1.Model> + getUpdateModelMethod; + if ((getUpdateModelMethod = AutoMlGrpc.getUpdateModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getUpdateModelMethod = AutoMlGrpc.getUpdateModelMethod) == null) { + AutoMlGrpc.getUpdateModelMethod = + getUpdateModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "UpdateModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.UpdateModelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.Model.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("UpdateModel")) + .build(); + } + } + } + return getUpdateModelMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetModelEvaluationMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelEvaluationRequest, + com.google.cloud.automl.v1.ModelEvaluation> + METHOD_GET_MODEL_EVALUATION = getGetModelEvaluationMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelEvaluationRequest, + com.google.cloud.automl.v1.ModelEvaluation> + getGetModelEvaluationMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelEvaluationRequest, + com.google.cloud.automl.v1.ModelEvaluation> + getGetModelEvaluationMethod() { + return getGetModelEvaluationMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelEvaluationRequest, + com.google.cloud.automl.v1.ModelEvaluation> + getGetModelEvaluationMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetModelEvaluationRequest, + com.google.cloud.automl.v1.ModelEvaluation> + getGetModelEvaluationMethod; + if ((getGetModelEvaluationMethod = AutoMlGrpc.getGetModelEvaluationMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getGetModelEvaluationMethod = AutoMlGrpc.getGetModelEvaluationMethod) == null) { + AutoMlGrpc.getGetModelEvaluationMethod = + getGetModelEvaluationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.automl.v1.AutoMl", "GetModelEvaluation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.GetModelEvaluationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ModelEvaluation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("GetModelEvaluation")) + .build(); + } + } + } + return getGetModelEvaluationMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListModelEvaluationsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelEvaluationsRequest, + com.google.cloud.automl.v1.ListModelEvaluationsResponse> + METHOD_LIST_MODEL_EVALUATIONS = getListModelEvaluationsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelEvaluationsRequest, + com.google.cloud.automl.v1.ListModelEvaluationsResponse> + getListModelEvaluationsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelEvaluationsRequest, + com.google.cloud.automl.v1.ListModelEvaluationsResponse> + getListModelEvaluationsMethod() { + return getListModelEvaluationsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelEvaluationsRequest, + com.google.cloud.automl.v1.ListModelEvaluationsResponse> + getListModelEvaluationsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ListModelEvaluationsRequest, + com.google.cloud.automl.v1.ListModelEvaluationsResponse> + getListModelEvaluationsMethod; + if ((getListModelEvaluationsMethod = AutoMlGrpc.getListModelEvaluationsMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getListModelEvaluationsMethod = AutoMlGrpc.getListModelEvaluationsMethod) == null) { + AutoMlGrpc.getListModelEvaluationsMethod = + getListModelEvaluationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.automl.v1.AutoMl", "ListModelEvaluations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ListModelEvaluationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ListModelEvaluationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AutoMlMethodDescriptorSupplier("ListModelEvaluations")) + .build(); + } + } + } + return getListModelEvaluationsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AutoMlStub newStub(io.grpc.Channel channel) { + return new AutoMlStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AutoMlBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new AutoMlBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AutoMlFutureStub newFutureStub(io.grpc.Channel channel) { + return new AutoMlFutureStub(channel); + } + + /** + * + * + *
+   * AutoML Server API.
+   * The resource names are assigned by the server.
+   * The server never reuses names that it has created after the resources with
+   * those names are deleted.
+   * An ID of a resource is the last element of the item's resource name. For
+   * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
+   * the id for the item is `{dataset_id}`.
+   * Currently the only supported `location_id` is "us-central1".
+   * On any input that is documented to expect a string parameter in
+   * snake_case or kebab-case, either of those cases is accepted.
+   * 
+ */ + public abstract static class AutoMlImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a dataset.
+     * 
+ */ + public void createDataset( + com.google.cloud.automl.v1.CreateDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateDatasetMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets a dataset.
+     * 
+ */ + public void getDataset( + com.google.cloud.automl.v1.GetDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetDatasetMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists datasets in a project.
+     * 
+ */ + public void listDatasets( + com.google.cloud.automl.v1.ListDatasetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListDatasetsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates a dataset.
+     * 
+ */ + public void updateDataset( + com.google.cloud.automl.v1.UpdateDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateDatasetMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a dataset and all of its contents.
+     * Returns empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes,
+     * and `delete_details` in the
+     * [metadata][google.longrunning.Operation.metadata] field.
+     * 
+ */ + public void deleteDataset( + com.google.cloud.automl.v1.DeleteDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteDatasetMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Imports data into a dataset.
+     * 
+ */ + public void importData( + com.google.cloud.automl.v1.ImportDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getImportDataMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Exports dataset's data to the provided output location.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void exportData( + com.google.cloud.automl.v1.ExportDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getExportDataMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a model.
+     * Returns a Model in the [response][google.longrunning.Operation.response]
+     * field when it completes.
+     * When you create a model, several model evaluations are created for it:
+     * a global evaluation, and one evaluation for each annotation spec.
+     * 
+ */ + public void createModel( + com.google.cloud.automl.v1.CreateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateModelMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets a model.
+     * 
+ */ + public void getModel( + com.google.cloud.automl.v1.GetModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetModelMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists models.
+     * 
+ */ + public void listModels( + com.google.cloud.automl.v1.ListModelsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListModelsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a model.
+     * Returns `google.protobuf.Empty` in the
+     * [response][google.longrunning.Operation.response] field when it completes,
+     * and `delete_details` in the
+     * [metadata][google.longrunning.Operation.metadata] field.
+     * 
+ */ + public void deleteModel( + com.google.cloud.automl.v1.DeleteModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteModelMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates a model.
+     * 
+ */ + public void updateModel( + com.google.cloud.automl.v1.UpdateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateModelMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets a model evaluation.
+     * 
+ */ + public void getModelEvaluation( + com.google.cloud.automl.v1.GetModelEvaluationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetModelEvaluationMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists model evaluations.
+     * 
+ */ + public void listModelEvaluations( + com.google.cloud.automl.v1.ListModelEvaluationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListModelEvaluationsMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateDatasetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.CreateDatasetRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_DATASET))) + .addMethod( + getGetDatasetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.GetDatasetRequest, + com.google.cloud.automl.v1.Dataset>(this, METHODID_GET_DATASET))) + .addMethod( + getListDatasetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.ListDatasetsRequest, + com.google.cloud.automl.v1.ListDatasetsResponse>( + this, METHODID_LIST_DATASETS))) + .addMethod( + getUpdateDatasetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.UpdateDatasetRequest, + com.google.cloud.automl.v1.Dataset>(this, METHODID_UPDATE_DATASET))) + .addMethod( + getDeleteDatasetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.DeleteDatasetRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_DATASET))) + .addMethod( + getImportDataMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.ImportDataRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_DATA))) + .addMethod( + getExportDataMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.ExportDataRequest, + com.google.longrunning.Operation>(this, METHODID_EXPORT_DATA))) + .addMethod( + getCreateModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.CreateModelRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_MODEL))) + .addMethod( + getGetModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.GetModelRequest, com.google.cloud.automl.v1.Model>( + this, METHODID_GET_MODEL))) + .addMethod( + getListModelsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.ListModelsRequest, + com.google.cloud.automl.v1.ListModelsResponse>(this, METHODID_LIST_MODELS))) + .addMethod( + getDeleteModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.DeleteModelRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_MODEL))) + .addMethod( + getUpdateModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.UpdateModelRequest, + com.google.cloud.automl.v1.Model>(this, METHODID_UPDATE_MODEL))) + .addMethod( + getGetModelEvaluationMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.GetModelEvaluationRequest, + com.google.cloud.automl.v1.ModelEvaluation>( + this, METHODID_GET_MODEL_EVALUATION))) + .addMethod( + getListModelEvaluationsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.ListModelEvaluationsRequest, + com.google.cloud.automl.v1.ListModelEvaluationsResponse>( + this, METHODID_LIST_MODEL_EVALUATIONS))) + .build(); + } + } + + /** + * + * + *
+   * AutoML Server API.
+   * The resource names are assigned by the server.
+   * The server never reuses names that it has created after the resources with
+   * those names are deleted.
+   * An ID of a resource is the last element of the item's resource name. For
+   * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
+   * the id for the item is `{dataset_id}`.
+   * Currently the only supported `location_id` is "us-central1".
+   * On any input that is documented to expect a string parameter in
+   * snake_case or kebab-case, either of those cases is accepted.
+   * 
+ */ + public static final class AutoMlStub extends io.grpc.stub.AbstractStub { + private AutoMlStub(io.grpc.Channel channel) { + super(channel); + } + + private AutoMlStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AutoMlStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AutoMlStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a dataset.
+     * 
+ */ + public void createDataset( + com.google.cloud.automl.v1.CreateDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateDatasetMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a dataset.
+     * 
+ */ + public void getDataset( + com.google.cloud.automl.v1.GetDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetDatasetMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists datasets in a project.
+     * 
+ */ + public void listDatasets( + com.google.cloud.automl.v1.ListDatasetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListDatasetsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a dataset.
+     * 
+ */ + public void updateDataset( + com.google.cloud.automl.v1.UpdateDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateDatasetMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a dataset and all of its contents.
+     * Returns empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes,
+     * and `delete_details` in the
+     * [metadata][google.longrunning.Operation.metadata] field.
+     * 
+ */ + public void deleteDataset( + com.google.cloud.automl.v1.DeleteDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteDatasetMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Imports data into a dataset.
+     * 
+ */ + public void importData( + com.google.cloud.automl.v1.ImportDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getImportDataMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Exports dataset's data to the provided output location.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void exportData( + com.google.cloud.automl.v1.ExportDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getExportDataMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a model.
+     * Returns a Model in the [response][google.longrunning.Operation.response]
+     * field when it completes.
+     * When you create a model, several model evaluations are created for it:
+     * a global evaluation, and one evaluation for each annotation spec.
+     * 
+ */ + public void createModel( + com.google.cloud.automl.v1.CreateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateModelMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a model.
+     * 
+ */ + public void getModel( + com.google.cloud.automl.v1.GetModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetModelMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists models.
+     * 
+ */ + public void listModels( + com.google.cloud.automl.v1.ListModelsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListModelsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a model.
+     * Returns `google.protobuf.Empty` in the
+     * [response][google.longrunning.Operation.response] field when it completes,
+     * and `delete_details` in the
+     * [metadata][google.longrunning.Operation.metadata] field.
+     * 
+ */ + public void deleteModel( + com.google.cloud.automl.v1.DeleteModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteModelMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a model.
+     * 
+ */ + public void updateModel( + com.google.cloud.automl.v1.UpdateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateModelMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a model evaluation.
+     * 
+ */ + public void getModelEvaluation( + com.google.cloud.automl.v1.GetModelEvaluationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetModelEvaluationMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists model evaluations.
+     * 
+ */ + public void listModelEvaluations( + com.google.cloud.automl.v1.ListModelEvaluationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListModelEvaluationsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * AutoML Server API.
+   * The resource names are assigned by the server.
+   * The server never reuses names that it has created after the resources with
+   * those names are deleted.
+   * An ID of a resource is the last element of the item's resource name. For
+   * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
+   * the id for the item is `{dataset_id}`.
+   * Currently the only supported `location_id` is "us-central1".
+   * On any input that is documented to expect a string parameter in
+   * snake_case or kebab-case, either of those cases is accepted.
+   * 
+ */ + public static final class AutoMlBlockingStub + extends io.grpc.stub.AbstractStub { + private AutoMlBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private AutoMlBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AutoMlBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AutoMlBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a dataset.
+     * 
+ */ + public com.google.longrunning.Operation createDataset( + com.google.cloud.automl.v1.CreateDatasetRequest request) { + return blockingUnaryCall( + getChannel(), getCreateDatasetMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a dataset.
+     * 
+ */ + public com.google.cloud.automl.v1.Dataset getDataset( + com.google.cloud.automl.v1.GetDatasetRequest request) { + return blockingUnaryCall( + getChannel(), getGetDatasetMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists datasets in a project.
+     * 
+ */ + public com.google.cloud.automl.v1.ListDatasetsResponse listDatasets( + com.google.cloud.automl.v1.ListDatasetsRequest request) { + return blockingUnaryCall( + getChannel(), getListDatasetsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a dataset.
+     * 
+ */ + public com.google.cloud.automl.v1.Dataset updateDataset( + com.google.cloud.automl.v1.UpdateDatasetRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateDatasetMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a dataset and all of its contents.
+     * Returns empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes,
+     * and `delete_details` in the
+     * [metadata][google.longrunning.Operation.metadata] field.
+     * 
+ */ + public com.google.longrunning.Operation deleteDataset( + com.google.cloud.automl.v1.DeleteDatasetRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteDatasetMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Imports data into a dataset.
+     * 
+ */ + public com.google.longrunning.Operation importData( + com.google.cloud.automl.v1.ImportDataRequest request) { + return blockingUnaryCall( + getChannel(), getImportDataMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exports dataset's data to the provided output location.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.longrunning.Operation exportData( + com.google.cloud.automl.v1.ExportDataRequest request) { + return blockingUnaryCall( + getChannel(), getExportDataMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a model.
+     * Returns a Model in the [response][google.longrunning.Operation.response]
+     * field when it completes.
+     * When you create a model, several model evaluations are created for it:
+     * a global evaluation, and one evaluation for each annotation spec.
+     * 
+ */ + public com.google.longrunning.Operation createModel( + com.google.cloud.automl.v1.CreateModelRequest request) { + return blockingUnaryCall( + getChannel(), getCreateModelMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a model.
+     * 
+ */ + public com.google.cloud.automl.v1.Model getModel( + com.google.cloud.automl.v1.GetModelRequest request) { + return blockingUnaryCall(getChannel(), getGetModelMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists models.
+     * 
+ */ + public com.google.cloud.automl.v1.ListModelsResponse listModels( + com.google.cloud.automl.v1.ListModelsRequest request) { + return blockingUnaryCall( + getChannel(), getListModelsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a model.
+     * Returns `google.protobuf.Empty` in the
+     * [response][google.longrunning.Operation.response] field when it completes,
+     * and `delete_details` in the
+     * [metadata][google.longrunning.Operation.metadata] field.
+     * 
+ */ + public com.google.longrunning.Operation deleteModel( + com.google.cloud.automl.v1.DeleteModelRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteModelMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a model.
+     * 
+ */ + public com.google.cloud.automl.v1.Model updateModel( + com.google.cloud.automl.v1.UpdateModelRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateModelMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a model evaluation.
+     * 
+ */ + public com.google.cloud.automl.v1.ModelEvaluation getModelEvaluation( + com.google.cloud.automl.v1.GetModelEvaluationRequest request) { + return blockingUnaryCall( + getChannel(), getGetModelEvaluationMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists model evaluations.
+     * 
+ */ + public com.google.cloud.automl.v1.ListModelEvaluationsResponse listModelEvaluations( + com.google.cloud.automl.v1.ListModelEvaluationsRequest request) { + return blockingUnaryCall( + getChannel(), getListModelEvaluationsMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * AutoML Server API.
+   * The resource names are assigned by the server.
+   * The server never reuses names that it has created after the resources with
+   * those names are deleted.
+   * An ID of a resource is the last element of the item's resource name. For
+   * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
+   * the id for the item is `{dataset_id}`.
+   * Currently the only supported `location_id` is "us-central1".
+   * On any input that is documented to expect a string parameter in
+   * snake_case or kebab-case, either of those cases is accepted.
+   * 
+ */ + public static final class AutoMlFutureStub extends io.grpc.stub.AbstractStub { + private AutoMlFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private AutoMlFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AutoMlFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AutoMlFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createDataset(com.google.cloud.automl.v1.CreateDatasetRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateDatasetMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getDataset(com.google.cloud.automl.v1.GetDatasetRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetDatasetMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists datasets in a project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.automl.v1.ListDatasetsResponse> + listDatasets(com.google.cloud.automl.v1.ListDatasetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListDatasetsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateDataset(com.google.cloud.automl.v1.UpdateDatasetRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateDatasetMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a dataset and all of its contents.
+     * Returns empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes,
+     * and `delete_details` in the
+     * [metadata][google.longrunning.Operation.metadata] field.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDataset(com.google.cloud.automl.v1.DeleteDatasetRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteDatasetMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Imports data into a dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importData(com.google.cloud.automl.v1.ImportDataRequest request) { + return futureUnaryCall( + getChannel().newCall(getImportDataMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Exports dataset's data to the provided output location.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + exportData(com.google.cloud.automl.v1.ExportDataRequest request) { + return futureUnaryCall( + getChannel().newCall(getExportDataMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a model.
+     * Returns a Model in the [response][google.longrunning.Operation.response]
+     * field when it completes.
+     * When you create a model, several model evaluations are created for it:
+     * a global evaluation, and one evaluation for each annotation spec.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createModel(com.google.cloud.automl.v1.CreateModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateModelMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a model.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getModel(com.google.cloud.automl.v1.GetModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetModelMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists models.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.automl.v1.ListModelsResponse> + listModels(com.google.cloud.automl.v1.ListModelsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListModelsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a model.
+     * Returns `google.protobuf.Empty` in the
+     * [response][google.longrunning.Operation.response] field when it completes,
+     * and `delete_details` in the
+     * [metadata][google.longrunning.Operation.metadata] field.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteModel(com.google.cloud.automl.v1.DeleteModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteModelMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a model.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateModel(com.google.cloud.automl.v1.UpdateModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateModelMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a model evaluation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.automl.v1.ModelEvaluation> + getModelEvaluation(com.google.cloud.automl.v1.GetModelEvaluationRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetModelEvaluationMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists model evaluations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.automl.v1.ListModelEvaluationsResponse> + listModelEvaluations(com.google.cloud.automl.v1.ListModelEvaluationsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListModelEvaluationsMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_DATASET = 0; + private static final int METHODID_GET_DATASET = 1; + private static final int METHODID_LIST_DATASETS = 2; + private static final int METHODID_UPDATE_DATASET = 3; + 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 class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AutoMlImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AutoMlImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_DATASET: + serviceImpl.createDataset( + (com.google.cloud.automl.v1.CreateDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DATASET: + serviceImpl.getDataset( + (com.google.cloud.automl.v1.GetDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_DATASETS: + serviceImpl.listDatasets( + (com.google.cloud.automl.v1.ListDatasetsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DATASET: + serviceImpl.updateDataset( + (com.google.cloud.automl.v1.UpdateDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_DATASET: + serviceImpl.deleteDataset( + (com.google.cloud.automl.v1.DeleteDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_DATA: + serviceImpl.importData( + (com.google.cloud.automl.v1.ImportDataRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EXPORT_DATA: + serviceImpl.exportData( + (com.google.cloud.automl.v1.ExportDataRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_MODEL: + serviceImpl.createModel( + (com.google.cloud.automl.v1.CreateModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_MODEL: + serviceImpl.getModel( + (com.google.cloud.automl.v1.GetModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_MODELS: + serviceImpl.listModels( + (com.google.cloud.automl.v1.ListModelsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_MODEL: + serviceImpl.deleteModel( + (com.google.cloud.automl.v1.DeleteModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_MODEL: + serviceImpl.updateModel( + (com.google.cloud.automl.v1.UpdateModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_MODEL_EVALUATION: + serviceImpl.getModelEvaluation( + (com.google.cloud.automl.v1.GetModelEvaluationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_MODEL_EVALUATIONS: + serviceImpl.listModelEvaluations( + (com.google.cloud.automl.v1.ListModelEvaluationsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class AutoMlBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AutoMlBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AutoMl"); + } + } + + private static final class AutoMlFileDescriptorSupplier extends AutoMlBaseDescriptorSupplier { + AutoMlFileDescriptorSupplier() {} + } + + private static final class AutoMlMethodDescriptorSupplier extends AutoMlBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AutoMlMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AutoMlGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AutoMlFileDescriptorSupplier()) + .addMethod(getCreateDatasetMethodHelper()) + .addMethod(getGetDatasetMethodHelper()) + .addMethod(getListDatasetsMethodHelper()) + .addMethod(getUpdateDatasetMethodHelper()) + .addMethod(getDeleteDatasetMethodHelper()) + .addMethod(getImportDataMethodHelper()) + .addMethod(getExportDataMethodHelper()) + .addMethod(getCreateModelMethodHelper()) + .addMethod(getGetModelMethodHelper()) + .addMethod(getListModelsMethodHelper()) + .addMethod(getDeleteModelMethodHelper()) + .addMethod(getUpdateModelMethodHelper()) + .addMethod(getGetModelEvaluationMethodHelper()) + .addMethod(getListModelEvaluationsMethodHelper()) + .build(); + } + } + } + return result; + } +} 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 new file mode 100644 index 000000000..f3eea9507 --- /dev/null +++ b/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceGrpc.java @@ -0,0 +1,382 @@ +/* + * 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 static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * AutoML Prediction API.
+ * On any input that is documented to expect a string parameter in
+ * snake_case or kebab-case, either of those cases is accepted.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/automl/v1/prediction_service.proto") +public final class PredictionServiceGrpc { + + private PredictionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.automl.v1.PredictionService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getPredictMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.PredictRequest, com.google.cloud.automl.v1.PredictResponse> + METHOD_PREDICT = getPredictMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.PredictRequest, com.google.cloud.automl.v1.PredictResponse> + getPredictMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.PredictRequest, com.google.cloud.automl.v1.PredictResponse> + getPredictMethod() { + return getPredictMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.PredictRequest, com.google.cloud.automl.v1.PredictResponse> + getPredictMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.PredictRequest, com.google.cloud.automl.v1.PredictResponse> + getPredictMethod; + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + PredictionServiceGrpc.getPredictMethod = + getPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.automl.v1.PredictionService", "Predict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.PredictRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.PredictResponse.getDefaultInstance())) + .setSchemaDescriptor(new PredictionServiceMethodDescriptorSupplier("Predict")) + .build(); + } + } + } + return getPredictMethod; + } + + /** 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); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PredictionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new PredictionServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PredictionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new PredictionServiceFutureStub(channel); + } + + /** + * + * + *
+   * AutoML Prediction API.
+   * On any input that is documented to expect a string parameter in
+   * snake_case or kebab-case, either of those cases is accepted.
+   * 
+ */ + public abstract static class PredictionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void predict( + com.google.cloud.automl.v1.PredictRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getPredictMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getPredictMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.PredictRequest, + com.google.cloud.automl.v1.PredictResponse>(this, METHODID_PREDICT))) + .build(); + } + } + + /** + * + * + *
+   * AutoML Prediction API.
+   * On any input that is documented to expect a string parameter in
+   * snake_case or kebab-case, either of those cases is accepted.
+   * 
+ */ + public static final class PredictionServiceStub + extends io.grpc.stub.AbstractStub { + private PredictionServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private PredictionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void predict( + com.google.cloud.automl.v1.PredictRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getPredictMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * AutoML Prediction API.
+   * On any input that is documented to expect a string parameter in
+   * snake_case or kebab-case, either of those cases is accepted.
+   * 
+ */ + public static final class PredictionServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private PredictionServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private PredictionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.automl.v1.PredictResponse predict( + com.google.cloud.automl.v1.PredictRequest request) { + return blockingUnaryCall(getChannel(), getPredictMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * AutoML Prediction API.
+   * On any input that is documented to expect a string parameter in
+   * snake_case or kebab-case, either of those cases is accepted.
+   * 
+ */ + public static final class PredictionServiceFutureStub + extends io.grpc.stub.AbstractStub { + private PredictionServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private PredictionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.automl.v1.PredictResponse> + predict(com.google.cloud.automl.v1.PredictRequest request) { + return futureUnaryCall( + getChannel().newCall(getPredictMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_PREDICT = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final PredictionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(PredictionServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_PREDICT: + serviceImpl.predict( + (com.google.cloud.automl.v1.PredictRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PredictionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.automl.v1.PredictionServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PredictionService"); + } + } + + private static final class PredictionServiceFileDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier { + PredictionServiceFileDescriptorSupplier() {} + } + + private static final class PredictionServiceMethodDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + PredictionServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (PredictionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PredictionServiceFileDescriptorSupplier()) + .addMethod(getPredictMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 4db1fa903..4e02eda3b 100644 --- a/pom.xml +++ b/pom.xml @@ -83,11 +83,21 @@ proto-google-cloud-automl-v1beta1 0.76.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-automl-v1 + 0.76.1-SNAPSHOT + com.google.api.grpc grpc-google-cloud-automl-v1beta1 0.76.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-automl-v1 + 0.76.1-SNAPSHOT + com.google.cloud google-cloud-automl @@ -179,7 +189,9 @@ proto-google-cloud-automl-v1beta1 + proto-google-cloud-automl-v1 grpc-google-cloud-automl-v1beta1 + grpc-google-cloud-automl-v1 google-cloud-automl diff --git a/proto-google-cloud-automl-v1/pom.xml b/proto-google-cloud-automl-v1/pom.xml new file mode 100644 index 000000000..cfb80e03f --- /dev/null +++ b/proto-google-cloud-automl-v1/pom.xml @@ -0,0 +1,33 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-automl-v1 + 0.76.1-SNAPSHOT + proto-google-cloud-automl-v1 + PROTO library for proto-google-cloud-automl-v1 + + com.google.cloud + google-cloud-automl-parent + 0.111.1-beta-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + \ No newline at end of file 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 new file mode 100644 index 000000000..68669a251 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayload.java @@ -0,0 +1,808 @@ +/* + * 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_payload.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Contains annotation information that is relevant to AutoML.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.AnnotationPayload} + */ +public final class AnnotationPayload extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.AnnotationPayload) + AnnotationPayloadOrBuilder { + private static final long serialVersionUID = 0L; + // Use AnnotationPayload.newBuilder() to construct. + private AnnotationPayload(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AnnotationPayload() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AnnotationPayload( + 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.TranslationAnnotation.Builder subBuilder = null; + if (detailCase_ == 2) { + subBuilder = + ((com.google.cloud.automl.v1.TranslationAnnotation) detail_).toBuilder(); + } + detail_ = + input.readMessage( + com.google.cloud.automl.v1.TranslationAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.TranslationAnnotation) detail_); + detail_ = subBuilder.buildPartial(); + } + detailCase_ = 2; + 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.AnnotationPayloadOuterClass + .internal_static_google_cloud_automl_v1_AnnotationPayload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AnnotationPayloadOuterClass + .internal_static_google_cloud_automl_v1_AnnotationPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.AnnotationPayload.class, + com.google.cloud.automl.v1.AnnotationPayload.Builder.class); + } + + private int detailCase_ = 0; + private java.lang.Object detail_; + + public enum DetailCase implements com.google.protobuf.Internal.EnumLite { + TRANSLATION(2), + DETAIL_NOT_SET(0); + private final int value; + + private DetailCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DetailCase valueOf(int value) { + return forNumber(value); + } + + public static DetailCase forNumber(int value) { + switch (value) { + case 2: + return TRANSLATION; + case 0: + return DETAIL_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DetailCase getDetailCase() { + return DetailCase.forNumber(detailCase_); + } + + public static final int TRANSLATION_FIELD_NUMBER = 2; + /** + * + * + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public boolean hasTranslation() { + return detailCase_ == 2; + } + /** + * + * + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1.TranslationAnnotation getTranslation() { + if (detailCase_ == 2) { + return (com.google.cloud.automl.v1.TranslationAnnotation) detail_; + } + return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance(); + } + /** + * + * + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1.TranslationAnnotationOrBuilder getTranslationOrBuilder() { + if (detailCase_ == 2) { + return (com.google.cloud.automl.v1.TranslationAnnotation) detail_; + } + return com.google.cloud.automl.v1.TranslationAnnotation.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 (detailCase_ == 2) { + output.writeMessage(2, (com.google.cloud.automl.v1.TranslationAnnotation) detail_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (detailCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.automl.v1.TranslationAnnotation) detail_); + } + 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.AnnotationPayload)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.AnnotationPayload other = + (com.google.cloud.automl.v1.AnnotationPayload) obj; + + if (!getDetailCase().equals(other.getDetailCase())) return false; + switch (detailCase_) { + case 2: + if (!getTranslation().equals(other.getTranslation())) 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 (detailCase_) { + case 2: + hash = (37 * hash) + TRANSLATION_FIELD_NUMBER; + hash = (53 * hash) + getTranslation().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.AnnotationPayload 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.AnnotationPayload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.AnnotationPayload 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.AnnotationPayload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.AnnotationPayload 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.AnnotationPayload parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.AnnotationPayload 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.AnnotationPayload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.AnnotationPayload 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.AnnotationPayload 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.AnnotationPayload 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.AnnotationPayload 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 information that is relevant to AutoML.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.AnnotationPayload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.AnnotationPayload) + com.google.cloud.automl.v1.AnnotationPayloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AnnotationPayloadOuterClass + .internal_static_google_cloud_automl_v1_AnnotationPayload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AnnotationPayloadOuterClass + .internal_static_google_cloud_automl_v1_AnnotationPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.AnnotationPayload.class, + com.google.cloud.automl.v1.AnnotationPayload.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.AnnotationPayload.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(); + detailCase_ = 0; + detail_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.AnnotationPayloadOuterClass + .internal_static_google_cloud_automl_v1_AnnotationPayload_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.AnnotationPayload getDefaultInstanceForType() { + return com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.AnnotationPayload build() { + com.google.cloud.automl.v1.AnnotationPayload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.AnnotationPayload buildPartial() { + com.google.cloud.automl.v1.AnnotationPayload result = + new com.google.cloud.automl.v1.AnnotationPayload(this); + if (detailCase_ == 2) { + if (translationBuilder_ == null) { + result.detail_ = detail_; + } else { + result.detail_ = translationBuilder_.build(); + } + } + result.detailCase_ = detailCase_; + 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.AnnotationPayload) { + return mergeFrom((com.google.cloud.automl.v1.AnnotationPayload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.AnnotationPayload other) { + if (other == com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance()) return this; + switch (other.getDetailCase()) { + case TRANSLATION: + { + mergeTranslation(other.getTranslation()); + 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( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.AnnotationPayload parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.AnnotationPayload) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int detailCase_ = 0; + private java.lang.Object detail_; + + public DetailCase getDetailCase() { + return DetailCase.forNumber(detailCase_); + } + + public Builder clearDetail() { + detailCase_ = 0; + detail_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationAnnotation, + com.google.cloud.automl.v1.TranslationAnnotation.Builder, + com.google.cloud.automl.v1.TranslationAnnotationOrBuilder> + translationBuilder_; + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public boolean hasTranslation() { + return detailCase_ == 2; + } + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1.TranslationAnnotation getTranslation() { + if (translationBuilder_ == null) { + if (detailCase_ == 2) { + return (com.google.cloud.automl.v1.TranslationAnnotation) detail_; + } + return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance(); + } else { + if (detailCase_ == 2) { + return translationBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public Builder setTranslation(com.google.cloud.automl.v1.TranslationAnnotation value) { + if (translationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + onChanged(); + } else { + translationBuilder_.setMessage(value); + } + detailCase_ = 2; + return this; + } + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public Builder setTranslation( + com.google.cloud.automl.v1.TranslationAnnotation.Builder builderForValue) { + if (translationBuilder_ == null) { + detail_ = builderForValue.build(); + onChanged(); + } else { + translationBuilder_.setMessage(builderForValue.build()); + } + detailCase_ = 2; + return this; + } + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public Builder mergeTranslation(com.google.cloud.automl.v1.TranslationAnnotation value) { + if (translationBuilder_ == null) { + if (detailCase_ == 2 + && detail_ != com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance()) { + detail_ = + com.google.cloud.automl.v1.TranslationAnnotation.newBuilder( + (com.google.cloud.automl.v1.TranslationAnnotation) detail_) + .mergeFrom(value) + .buildPartial(); + } else { + detail_ = value; + } + onChanged(); + } else { + if (detailCase_ == 2) { + translationBuilder_.mergeFrom(value); + } + translationBuilder_.setMessage(value); + } + detailCase_ = 2; + return this; + } + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public Builder clearTranslation() { + if (translationBuilder_ == null) { + if (detailCase_ == 2) { + detailCase_ = 0; + detail_ = null; + onChanged(); + } + } else { + if (detailCase_ == 2) { + detailCase_ = 0; + detail_ = null; + } + translationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1.TranslationAnnotation.Builder getTranslationBuilder() { + return getTranslationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1.TranslationAnnotationOrBuilder getTranslationOrBuilder() { + if ((detailCase_ == 2) && (translationBuilder_ != null)) { + return translationBuilder_.getMessageOrBuilder(); + } else { + if (detailCase_ == 2) { + return (com.google.cloud.automl.v1.TranslationAnnotation) detail_; + } + return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationAnnotation, + com.google.cloud.automl.v1.TranslationAnnotation.Builder, + com.google.cloud.automl.v1.TranslationAnnotationOrBuilder> + getTranslationFieldBuilder() { + if (translationBuilder_ == null) { + if (!(detailCase_ == 2)) { + detail_ = com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance(); + } + translationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationAnnotation, + com.google.cloud.automl.v1.TranslationAnnotation.Builder, + com.google.cloud.automl.v1.TranslationAnnotationOrBuilder>( + (com.google.cloud.automl.v1.TranslationAnnotation) detail_, + getParentForChildren(), + isClean()); + detail_ = null; + } + detailCase_ = 2; + onChanged(); + ; + return translationBuilder_; + } + + @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.AnnotationPayload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.AnnotationPayload) + private static final com.google.cloud.automl.v1.AnnotationPayload DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.AnnotationPayload(); + } + + public static com.google.cloud.automl.v1.AnnotationPayload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnnotationPayload parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotationPayload(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.AnnotationPayload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..a5ee4c261 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOrBuilder.java @@ -0,0 +1,58 @@ +/* + * 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_payload.proto + +package com.google.cloud.automl.v1; + +public interface AnnotationPayloadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.AnnotationPayload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + boolean hasTranslation(); + /** + * + * + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + com.google.cloud.automl.v1.TranslationAnnotation getTranslation(); + /** + * + * + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationAnnotation translation = 2; + */ + com.google.cloud.automl.v1.TranslationAnnotationOrBuilder getTranslationOrBuilder(); + + 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 new file mode 100644 index 000000000..fe32f4437 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOuterClass.java @@ -0,0 +1,86 @@ +/* + * 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_payload.proto + +package com.google.cloud.automl.v1; + +public final class AnnotationPayloadOuterClass { + private AnnotationPayloadOuterClass() {} + + 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_AnnotationPayload_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_AnnotationPayload_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_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 + * Request message for [AutoMl.CreateDataset][google.cloud.automl.v1.AutoMl.CreateDataset]. + * + * + * Protobuf type {@code google.cloud.automl.v1.CreateDatasetRequest} + */ +public final class CreateDatasetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.CreateDatasetRequest) + CreateDatasetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDatasetRequest.newBuilder() to construct. + private CreateDatasetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDatasetRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateDatasetRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.automl.v1.Dataset.Builder subBuilder = null; + if (dataset_ != null) { + subBuilder = dataset_.toBuilder(); + } + dataset_ = + input.readMessage(com.google.cloud.automl.v1.Dataset.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dataset_); + dataset_ = 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_CreateDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_CreateDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.CreateDatasetRequest.class, + com.google.cloud.automl.v1.CreateDatasetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The resource name of the project to create the dataset for.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the project to create the dataset for.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATASET_FIELD_NUMBER = 2; + private com.google.cloud.automl.v1.Dataset dataset_; + /** + * + * + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public boolean hasDataset() { + return dataset_ != null; + } + /** + * + * + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1.Dataset getDataset() { + return dataset_ == null ? com.google.cloud.automl.v1.Dataset.getDefaultInstance() : dataset_; + } + /** + * + * + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1.DatasetOrBuilder getDatasetOrBuilder() { + return getDataset(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (dataset_ != null) { + output.writeMessage(2, getDataset()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (dataset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDataset()); + } + 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.CreateDatasetRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.CreateDatasetRequest other = + (com.google.cloud.automl.v1.CreateDatasetRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasDataset() != other.hasDataset()) return false; + if (hasDataset()) { + if (!getDataset().equals(other.getDataset())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasDataset()) { + hash = (37 * hash) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.CreateDatasetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateDatasetRequest 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.CreateDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateDatasetRequest 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.CreateDatasetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateDatasetRequest 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.CreateDatasetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateDatasetRequest 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.CreateDatasetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateDatasetRequest 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.CreateDatasetRequest 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.CreateDatasetRequest 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.CreateDatasetRequest 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.CreateDataset][google.cloud.automl.v1.AutoMl.CreateDataset].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.CreateDatasetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.CreateDatasetRequest) + com.google.cloud.automl.v1.CreateDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_CreateDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_CreateDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.CreateDatasetRequest.class, + com.google.cloud.automl.v1.CreateDatasetRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.CreateDatasetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (datasetBuilder_ == null) { + dataset_ = null; + } else { + dataset_ = null; + datasetBuilder_ = 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_CreateDatasetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateDatasetRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.CreateDatasetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateDatasetRequest build() { + com.google.cloud.automl.v1.CreateDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateDatasetRequest buildPartial() { + com.google.cloud.automl.v1.CreateDatasetRequest result = + new com.google.cloud.automl.v1.CreateDatasetRequest(this); + result.parent_ = parent_; + if (datasetBuilder_ == null) { + result.dataset_ = dataset_; + } else { + result.dataset_ = datasetBuilder_.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.CreateDatasetRequest) { + return mergeFrom((com.google.cloud.automl.v1.CreateDatasetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.CreateDatasetRequest other) { + if (other == com.google.cloud.automl.v1.CreateDatasetRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasDataset()) { + mergeDataset(other.getDataset()); + } + 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.CreateDatasetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.CreateDatasetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The resource name of the project to create the dataset for.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the project to create the dataset for.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the project to create the dataset for.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the project to create the dataset for.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the project to create the dataset for.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.automl.v1.Dataset dataset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder> + datasetBuilder_; + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public boolean hasDataset() { + return datasetBuilder_ != null || dataset_ != null; + } + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1.Dataset getDataset() { + if (datasetBuilder_ == null) { + return dataset_ == null + ? com.google.cloud.automl.v1.Dataset.getDefaultInstance() + : dataset_; + } else { + return datasetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public Builder setDataset(com.google.cloud.automl.v1.Dataset value) { + if (datasetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataset_ = value; + onChanged(); + } else { + datasetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public Builder setDataset(com.google.cloud.automl.v1.Dataset.Builder builderForValue) { + if (datasetBuilder_ == null) { + dataset_ = builderForValue.build(); + onChanged(); + } else { + datasetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public Builder mergeDataset(com.google.cloud.automl.v1.Dataset value) { + if (datasetBuilder_ == null) { + if (dataset_ != null) { + dataset_ = + com.google.cloud.automl.v1.Dataset.newBuilder(dataset_) + .mergeFrom(value) + .buildPartial(); + } else { + dataset_ = value; + } + onChanged(); + } else { + datasetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public Builder clearDataset() { + if (datasetBuilder_ == null) { + dataset_ = null; + onChanged(); + } else { + dataset_ = null; + datasetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1.Dataset.Builder getDatasetBuilder() { + + onChanged(); + return getDatasetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1.DatasetOrBuilder getDatasetOrBuilder() { + if (datasetBuilder_ != null) { + return datasetBuilder_.getMessageOrBuilder(); + } else { + return dataset_ == null + ? com.google.cloud.automl.v1.Dataset.getDefaultInstance() + : dataset_; + } + } + /** + * + * + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder> + getDatasetFieldBuilder() { + if (datasetBuilder_ == null) { + datasetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder>( + getDataset(), getParentForChildren(), isClean()); + dataset_ = null; + } + return datasetBuilder_; + } + + @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.CreateDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.CreateDatasetRequest) + private static final com.google.cloud.automl.v1.CreateDatasetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.CreateDatasetRequest(); + } + + public static com.google.cloud.automl.v1.CreateDatasetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDatasetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateDatasetRequest(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.CreateDatasetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetRequestOrBuilder.java new file mode 100644 index 000000000..8af447eff --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetRequestOrBuilder.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 CreateDatasetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.CreateDatasetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the project to create the dataset for.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * The resource name of the project to create the dataset for.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + boolean hasDataset(); + /** + * + * + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + com.google.cloud.automl.v1.Dataset getDataset(); + /** + * + * + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 2; + */ + com.google.cloud.automl.v1.DatasetOrBuilder getDatasetOrBuilder(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelOperationMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelOperationMetadata.java new file mode 100644 index 000000000..a1c11a7f4 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelOperationMetadata.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/operations.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Details of CreateModel operation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.CreateModelOperationMetadata} + */ +public final class CreateModelOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.CreateModelOperationMetadata) + CreateModelOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateModelOperationMetadata.newBuilder() to construct. + private CreateModelOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateModelOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateModelOperationMetadata( + 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_CreateModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_CreateModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.CreateModelOperationMetadata.class, + com.google.cloud.automl.v1.CreateModelOperationMetadata.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.CreateModelOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.CreateModelOperationMetadata other = + (com.google.cloud.automl.v1.CreateModelOperationMetadata) 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.CreateModelOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateModelOperationMetadata 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.CreateModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateModelOperationMetadata 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.CreateModelOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateModelOperationMetadata 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.CreateModelOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateModelOperationMetadata 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.CreateModelOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateModelOperationMetadata 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.CreateModelOperationMetadata 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.CreateModelOperationMetadata 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.CreateModelOperationMetadata 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 CreateModel operation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.CreateModelOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.CreateModelOperationMetadata) + com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_CreateModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_CreateModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.CreateModelOperationMetadata.class, + com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.CreateModelOperationMetadata.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_CreateModelOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateModelOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateModelOperationMetadata build() { + com.google.cloud.automl.v1.CreateModelOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateModelOperationMetadata buildPartial() { + com.google.cloud.automl.v1.CreateModelOperationMetadata result = + new com.google.cloud.automl.v1.CreateModelOperationMetadata(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.CreateModelOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.CreateModelOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.CreateModelOperationMetadata other) { + if (other == com.google.cloud.automl.v1.CreateModelOperationMetadata.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.CreateModelOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.CreateModelOperationMetadata) 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.CreateModelOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.CreateModelOperationMetadata) + private static final com.google.cloud.automl.v1.CreateModelOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.CreateModelOperationMetadata(); + } + + public static com.google.cloud.automl.v1.CreateModelOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateModelOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateModelOperationMetadata(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.CreateModelOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelOperationMetadataOrBuilder.java new file mode 100644 index 000000000..ad632b655 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelOperationMetadataOrBuilder.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 CreateModelOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.CreateModelOperationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelRequest.java new file mode 100644 index 000000000..1751ad304 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelRequest.java @@ -0,0 +1,868 @@ +/* + * 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.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.CreateModelRequest} + */ +public final class CreateModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.CreateModelRequest) + CreateModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateModelRequest.newBuilder() to construct. + private CreateModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateModelRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateModelRequest( + 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(); + + parent_ = s; + break; + } + case 34: + { + com.google.cloud.automl.v1.Model.Builder subBuilder = null; + if (model_ != null) { + subBuilder = model_.toBuilder(); + } + model_ = + input.readMessage(com.google.cloud.automl.v1.Model.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(model_); + model_ = 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_CreateModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_CreateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.CreateModelRequest.class, + com.google.cloud.automl.v1.CreateModelRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the parent project where the model is being created.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the parent project where the model is being created.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_FIELD_NUMBER = 4; + private com.google.cloud.automl.v1.Model model_; + /** + * + * + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public boolean hasModel() { + return model_ != null; + } + /** + * + * + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public com.google.cloud.automl.v1.Model getModel() { + return model_ == null ? com.google.cloud.automl.v1.Model.getDefaultInstance() : model_; + } + /** + * + * + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder() { + return getModel(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (model_ != null) { + output.writeMessage(4, getModel()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (model_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getModel()); + } + 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.CreateModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.CreateModelRequest other = + (com.google.cloud.automl.v1.CreateModelRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasModel() != other.hasModel()) return false; + if (hasModel()) { + if (!getModel().equals(other.getModel())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasModel()) { + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.CreateModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateModelRequest 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.CreateModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateModelRequest 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.CreateModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateModelRequest 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.CreateModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateModelRequest 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.CreateModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateModelRequest 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.CreateModelRequest 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.CreateModelRequest 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.CreateModelRequest 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.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.CreateModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.CreateModelRequest) + com.google.cloud.automl.v1.CreateModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_CreateModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_CreateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.CreateModelRequest.class, + com.google.cloud.automl.v1.CreateModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.CreateModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (modelBuilder_ == null) { + model_ = null; + } else { + model_ = null; + modelBuilder_ = 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_CreateModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.CreateModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateModelRequest build() { + com.google.cloud.automl.v1.CreateModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateModelRequest buildPartial() { + com.google.cloud.automl.v1.CreateModelRequest result = + new com.google.cloud.automl.v1.CreateModelRequest(this); + result.parent_ = parent_; + if (modelBuilder_ == null) { + result.model_ = model_; + } else { + result.model_ = modelBuilder_.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.CreateModelRequest) { + return mergeFrom((com.google.cloud.automl.v1.CreateModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.CreateModelRequest other) { + if (other == com.google.cloud.automl.v1.CreateModelRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasModel()) { + mergeModel(other.getModel()); + } + 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.CreateModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.CreateModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the parent project where the model is being created.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the parent project where the model is being created.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the parent project where the model is being created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent project where the model is being created.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent project where the model is being created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.automl.v1.Model model_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder> + modelBuilder_; + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public boolean hasModel() { + return modelBuilder_ != null || model_ != null; + } + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public com.google.cloud.automl.v1.Model getModel() { + if (modelBuilder_ == null) { + return model_ == null ? com.google.cloud.automl.v1.Model.getDefaultInstance() : model_; + } else { + return modelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public Builder setModel(com.google.cloud.automl.v1.Model value) { + if (modelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + onChanged(); + } else { + modelBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public Builder setModel(com.google.cloud.automl.v1.Model.Builder builderForValue) { + if (modelBuilder_ == null) { + model_ = builderForValue.build(); + onChanged(); + } else { + modelBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public Builder mergeModel(com.google.cloud.automl.v1.Model value) { + if (modelBuilder_ == null) { + if (model_ != null) { + model_ = + com.google.cloud.automl.v1.Model.newBuilder(model_).mergeFrom(value).buildPartial(); + } else { + model_ = value; + } + onChanged(); + } else { + modelBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public Builder clearModel() { + if (modelBuilder_ == null) { + model_ = null; + onChanged(); + } else { + model_ = null; + modelBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public com.google.cloud.automl.v1.Model.Builder getModelBuilder() { + + onChanged(); + return getModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + public com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder() { + if (modelBuilder_ != null) { + return modelBuilder_.getMessageOrBuilder(); + } else { + return model_ == null ? com.google.cloud.automl.v1.Model.getDefaultInstance() : model_; + } + } + /** + * + * + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder> + getModelFieldBuilder() { + if (modelBuilder_ == null) { + modelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder>( + getModel(), getParentForChildren(), isClean()); + model_ = null; + } + return modelBuilder_; + } + + @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.CreateModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.CreateModelRequest) + private static final com.google.cloud.automl.v1.CreateModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.CreateModelRequest(); + } + + public static com.google.cloud.automl.v1.CreateModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateModelRequest(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.CreateModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelRequestOrBuilder.java new file mode 100644 index 000000000..7f8c4d418 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateModelRequestOrBuilder.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 CreateModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.CreateModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the parent project where the model is being created.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the parent project where the model is being created.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + boolean hasModel(); + /** + * + * + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + com.google.cloud.automl.v1.Model getModel(); + /** + * + * + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 4; + */ + com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder(); +} 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 new file mode 100644 index 000000000..b640c623e --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DataItems.java @@ -0,0 +1,104 @@ +/* + * 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 final class DataItems { + private DataItems() {} + + 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_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_ExamplePayload_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ExamplePayload_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/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" + + "pet\030\002 \001(\0132#.google.cloud.automl.v1.TextS" + + "nippetH\000B\t\n\007payloadB\252\001\n\032com.google.cloud" + + ".automl.v1P\001Z + * A workspace for solving a single, particular machine learning (ML) problem. + * A workspace contains examples that may be annotated. + * + * + * Protobuf type {@code google.cloud.automl.v1.Dataset} + */ +public final class Dataset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.Dataset) + DatasetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Dataset.newBuilder() to construct. + private Dataset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Dataset() { + name_ = ""; + displayName_ = ""; + description_ = ""; + etag_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Dataset( + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 114: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 168: + { + exampleCount_ = input.readInt32(); + break; + } + case 186: + { + com.google.cloud.automl.v1.TranslationDatasetMetadata.Builder subBuilder = null; + if (datasetMetadataCase_ == 23) { + subBuilder = + ((com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_) + .toBuilder(); + } + datasetMetadata_ = + input.readMessage( + com.google.cloud.automl.v1.TranslationDatasetMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_); + datasetMetadata_ = subBuilder.buildPartial(); + } + datasetMetadataCase_ = 23; + break; + } + case 314: + { + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000080; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.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.DatasetOuterClass + .internal_static_google_cloud_automl_v1_Dataset_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 39: + return internalGetLabels(); + 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.DatasetOuterClass + .internal_static_google_cloud_automl_v1_Dataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Dataset.class, + com.google.cloud.automl.v1.Dataset.Builder.class); + } + + private int bitField0_; + private int datasetMetadataCase_ = 0; + private java.lang.Object datasetMetadata_; + + public enum DatasetMetadataCase implements com.google.protobuf.Internal.EnumLite { + TRANSLATION_DATASET_METADATA(23), + DATASETMETADATA_NOT_SET(0); + private final int value; + + private DatasetMetadataCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DatasetMetadataCase valueOf(int value) { + return forNumber(value); + } + + public static DatasetMetadataCase forNumber(int value) { + switch (value) { + case 23: + return TRANSLATION_DATASET_METADATA; + case 0: + return DATASETMETADATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DatasetMetadataCase getDatasetMetadataCase() { + return DatasetMetadataCase.forNumber(datasetMetadataCase_); + } + + public static final int TRANSLATION_DATASET_METADATA_FIELD_NUMBER = 23; + /** + * + * + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public boolean hasTranslationDatasetMetadata() { + return datasetMetadataCase_ == 23; + } + /** + * + * + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public com.google.cloud.automl.v1.TranslationDatasetMetadata getTranslationDatasetMetadata() { + if (datasetMetadataCase_ == 23) { + return (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public com.google.cloud.automl.v1.TranslationDatasetMetadataOrBuilder + getTranslationDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 23) { + return (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the dataset.
+   * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_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. The resource name of the dataset.
+   * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_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 dataset to show in the interface. The name can 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.
+   * 
+ * + * 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 dataset to show in the interface. The name can 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.
+   * 
+ * + * 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 DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * User-provided description of the dataset. The description can be up to
+   * 25000 characters long.
+   * 
+ * + * string description = 3; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * User-provided description of the dataset. The description can be up to
+   * 25000 characters long.
+   * 
+ * + * string description = 3; + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXAMPLE_COUNT_FIELD_NUMBER = 21; + private int exampleCount_; + /** + * + * + *
+   * Output only. The number of examples in the dataset.
+   * 
+ * + * int32 example_count = 21; + */ + public int getExampleCount() { + return exampleCount_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 14; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when this dataset was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when this dataset was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Timestamp when this dataset was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int ETAG_FIELD_NUMBER = 17; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Used to perform consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 17; + */ + 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 consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 17; + */ + 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 = 39; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.automl.v1.DatasetOuterClass + .internal_static_google_cloud_automl_v1_Dataset_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (createTime_ != null) { + output.writeMessage(14, getCreateTime()); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, etag_); + } + if (exampleCount_ != 0) { + output.writeInt32(21, exampleCount_); + } + if (datasetMetadataCase_ == 23) { + output.writeMessage( + 23, (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 39); + 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 (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getCreateTime()); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, etag_); + } + if (exampleCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(21, exampleCount_); + } + if (datasetMetadataCase_ == 23) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 23, (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_); + } + 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(39, labels__); + } + 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.Dataset)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.Dataset other = (com.google.cloud.automl.v1.Dataset) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getExampleCount() != other.getExampleCount()) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getDatasetMetadataCase().equals(other.getDatasetMetadataCase())) return false; + switch (datasetMetadataCase_) { + case 23: + if (!getTranslationDatasetMetadata().equals(other.getTranslationDatasetMetadata())) + 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(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + EXAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getExampleCount(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + 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(); + } + switch (datasetMetadataCase_) { + case 23: + hash = (37 * hash) + TRANSLATION_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTranslationDatasetMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.Dataset parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Dataset 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.Dataset parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Dataset 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.Dataset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Dataset 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.Dataset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Dataset 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.Dataset parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Dataset 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.Dataset 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.Dataset 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.Dataset 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 workspace for solving a single, particular machine learning (ML) problem.
+   * A workspace contains examples that may be annotated.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.Dataset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.Dataset) + com.google.cloud.automl.v1.DatasetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DatasetOuterClass + .internal_static_google_cloud_automl_v1_Dataset_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 39: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 39: + return internalGetMutableLabels(); + 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.DatasetOuterClass + .internal_static_google_cloud_automl_v1_Dataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Dataset.class, + com.google.cloud.automl.v1.Dataset.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.Dataset.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_ = ""; + + description_ = ""; + + exampleCount_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + etag_ = ""; + + internalGetMutableLabels().clear(); + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.DatasetOuterClass + .internal_static_google_cloud_automl_v1_Dataset_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Dataset getDefaultInstanceForType() { + return com.google.cloud.automl.v1.Dataset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.Dataset build() { + com.google.cloud.automl.v1.Dataset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Dataset buildPartial() { + com.google.cloud.automl.v1.Dataset result = new com.google.cloud.automl.v1.Dataset(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (datasetMetadataCase_ == 23) { + if (translationDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = translationDatasetMetadataBuilder_.build(); + } + } + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + result.exampleCount_ = exampleCount_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.etag_ = etag_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.bitField0_ = to_bitField0_; + result.datasetMetadataCase_ = datasetMetadataCase_; + 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.Dataset) { + return mergeFrom((com.google.cloud.automl.v1.Dataset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.Dataset other) { + if (other == com.google.cloud.automl.v1.Dataset.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.getExampleCount() != 0) { + setExampleCount(other.getExampleCount()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + switch (other.getDatasetMetadataCase()) { + case TRANSLATION_DATASET_METADATA: + { + mergeTranslationDatasetMetadata(other.getTranslationDatasetMetadata()); + break; + } + case DATASETMETADATA_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.Dataset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.Dataset) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int datasetMetadataCase_ = 0; + private java.lang.Object datasetMetadata_; + + public DatasetMetadataCase getDatasetMetadataCase() { + return DatasetMetadataCase.forNumber(datasetMetadataCase_); + } + + public Builder clearDatasetMetadata() { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationDatasetMetadata, + com.google.cloud.automl.v1.TranslationDatasetMetadata.Builder, + com.google.cloud.automl.v1.TranslationDatasetMetadataOrBuilder> + translationDatasetMetadataBuilder_; + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public boolean hasTranslationDatasetMetadata() { + return datasetMetadataCase_ == 23; + } + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public com.google.cloud.automl.v1.TranslationDatasetMetadata getTranslationDatasetMetadata() { + if (translationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 23) { + return (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 23) { + return translationDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public Builder setTranslationDatasetMetadata( + com.google.cloud.automl.v1.TranslationDatasetMetadata value) { + if (translationDatasetMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetMetadata_ = value; + onChanged(); + } else { + translationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 23; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public Builder setTranslationDatasetMetadata( + com.google.cloud.automl.v1.TranslationDatasetMetadata.Builder builderForValue) { + if (translationDatasetMetadataBuilder_ == null) { + datasetMetadata_ = builderForValue.build(); + onChanged(); + } else { + translationDatasetMetadataBuilder_.setMessage(builderForValue.build()); + } + datasetMetadataCase_ = 23; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public Builder mergeTranslationDatasetMetadata( + com.google.cloud.automl.v1.TranslationDatasetMetadata value) { + if (translationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 23 + && datasetMetadata_ + != com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance()) { + datasetMetadata_ = + com.google.cloud.automl.v1.TranslationDatasetMetadata.newBuilder( + (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + datasetMetadata_ = value; + } + onChanged(); + } else { + if (datasetMetadataCase_ == 23) { + translationDatasetMetadataBuilder_.mergeFrom(value); + } + translationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 23; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public Builder clearTranslationDatasetMetadata() { + if (translationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 23) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + } + } else { + if (datasetMetadataCase_ == 23) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + } + translationDatasetMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public com.google.cloud.automl.v1.TranslationDatasetMetadata.Builder + getTranslationDatasetMetadataBuilder() { + return getTranslationDatasetMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + public com.google.cloud.automl.v1.TranslationDatasetMetadataOrBuilder + getTranslationDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 23) && (translationDatasetMetadataBuilder_ != null)) { + return translationDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 23) { + return (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationDatasetMetadata, + com.google.cloud.automl.v1.TranslationDatasetMetadata.Builder, + com.google.cloud.automl.v1.TranslationDatasetMetadataOrBuilder> + getTranslationDatasetMetadataFieldBuilder() { + if (translationDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 23)) { + datasetMetadata_ = + com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance(); + } + translationDatasetMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationDatasetMetadata, + com.google.cloud.automl.v1.TranslationDatasetMetadata.Builder, + com.google.cloud.automl.v1.TranslationDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 23; + onChanged(); + ; + return translationDatasetMetadataBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the dataset.
+     * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_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. The resource name of the dataset.
+     * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_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. The resource name of the dataset.
+     * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the dataset.
+     * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the dataset.
+     * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_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 dataset to show in the interface. The name can 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.
+     * 
+ * + * 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 dataset to show in the interface. The name can 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.
+     * 
+ * + * 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 dataset to show in the interface. The name can 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.
+     * 
+ * + * 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 dataset to show in the interface. The name can 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.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the dataset to show in the interface. The name can 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.
+     * 
+ * + * 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 java.lang.Object description_ = ""; + /** + * + * + *
+     * User-provided description of the dataset. The description can be up to
+     * 25000 characters long.
+     * 
+ * + * string description = 3; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User-provided description of the dataset. The description can be up to
+     * 25000 characters long.
+     * 
+ * + * string description = 3; + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User-provided description of the dataset. The description can be up to
+     * 25000 characters long.
+     * 
+ * + * string description = 3; + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of the dataset. The description can be up to
+     * 25000 characters long.
+     * 
+ * + * string description = 3; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of the dataset. The description can be up to
+     * 25000 characters long.
+     * 
+ * + * string description = 3; + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private int exampleCount_; + /** + * + * + *
+     * Output only. The number of examples in the dataset.
+     * 
+ * + * int32 example_count = 21; + */ + public int getExampleCount() { + return exampleCount_; + } + /** + * + * + *
+     * Output only. The number of examples in the dataset.
+     * 
+ * + * int32 example_count = 21; + */ + public Builder setExampleCount(int value) { + + exampleCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of examples in the dataset.
+     * 
+ * + * int32 example_count = 21; + */ + public Builder clearExampleCount() { + + exampleCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when this dataset was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Used to perform consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 17; + */ + 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 consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 17; + */ + 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 consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 17; + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Used to perform consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 17; + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Used to perform consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 17; + */ + 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() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your dataset.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 39; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your dataset.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 39; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your dataset.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 39; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your dataset.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 39; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your dataset.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 39; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your dataset.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 39; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your dataset.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 39; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().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.Dataset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.Dataset) + private static final com.google.cloud.automl.v1.Dataset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.Dataset(); + } + + public static com.google.cloud.automl.v1.Dataset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Dataset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Dataset(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.Dataset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetName.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetName.java new file mode 100644 index 000000000..8f218f826 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetName.java @@ -0,0 +1,210 @@ +/* + * 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 DatasetName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/datasets/{dataset}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String dataset; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataset() { + return dataset; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private DatasetName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataset = Preconditions.checkNotNull(builder.getDataset()); + } + + public static DatasetName of(String project, String location, String dataset) { + return newBuilder().setProject(project).setLocation(location).setDataset(dataset).build(); + } + + public static String format(String project, String location, String dataset) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataset(dataset) + .build() + .toString(); + } + + public static DatasetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "DatasetName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("dataset")); + } + + 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 (DatasetName 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); + 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); + } + + /** Builder for DatasetName. */ + public static class Builder { + + private String project; + private String location; + private String dataset; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataset() { + return dataset; + } + + 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; + } + + private Builder() {} + + private Builder(DatasetName datasetName) { + project = datasetName.project; + location = datasetName.location; + dataset = datasetName.dataset; + } + + public DatasetName build() { + return new DatasetName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DatasetName) { + DatasetName that = (DatasetName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.dataset.equals(that.dataset)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= dataset.hashCode(); + return h; + } +} 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 new file mode 100644 index 000000000..ffc9cb73c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOrBuilder.java @@ -0,0 +1,279 @@ +/* + * 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/dataset.proto + +package com.google.cloud.automl.v1; + +public interface DatasetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.Dataset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + boolean hasTranslationDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + com.google.cloud.automl.v1.TranslationDatasetMetadata getTranslationDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * + */ + com.google.cloud.automl.v1.TranslationDatasetMetadataOrBuilder + getTranslationDatasetMetadataOrBuilder(); + + /** + * + * + *
+   * Output only. The resource name of the dataset.
+   * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the dataset.
+   * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The name of the dataset to show in the interface. The name can 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.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The name of the dataset to show in the interface. The name can 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.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * User-provided description of the dataset. The description can be up to
+   * 25000 characters long.
+   * 
+ * + * string description = 3; + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User-provided description of the dataset. The description can be up to
+   * 25000 characters long.
+   * 
+ * + * string description = 3; + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The number of examples in the dataset.
+   * 
+ * + * int32 example_count = 21; + */ + int getExampleCount(); + + /** + * + * + *
+   * Output only. Timestamp when this dataset was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when this dataset was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when this dataset was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Used to perform consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 17; + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Used to perform consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 17; + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your dataset.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 39; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + public com.google.cloud.automl.v1.Dataset.DatasetMetadataCase getDatasetMetadataCase(); +} 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 new file mode 100644 index 000000000..586d8a4b0 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOuterClass.java @@ -0,0 +1,113 @@ +/* + * 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/dataset.proto + +package com.google.cloud.automl.v1; + +public final class DatasetOuterClass { + private DatasetOuterClass() {} + + 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_Dataset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_Dataset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_Dataset_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_Dataset_LabelsEntry_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/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 + * Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1.AutoMl.DeleteDataset]. + * + * + * Protobuf type {@code google.cloud.automl.v1.DeleteDatasetRequest} + */ +public final class DeleteDatasetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.DeleteDatasetRequest) + DeleteDatasetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDatasetRequest.newBuilder() to construct. + private DeleteDatasetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDatasetRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteDatasetRequest( + 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_DeleteDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeleteDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeleteDatasetRequest.class, + com.google.cloud.automl.v1.DeleteDatasetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the dataset to delete.
+   * 
+ * + * 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 dataset to delete.
+   * 
+ * + * 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.DeleteDatasetRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.DeleteDatasetRequest other = + (com.google.cloud.automl.v1.DeleteDatasetRequest) 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.DeleteDatasetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteDatasetRequest 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.DeleteDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteDatasetRequest 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.DeleteDatasetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteDatasetRequest 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.DeleteDatasetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeleteDatasetRequest 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.DeleteDatasetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeleteDatasetRequest 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.DeleteDatasetRequest 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.DeleteDatasetRequest 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.DeleteDatasetRequest 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.DeleteDataset][google.cloud.automl.v1.AutoMl.DeleteDataset].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DeleteDatasetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.DeleteDatasetRequest) + com.google.cloud.automl.v1.DeleteDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeleteDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeleteDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeleteDatasetRequest.class, + com.google.cloud.automl.v1.DeleteDatasetRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.DeleteDatasetRequest.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_DeleteDatasetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteDatasetRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.DeleteDatasetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteDatasetRequest build() { + com.google.cloud.automl.v1.DeleteDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteDatasetRequest buildPartial() { + com.google.cloud.automl.v1.DeleteDatasetRequest result = + new com.google.cloud.automl.v1.DeleteDatasetRequest(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.DeleteDatasetRequest) { + return mergeFrom((com.google.cloud.automl.v1.DeleteDatasetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.DeleteDatasetRequest other) { + if (other == com.google.cloud.automl.v1.DeleteDatasetRequest.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.DeleteDatasetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.DeleteDatasetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the dataset to delete.
+     * 
+ * + * 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 dataset to delete.
+     * 
+ * + * 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 dataset to delete.
+     * 
+ * + * 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 dataset to delete.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the dataset to delete.
+     * 
+ * + * 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.DeleteDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DeleteDatasetRequest) + private static final com.google.cloud.automl.v1.DeleteDatasetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.DeleteDatasetRequest(); + } + + public static com.google.cloud.automl.v1.DeleteDatasetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDatasetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteDatasetRequest(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.DeleteDatasetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteDatasetRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteDatasetRequestOrBuilder.java new file mode 100644 index 000000000..26d5c5f19 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteDatasetRequestOrBuilder.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 DeleteDatasetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.DeleteDatasetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the dataset to delete.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the dataset to delete.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteModelRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteModelRequest.java new file mode 100644 index 000000000..68383877c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteModelRequest.java @@ -0,0 +1,611 @@ +/* + * 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.DeleteModel][google.cloud.automl.v1.AutoMl.DeleteModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DeleteModelRequest} + */ +public final class DeleteModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.DeleteModelRequest) + DeleteModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteModelRequest.newBuilder() to construct. + private DeleteModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteModelRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteModelRequest( + 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_DeleteModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeleteModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeleteModelRequest.class, + com.google.cloud.automl.v1.DeleteModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name of the model being deleted.
+   * 
+ * + * 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 being deleted.
+   * 
+ * + * 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.DeleteModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.DeleteModelRequest other = + (com.google.cloud.automl.v1.DeleteModelRequest) 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.DeleteModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteModelRequest 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.DeleteModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteModelRequest 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.DeleteModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteModelRequest 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.DeleteModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeleteModelRequest 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.DeleteModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeleteModelRequest 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.DeleteModelRequest 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.DeleteModelRequest 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.DeleteModelRequest 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.DeleteModel][google.cloud.automl.v1.AutoMl.DeleteModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DeleteModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.DeleteModelRequest) + com.google.cloud.automl.v1.DeleteModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeleteModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeleteModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeleteModelRequest.class, + com.google.cloud.automl.v1.DeleteModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.DeleteModelRequest.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_DeleteModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.DeleteModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteModelRequest build() { + com.google.cloud.automl.v1.DeleteModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteModelRequest buildPartial() { + com.google.cloud.automl.v1.DeleteModelRequest result = + new com.google.cloud.automl.v1.DeleteModelRequest(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.DeleteModelRequest) { + return mergeFrom((com.google.cloud.automl.v1.DeleteModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.DeleteModelRequest other) { + if (other == com.google.cloud.automl.v1.DeleteModelRequest.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.DeleteModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.DeleteModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name of the model being deleted.
+     * 
+ * + * 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 being deleted.
+     * 
+ * + * 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 being deleted.
+     * 
+ * + * 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 being deleted.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the model being deleted.
+     * 
+ * + * 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.DeleteModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DeleteModelRequest) + private static final com.google.cloud.automl.v1.DeleteModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.DeleteModelRequest(); + } + + public static com.google.cloud.automl.v1.DeleteModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteModelRequest(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.DeleteModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteModelRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteModelRequestOrBuilder.java new file mode 100644 index 000000000..a195ac92f --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteModelRequestOrBuilder.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 DeleteModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.DeleteModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the model being deleted.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of the model being deleted.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteOperationMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteOperationMetadata.java new file mode 100644 index 000000000..d82896026 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteOperationMetadata.java @@ -0,0 +1,450 @@ +/* + * 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 operations that perform deletes of any entities.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DeleteOperationMetadata} + */ +public final class DeleteOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.DeleteOperationMetadata) + DeleteOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteOperationMetadata.newBuilder() to construct. + private DeleteOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteOperationMetadata( + 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_DeleteOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_DeleteOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeleteOperationMetadata.class, + com.google.cloud.automl.v1.DeleteOperationMetadata.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.DeleteOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.DeleteOperationMetadata other = + (com.google.cloud.automl.v1.DeleteOperationMetadata) 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.DeleteOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteOperationMetadata 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.DeleteOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteOperationMetadata 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.DeleteOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeleteOperationMetadata 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.DeleteOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeleteOperationMetadata 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.DeleteOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeleteOperationMetadata 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.DeleteOperationMetadata 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.DeleteOperationMetadata 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.DeleteOperationMetadata 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 operations that perform deletes of any entities.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DeleteOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.DeleteOperationMetadata) + com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_DeleteOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_DeleteOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeleteOperationMetadata.class, + com.google.cloud.automl.v1.DeleteOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.DeleteOperationMetadata.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_DeleteOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteOperationMetadata build() { + com.google.cloud.automl.v1.DeleteOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeleteOperationMetadata buildPartial() { + com.google.cloud.automl.v1.DeleteOperationMetadata result = + new com.google.cloud.automl.v1.DeleteOperationMetadata(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.DeleteOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.DeleteOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.DeleteOperationMetadata other) { + if (other == com.google.cloud.automl.v1.DeleteOperationMetadata.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.DeleteOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.DeleteOperationMetadata) 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.DeleteOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DeleteOperationMetadata) + private static final com.google.cloud.automl.v1.DeleteOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.DeleteOperationMetadata(); + } + + public static com.google.cloud.automl.v1.DeleteOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteOperationMetadata(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.DeleteOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteOperationMetadataOrBuilder.java new file mode 100644 index 000000000..d9d747638 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeleteOperationMetadataOrBuilder.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 DeleteOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.DeleteOperationMetadata) + com.google.protobuf.MessageOrBuilder {} 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 new file mode 100644 index 000000000..29b2b6112 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayload.java @@ -0,0 +1,806 @@ +/* + * 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; + +/** + * + * + *
+ * Example data used for training or prediction.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExamplePayload} + */ +public final class ExamplePayload extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ExamplePayload) + ExamplePayloadOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExamplePayload.newBuilder() to construct. + private ExamplePayload(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExamplePayload() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExamplePayload( + 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.TextSnippet.Builder subBuilder = null; + if (payloadCase_ == 2) { + subBuilder = ((com.google.cloud.automl.v1.TextSnippet) payload_).toBuilder(); + } + payload_ = + input.readMessage( + com.google.cloud.automl.v1.TextSnippet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.TextSnippet) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 2; + 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_ExamplePayload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_ExamplePayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExamplePayload.class, + com.google.cloud.automl.v1.ExamplePayload.Builder.class); + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public enum PayloadCase implements com.google.protobuf.Internal.EnumLite { + TEXT_SNIPPET(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 2: + return TEXT_SNIPPET; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int TEXT_SNIPPET_FIELD_NUMBER = 2; + /** + * + * + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public boolean hasTextSnippet() { + return payloadCase_ == 2; + } + /** + * + * + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1.TextSnippet getTextSnippet() { + if (payloadCase_ == 2) { + return (com.google.cloud.automl.v1.TextSnippet) payload_; + } + return com.google.cloud.automl.v1.TextSnippet.getDefaultInstance(); + } + /** + * + * + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1.TextSnippetOrBuilder getTextSnippetOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.cloud.automl.v1.TextSnippet) payload_; + } + return com.google.cloud.automl.v1.TextSnippet.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 (payloadCase_ == 2) { + output.writeMessage(2, (com.google.cloud.automl.v1.TextSnippet) payload_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.automl.v1.TextSnippet) payload_); + } + 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.ExamplePayload)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ExamplePayload other = + (com.google.cloud.automl.v1.ExamplePayload) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 2: + if (!getTextSnippet().equals(other.getTextSnippet())) 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 (payloadCase_) { + case 2: + hash = (37 * hash) + TEXT_SNIPPET_FIELD_NUMBER; + hash = (53 * hash) + getTextSnippet().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ExamplePayload parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExamplePayload 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.ExamplePayload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExamplePayload 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.ExamplePayload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExamplePayload 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.ExamplePayload parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExamplePayload 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.ExamplePayload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExamplePayload 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.ExamplePayload 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.ExamplePayload 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.ExamplePayload 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; + } + /** + * + * + *
+   * Example data used for training or prediction.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExamplePayload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ExamplePayload) + com.google.cloud.automl.v1.ExamplePayloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_ExamplePayload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_ExamplePayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExamplePayload.class, + com.google.cloud.automl.v1.ExamplePayload.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ExamplePayload.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(); + payloadCase_ = 0; + payload_ = 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_ExamplePayload_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExamplePayload getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExamplePayload build() { + com.google.cloud.automl.v1.ExamplePayload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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_ == 2) { + if (textSnippetBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = textSnippetBuilder_.build(); + } + } + result.payloadCase_ = payloadCase_; + 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.ExamplePayload) { + return mergeFrom((com.google.cloud.automl.v1.ExamplePayload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + 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 TEXT_SNIPPET: + { + mergeTextSnippet(other.getTextSnippet()); + break; + } + case PAYLOAD_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.ExamplePayload parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ExamplePayload) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSnippet, + com.google.cloud.automl.v1.TextSnippet.Builder, + com.google.cloud.automl.v1.TextSnippetOrBuilder> + textSnippetBuilder_; + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public boolean hasTextSnippet() { + return payloadCase_ == 2; + } + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1.TextSnippet getTextSnippet() { + if (textSnippetBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.cloud.automl.v1.TextSnippet) payload_; + } + return com.google.cloud.automl.v1.TextSnippet.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return textSnippetBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextSnippet.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public Builder setTextSnippet(com.google.cloud.automl.v1.TextSnippet value) { + if (textSnippetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + textSnippetBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public Builder setTextSnippet(com.google.cloud.automl.v1.TextSnippet.Builder builderForValue) { + if (textSnippetBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + textSnippetBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public Builder mergeTextSnippet(com.google.cloud.automl.v1.TextSnippet value) { + if (textSnippetBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.cloud.automl.v1.TextSnippet.getDefaultInstance()) { + payload_ = + com.google.cloud.automl.v1.TextSnippet.newBuilder( + (com.google.cloud.automl.v1.TextSnippet) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + textSnippetBuilder_.mergeFrom(value); + } + textSnippetBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public Builder clearTextSnippet() { + if (textSnippetBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + textSnippetBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1.TextSnippet.Builder getTextSnippetBuilder() { + return getTextSnippetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1.TextSnippetOrBuilder getTextSnippetOrBuilder() { + if ((payloadCase_ == 2) && (textSnippetBuilder_ != null)) { + return textSnippetBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.cloud.automl.v1.TextSnippet) payload_; + } + return com.google.cloud.automl.v1.TextSnippet.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 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> + getTextSnippetFieldBuilder() { + if (textSnippetBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.cloud.automl.v1.TextSnippet.getDefaultInstance(); + } + textSnippetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSnippet, + com.google.cloud.automl.v1.TextSnippet.Builder, + com.google.cloud.automl.v1.TextSnippetOrBuilder>( + (com.google.cloud.automl.v1.TextSnippet) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + ; + return textSnippetBuilder_; + } + + @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.ExamplePayload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExamplePayload) + private static final com.google.cloud.automl.v1.ExamplePayload DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ExamplePayload(); + } + + public static com.google.cloud.automl.v1.ExamplePayload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExamplePayload parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExamplePayload(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.ExamplePayload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..d9f207ac1 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayloadOrBuilder.java @@ -0,0 +1,58 @@ +/* + * 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 ExamplePayloadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ExamplePayload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + boolean hasTextSnippet(); + /** + * + * + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + com.google.cloud.automl.v1.TextSnippet getTextSnippet(); + /** + * + * + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet text_snippet = 2; + */ + com.google.cloud.automl.v1.TextSnippetOrBuilder getTextSnippetOrBuilder(); + + 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/ExportDataRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataRequest.java new file mode 100644 index 000000000..e7692ef2a --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataRequest.java @@ -0,0 +1,878 @@ +/* + * 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.ExportData][google.cloud.automl.v1.AutoMl.ExportData].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportDataRequest} + */ +public final class ExportDataRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ExportDataRequest) + ExportDataRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportDataRequest.newBuilder() to construct. + private ExportDataRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportDataRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportDataRequest( + 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.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.automl.v1.OutputConfig.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_ExportDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ExportDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportDataRequest.class, + com.google.cloud.automl.v1.ExportDataRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the dataset.
+   * 
+ * + * 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 dataset.
+   * 
+ * + * 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.OutputConfig outputConfig_; + /** + * + * + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.automl.v1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.OutputConfigOrBuilder 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.ExportDataRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ExportDataRequest other = + (com.google.cloud.automl.v1.ExportDataRequest) 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.ExportDataRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataRequest 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.ExportDataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataRequest 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.ExportDataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataRequest 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.ExportDataRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportDataRequest 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.ExportDataRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportDataRequest 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.ExportDataRequest 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.ExportDataRequest 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.ExportDataRequest 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.ExportData][google.cloud.automl.v1.AutoMl.ExportData].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportDataRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ExportDataRequest) + com.google.cloud.automl.v1.ExportDataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ExportDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ExportDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportDataRequest.class, + com.google.cloud.automl.v1.ExportDataRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ExportDataRequest.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_ExportDataRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ExportDataRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataRequest build() { + com.google.cloud.automl.v1.ExportDataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataRequest buildPartial() { + com.google.cloud.automl.v1.ExportDataRequest result = + new com.google.cloud.automl.v1.ExportDataRequest(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.ExportDataRequest) { + return mergeFrom((com.google.cloud.automl.v1.ExportDataRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ExportDataRequest other) { + if (other == com.google.cloud.automl.v1.ExportDataRequest.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.ExportDataRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ExportDataRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the dataset.
+     * 
+ * + * 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 dataset.
+     * 
+ * + * 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 dataset.
+     * 
+ * + * 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 dataset.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the dataset.
+     * 
+ * + * 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.OutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.OutputConfig, + com.google.cloud.automl.v1.OutputConfig.Builder, + com.google.cloud.automl.v1.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.automl.v1.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public Builder setOutputConfig(com.google.cloud.automl.v1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public Builder setOutputConfig( + com.google.cloud.automl.v1.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public Builder mergeOutputConfig(com.google.cloud.automl.v1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.automl.v1.OutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.automl.v1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.OutputConfig, + com.google.cloud.automl.v1.OutputConfig.Builder, + com.google.cloud.automl.v1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.OutputConfig, + com.google.cloud.automl.v1.OutputConfig.Builder, + com.google.cloud.automl.v1.OutputConfigOrBuilder>( + 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.ExportDataRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExportDataRequest) + private static final com.google.cloud.automl.v1.ExportDataRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ExportDataRequest(); + } + + public static com.google.cloud.automl.v1.ExportDataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportDataRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportDataRequest(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.ExportDataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataRequestOrBuilder.java new file mode 100644 index 000000000..664130fc9 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataRequestOrBuilder.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 ExportDataRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ExportDataRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the dataset.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the dataset.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + com.google.cloud.automl.v1.OutputConfig getOutputConfig(); + /** + * + * + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1.OutputConfig output_config = 3; + */ + com.google.cloud.automl.v1.OutputConfigOrBuilder 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 new file mode 100644 index 000000000..39a56bef1 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestination.java @@ -0,0 +1,646 @@ +/* + * 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; + +/** + * + * + *
+ * The Google Cloud Storage location where the output is to be written to.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GcsDestination} + */ +public final class GcsDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.GcsDestination) + GcsDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsDestination.newBuilder() to construct. + private GcsDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsDestination() { + outputUriPrefix_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GcsDestination( + 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(); + + outputUriPrefix_ = 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_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GcsDestination.class, + com.google.cloud.automl.v1.GcsDestination.Builder.class); + } + + public static final int OUTPUT_URI_PREFIX_FIELD_NUMBER = 1; + private volatile java.lang.Object outputUriPrefix_; + /** + * + * + *
+   * Required. Google Cloud Storage URI to output directory, up to 2000
+   * characters long.
+   * Accepted forms:
+   * * 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; + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + 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(); + outputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Google Cloud Storage URI to output directory, up to 2000
+   * characters long.
+   * Accepted forms:
+   * * 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; + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = 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 (!getOutputUriPrefixBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputUriPrefix_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOutputUriPrefixBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputUriPrefix_); + } + 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.GcsDestination)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.GcsDestination other = + (com.google.cloud.automl.v1.GcsDestination) obj; + + if (!getOutputUriPrefix().equals(other.getOutputUriPrefix())) 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) + OUTPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUriPrefix().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.GcsDestination parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GcsDestination 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.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GcsDestination 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.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GcsDestination 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.GcsDestination parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GcsDestination 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.GcsDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GcsDestination 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.GcsDestination 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.GcsDestination 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.GcsDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GcsDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.GcsDestination) + com.google.cloud.automl.v1.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GcsDestination.class, + com.google.cloud.automl.v1.GcsDestination.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.GcsDestination.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(); + outputUriPrefix_ = ""; + + 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_GcsDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GcsDestination getDefaultInstanceForType() { + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.GcsDestination build() { + com.google.cloud.automl.v1.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GcsDestination buildPartial() { + com.google.cloud.automl.v1.GcsDestination result = + new com.google.cloud.automl.v1.GcsDestination(this); + result.outputUriPrefix_ = outputUriPrefix_; + 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.GcsDestination) { + return mergeFrom((com.google.cloud.automl.v1.GcsDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.GcsDestination other) { + if (other == com.google.cloud.automl.v1.GcsDestination.getDefaultInstance()) return this; + if (!other.getOutputUriPrefix().isEmpty()) { + outputUriPrefix_ = other.outputUriPrefix_; + 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.GcsDestination parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.GcsDestination) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory, up to 2000
+     * characters long.
+     * Accepted forms:
+     * * 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; + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory, up to 2000
+     * characters long.
+     * Accepted forms:
+     * * 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; + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory, up to 2000
+     * characters long.
+     * Accepted forms:
+     * * 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; + */ + public Builder setOutputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputUriPrefix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory, up to 2000
+     * characters long.
+     * Accepted forms:
+     * * 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; + */ + public Builder clearOutputUriPrefix() { + + outputUriPrefix_ = getDefaultInstance().getOutputUriPrefix(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory, up to 2000
+     * characters long.
+     * Accepted forms:
+     * * 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; + */ + public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputUriPrefix_ = 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.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GcsDestination) + private static final com.google.cloud.automl.v1.GcsDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.GcsDestination(); + } + + public static com.google.cloud.automl.v1.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsDestination(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.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..b09adc6b1 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestinationOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 GcsDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.GcsDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage URI to output directory, up to 2000
+   * characters long.
+   * Accepted forms:
+   * * 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; + */ + java.lang.String getOutputUriPrefix(); + /** + * + * + *
+   * Required. Google Cloud Storage URI to output directory, up to 2000
+   * characters long.
+   * Accepted forms:
+   * * 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; + */ + 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 new file mode 100644 index 000000000..2d1bd829f --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSource.java @@ -0,0 +1,717 @@ +/* + * 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; + +/** + * + * + *
+ * The Google Cloud Storage location for the input content.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.GcsSource) + GcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsSource.newBuilder() to construct. + private GcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsSource() { + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GcsSource( + 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)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + inputUris_.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)) { + inputUris_ = inputUris_.getUnmodifiableView(); + } + 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_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GcsSource.class, + com.google.cloud.automl.v1.GcsSource.Builder.class); + } + + public static final int INPUT_URIS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList inputUris_; + /** + * + * + *
+   * 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; + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + return inputUris_; + } + /** + * + * + *
+   * 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; + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+   * 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; + */ + public java.lang.String getInputUris(int index) { + return inputUris_.get(index); + } + /** + * + * + *
+   * 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; + */ + public com.google.protobuf.ByteString getInputUrisBytes(int index) { + return inputUris_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < inputUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUris_.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 < inputUris_.size(); i++) { + dataSize += computeStringSizeNoTag(inputUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getInputUrisList().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.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.GcsSource other = (com.google.cloud.automl.v1.GcsSource) obj; + + if (!getInputUrisList().equals(other.getInputUrisList())) 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 (getInputUrisCount() > 0) { + hash = (37 * hash) + INPUT_URIS_FIELD_NUMBER; + hash = (53 * hash) + getInputUrisList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.GcsSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GcsSource 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.GcsSource parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GcsSource 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.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GcsSource 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.GcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GcsSource 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.GcsSource parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GcsSource 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.GcsSource 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.GcsSource 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.GcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location for the input content.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.GcsSource) + com.google.cloud.automl.v1.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GcsSource.class, + com.google.cloud.automl.v1.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.GcsSource.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(); + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + 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_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GcsSource getDefaultInstanceForType() { + return com.google.cloud.automl.v1.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.GcsSource build() { + com.google.cloud.automl.v1.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GcsSource buildPartial() { + com.google.cloud.automl.v1.GcsSource result = new com.google.cloud.automl.v1.GcsSource(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + inputUris_ = inputUris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inputUris_ = inputUris_; + 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.GcsSource) { + return mergeFrom((com.google.cloud.automl.v1.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.GcsSource other) { + if (other == com.google.cloud.automl.v1.GcsSource.getDefaultInstance()) return this; + if (!other.inputUris_.isEmpty()) { + if (inputUris_.isEmpty()) { + inputUris_ = other.inputUris_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInputUrisIsMutable(); + inputUris_.addAll(other.inputUris_); + } + 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.GcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.GcsSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList inputUris_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInputUrisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(inputUris_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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; + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + return inputUris_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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; + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+     * 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; + */ + public java.lang.String getInputUris(int index) { + return inputUris_.get(index); + } + /** + * + * + *
+     * 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; + */ + public com.google.protobuf.ByteString getInputUrisBytes(int index) { + return inputUris_.getByteString(index); + } + /** + * + * + *
+     * 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; + */ + public Builder setInputUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputUrisIsMutable(); + inputUris_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder addInputUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputUrisIsMutable(); + inputUris_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder addAllInputUris(java.lang.Iterable values) { + ensureInputUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputUris_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder clearInputUris() { + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder addInputUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInputUrisIsMutable(); + inputUris_.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.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GcsSource) + private static final com.google.cloud.automl.v1.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.GcsSource(); + } + + public static com.google.cloud.automl.v1.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsSource(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.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..9861792ca --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSourceOrBuilder.java @@ -0,0 +1,74 @@ +/* + * 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 GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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; + */ + java.util.List getInputUrisList(); + /** + * + * + *
+   * 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; + */ + int getInputUrisCount(); + /** + * + * + *
+   * 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; + */ + java.lang.String getInputUris(int index); + /** + * + * + *
+   * 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; + */ + com.google.protobuf.ByteString getInputUrisBytes(int index); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetDatasetRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetDatasetRequest.java new file mode 100644 index 000000000..aa2677ffe --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetDatasetRequest.java @@ -0,0 +1,611 @@ +/* + * 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.GetDataset][google.cloud.automl.v1.AutoMl.GetDataset].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GetDatasetRequest} + */ +public final class GetDatasetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.GetDatasetRequest) + GetDatasetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDatasetRequest.newBuilder() to construct. + private GetDatasetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDatasetRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDatasetRequest( + 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_GetDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GetDatasetRequest.class, + com.google.cloud.automl.v1.GetDatasetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the dataset 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 dataset 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.GetDatasetRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.GetDatasetRequest other = + (com.google.cloud.automl.v1.GetDatasetRequest) 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.GetDatasetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetDatasetRequest 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.GetDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetDatasetRequest 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.GetDatasetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetDatasetRequest 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.GetDatasetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetDatasetRequest 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.GetDatasetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetDatasetRequest 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.GetDatasetRequest 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.GetDatasetRequest 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.GetDatasetRequest 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.GetDataset][google.cloud.automl.v1.AutoMl.GetDataset].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GetDatasetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.GetDatasetRequest) + com.google.cloud.automl.v1.GetDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GetDatasetRequest.class, + com.google.cloud.automl.v1.GetDatasetRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.GetDatasetRequest.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_GetDatasetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetDatasetRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.GetDatasetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetDatasetRequest build() { + com.google.cloud.automl.v1.GetDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetDatasetRequest buildPartial() { + com.google.cloud.automl.v1.GetDatasetRequest result = + new com.google.cloud.automl.v1.GetDatasetRequest(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.GetDatasetRequest) { + return mergeFrom((com.google.cloud.automl.v1.GetDatasetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.GetDatasetRequest other) { + if (other == com.google.cloud.automl.v1.GetDatasetRequest.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.GetDatasetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.GetDatasetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the dataset 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 dataset 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 dataset 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 dataset to retrieve.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the dataset 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.GetDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GetDatasetRequest) + private static final com.google.cloud.automl.v1.GetDatasetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.GetDatasetRequest(); + } + + public static com.google.cloud.automl.v1.GetDatasetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDatasetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDatasetRequest(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.GetDatasetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetDatasetRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetDatasetRequestOrBuilder.java new file mode 100644 index 000000000..c9074aa8d --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetDatasetRequestOrBuilder.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 GetDatasetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.GetDatasetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the dataset to retrieve.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the dataset 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/GetModelEvaluationRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelEvaluationRequest.java new file mode 100644 index 000000000..f7a2f1467 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelEvaluationRequest.java @@ -0,0 +1,613 @@ +/* + * 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.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GetModelEvaluationRequest} + */ +public final class GetModelEvaluationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.GetModelEvaluationRequest) + GetModelEvaluationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetModelEvaluationRequest.newBuilder() to construct. + private GetModelEvaluationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetModelEvaluationRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetModelEvaluationRequest( + 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_GetModelEvaluationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetModelEvaluationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GetModelEvaluationRequest.class, + com.google.cloud.automl.v1.GetModelEvaluationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name for the model evaluation.
+   * 
+ * + * 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 for the model evaluation.
+   * 
+ * + * 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.GetModelEvaluationRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.GetModelEvaluationRequest other = + (com.google.cloud.automl.v1.GetModelEvaluationRequest) 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.GetModelEvaluationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetModelEvaluationRequest 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.GetModelEvaluationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetModelEvaluationRequest 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.GetModelEvaluationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetModelEvaluationRequest 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.GetModelEvaluationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetModelEvaluationRequest 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.GetModelEvaluationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetModelEvaluationRequest 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.GetModelEvaluationRequest 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.GetModelEvaluationRequest 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.GetModelEvaluationRequest 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.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GetModelEvaluationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.GetModelEvaluationRequest) + com.google.cloud.automl.v1.GetModelEvaluationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetModelEvaluationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetModelEvaluationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GetModelEvaluationRequest.class, + com.google.cloud.automl.v1.GetModelEvaluationRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.GetModelEvaluationRequest.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_GetModelEvaluationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetModelEvaluationRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.GetModelEvaluationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetModelEvaluationRequest build() { + com.google.cloud.automl.v1.GetModelEvaluationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetModelEvaluationRequest buildPartial() { + com.google.cloud.automl.v1.GetModelEvaluationRequest result = + new com.google.cloud.automl.v1.GetModelEvaluationRequest(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.GetModelEvaluationRequest) { + return mergeFrom((com.google.cloud.automl.v1.GetModelEvaluationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.GetModelEvaluationRequest other) { + if (other == com.google.cloud.automl.v1.GetModelEvaluationRequest.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.GetModelEvaluationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.GetModelEvaluationRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name for the model evaluation.
+     * 
+ * + * 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 for the model evaluation.
+     * 
+ * + * 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 for the model evaluation.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the model evaluation.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the model evaluation.
+     * 
+ * + * 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.GetModelEvaluationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GetModelEvaluationRequest) + private static final com.google.cloud.automl.v1.GetModelEvaluationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.GetModelEvaluationRequest(); + } + + public static com.google.cloud.automl.v1.GetModelEvaluationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetModelEvaluationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetModelEvaluationRequest(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.GetModelEvaluationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelEvaluationRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelEvaluationRequestOrBuilder.java new file mode 100644 index 000000000..403eec7f6 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelEvaluationRequestOrBuilder.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 GetModelEvaluationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.GetModelEvaluationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name for the model evaluation.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name for the model evaluation.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelRequest.java new file mode 100644 index 000000000..4910d68ab --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelRequest.java @@ -0,0 +1,611 @@ +/* + * 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.GetModel][google.cloud.automl.v1.AutoMl.GetModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GetModelRequest} + */ +public final class GetModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.GetModelRequest) + GetModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetModelRequest.newBuilder() to construct. + private GetModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetModelRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetModelRequest( + 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_GetModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GetModelRequest.class, + com.google.cloud.automl.v1.GetModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name of the model.
+   * 
+ * + * 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.
+   * 
+ * + * 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.GetModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.GetModelRequest other = + (com.google.cloud.automl.v1.GetModelRequest) 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.GetModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetModelRequest 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.GetModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetModelRequest 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.GetModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetModelRequest 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.GetModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetModelRequest 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.GetModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetModelRequest 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.GetModelRequest 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.GetModelRequest 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.GetModelRequest 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.GetModel][google.cloud.automl.v1.AutoMl.GetModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GetModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.GetModelRequest) + com.google.cloud.automl.v1.GetModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GetModelRequest.class, + com.google.cloud.automl.v1.GetModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.GetModelRequest.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_GetModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.GetModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetModelRequest build() { + com.google.cloud.automl.v1.GetModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetModelRequest buildPartial() { + com.google.cloud.automl.v1.GetModelRequest result = + new com.google.cloud.automl.v1.GetModelRequest(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.GetModelRequest) { + return mergeFrom((com.google.cloud.automl.v1.GetModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.GetModelRequest other) { + if (other == com.google.cloud.automl.v1.GetModelRequest.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.GetModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.GetModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name of the model.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the model.
+     * 
+ * + * 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.GetModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GetModelRequest) + private static final com.google.cloud.automl.v1.GetModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.GetModelRequest(); + } + + public static com.google.cloud.automl.v1.GetModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetModelRequest(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.GetModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelRequestOrBuilder.java new file mode 100644 index 000000000..90f79be17 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetModelRequestOrBuilder.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 GetModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.GetModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the model.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of the model.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataRequest.java new file mode 100644 index 000000000..637e8a053 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataRequest.java @@ -0,0 +1,896 @@ +/* + * 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.ImportData][google.cloud.automl.v1.AutoMl.ImportData].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImportDataRequest} + */ +public final class ImportDataRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImportDataRequest) + ImportDataRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportDataRequest.newBuilder() to construct. + private ImportDataRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportDataRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportDataRequest( + 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.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.automl.v1.InputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = 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_ImportDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ImportDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImportDataRequest.class, + com.google.cloud.automl.v1.ImportDataRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Dataset name. Dataset must already exist. All imported
+   * annotations and examples will be added.
+   * 
+ * + * 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. Dataset name. Dataset must already exist. All imported
+   * annotations and examples will be added.
+   * 
+ * + * 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.InputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location and its domain specific semantics,
+   * if any.
+   * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location and its domain specific semantics,
+   * if any.
+   * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.InputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.automl.v1.InputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location and its domain specific semantics,
+   * if any.
+   * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.InputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + 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()); + } + 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()); + } + 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.ImportDataRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImportDataRequest other = + (com.google.cloud.automl.v1.ImportDataRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) 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(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImportDataRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImportDataRequest 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.ImportDataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImportDataRequest 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.ImportDataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImportDataRequest 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.ImportDataRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImportDataRequest 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.ImportDataRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImportDataRequest 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.ImportDataRequest 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.ImportDataRequest 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.ImportDataRequest 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.ImportData][google.cloud.automl.v1.AutoMl.ImportData].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImportDataRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImportDataRequest) + com.google.cloud.automl.v1.ImportDataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ImportDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ImportDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImportDataRequest.class, + com.google.cloud.automl.v1.ImportDataRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ImportDataRequest.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; + } + 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_ImportDataRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImportDataRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImportDataRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImportDataRequest build() { + com.google.cloud.automl.v1.ImportDataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImportDataRequest buildPartial() { + com.google.cloud.automl.v1.ImportDataRequest result = + new com.google.cloud.automl.v1.ImportDataRequest(this); + result.name_ = name_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.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.ImportDataRequest) { + return mergeFrom((com.google.cloud.automl.v1.ImportDataRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ImportDataRequest other) { + if (other == com.google.cloud.automl.v1.ImportDataRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + 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.ImportDataRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ImportDataRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Dataset name. Dataset must already exist. All imported
+     * annotations and examples will be added.
+     * 
+ * + * 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. Dataset name. Dataset must already exist. All imported
+     * annotations and examples will be added.
+     * 
+ * + * 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. Dataset name. Dataset must already exist. All imported
+     * annotations and examples will be added.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Dataset name. Dataset must already exist. All imported
+     * annotations and examples will be added.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Dataset name. Dataset must already exist. All imported
+     * annotations and examples will be added.
+     * 
+ * + * 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.InputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.InputConfig, + com.google.cloud.automl.v1.InputConfig.Builder, + com.google.cloud.automl.v1.InputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.automl.v1.InputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public Builder setInputConfig(com.google.cloud.automl.v1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public Builder setInputConfig(com.google.cloud.automl.v1.InputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public Builder mergeInputConfig(com.google.cloud.automl.v1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.automl.v1.InputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.InputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.automl.v1.InputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location and its domain specific semantics,
+     * if any.
+     * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.InputConfig, + com.google.cloud.automl.v1.InputConfig.Builder, + com.google.cloud.automl.v1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.InputConfig, + com.google.cloud.automl.v1.InputConfig.Builder, + com.google.cloud.automl.v1.InputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + @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.ImportDataRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImportDataRequest) + private static final com.google.cloud.automl.v1.ImportDataRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImportDataRequest(); + } + + public static com.google.cloud.automl.v1.ImportDataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportDataRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportDataRequest(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.ImportDataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataRequestOrBuilder.java new file mode 100644 index 000000000..90478564e --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataRequestOrBuilder.java @@ -0,0 +1,82 @@ +/* + * 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 ImportDataRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImportDataRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Dataset name. Dataset must already exist. All imported
+   * annotations and examples will be added.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Dataset name. Dataset must already exist. All imported
+   * annotations and examples will be added.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The desired input location and its domain specific semantics,
+   * if any.
+   * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location and its domain specific semantics,
+   * if any.
+   * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + com.google.cloud.automl.v1.InputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location and its domain specific semantics,
+   * if any.
+   * 
+ * + * .google.cloud.automl.v1.InputConfig input_config = 3; + */ + com.google.cloud.automl.v1.InputConfigOrBuilder getInputConfigOrBuilder(); +} 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 new file mode 100644 index 000000000..76b8f0b50 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfig.java @@ -0,0 +1,1197 @@ +/* + * 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 for 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]
+ * 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
+ * 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
+ * these values are nondeterministically selected from the given ones.
+ *  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
+ *  failures, up to a certain count cap, is listed in
+ *  Operation.metadata.partial_failures.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.InputConfig} + */ +public final class InputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.InputConfig) + InputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use InputConfig.newBuilder() to construct. + private InputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InputConfig() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InputConfig( + 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; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + params_ = + com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + 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.Io + .internal_static_google_cloud_automl_v1_InputConfig_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_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.InputConfig.class, + com.google.cloud.automl.v1.InputConfig.Builder.class); + } + + private int bitField0_; + 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; + /** + * + * + *
+   * The Google Cloud Storage location for the input content.
+   * In ImportData, the gcs_source points to a csv with structure described in
+   * the comment.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * The Google Cloud Storage location for the input content.
+   * In ImportData, the gcs_source points to a csv with structure described in
+   * the comment.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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(); + } + /** + * + * + *
+   * The Google Cloud Storage location for the input content.
+   * In ImportData, the gcs_source points to a csv with structure described in
+   * the comment.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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(); + } + + 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_InputConfig_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 describing the semantic of the
+   * imported data, 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 domain-specific parameters describing the semantic of the
+   * imported data, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Additional domain-specific parameters describing the semantic of the
+   * imported data, 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 domain-specific parameters describing the semantic of the
+   * imported data, 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 (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.automl.v1.GcsSource) source_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 2); + 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_); + } + 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__); + } + 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.InputConfig)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.InputConfig other = (com.google.cloud.automl.v1.InputConfig) obj; + + if (!internalGetParams().equals(other.internalGetParams())) return false; + 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(); + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().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.InputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.InputConfig 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.InputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.InputConfig 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.InputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.InputConfig 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.InputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.InputConfig 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.InputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.InputConfig 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.InputConfig 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.InputConfig 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.InputConfig 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 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]
+   * 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
+   * 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
+   * these values are nondeterministically selected from the given ones.
+   *  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
+   *  failures, up to a certain count cap, is listed in
+   *  Operation.metadata.partial_failures.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.InputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.InputConfig) + com.google.cloud.automl.v1.InputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_InputConfig_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_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.InputConfig.class, + com.google.cloud.automl.v1.InputConfig.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.InputConfig.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(); + internalGetMutableParams().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_InputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.InputConfig getDefaultInstanceForType() { + return com.google.cloud.automl.v1.InputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.InputConfig build() { + com.google.cloud.automl.v1.InputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.InputConfig buildPartial() { + com.google.cloud.automl.v1.InputConfig result = + new com.google.cloud.automl.v1.InputConfig(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (sourceCase_ == 1) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + result.bitField0_ = to_bitField0_; + 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.InputConfig) { + return mergeFrom((com.google.cloud.automl.v1.InputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.InputConfig other) { + if (other == com.google.cloud.automl.v1.InputConfig.getDefaultInstance()) return this; + internalGetMutableParams().mergeFrom(other.internalGetParams()); + 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.InputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.InputConfig) 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 int bitField0_; + + 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 for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * The Google Cloud Storage location for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .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(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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; + } + /** + * + * + *
+     * The Google Cloud Storage location for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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; + } + /** + * + * + *
+     * The Google Cloud Storage location for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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; + } + /** + * + * + *
+     * The Google Cloud Storage location for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Google Cloud Storage location for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location for the input content.
+     * In ImportData, the gcs_source points to a csv with structure described in
+     * the comment.
+     * 
+ * + * .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) { + 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_; + } + + 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 describing the semantic of the
+     * imported data, 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 domain-specific parameters describing the semantic of the
+     * imported data, any string must be up to 25000
+     * characters long.
+     * 
+ * + * map<string, string> params = 2; + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Additional domain-specific parameters describing the semantic of the
+     * imported data, 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 domain-specific parameters describing the semantic of the
+     * imported data, 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 domain-specific parameters describing the semantic of the
+     * imported data, 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 domain-specific parameters describing the semantic of the
+     * imported data, 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 domain-specific parameters describing the semantic of the
+     * imported data, 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.InputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.InputConfig) + private static final com.google.cloud.automl.v1.InputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.InputConfig(); + } + + public static com.google.cloud.automl.v1.InputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InputConfig(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.InputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..cf38adeaf --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfigOrBuilder.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/io.proto + +package com.google.cloud.automl.v1; + +public interface InputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.InputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Google Cloud Storage location for the input content.
+   * In ImportData, the gcs_source points to a csv with structure described in
+   * the comment.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + 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.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + com.google.cloud.automl.v1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * Additional domain-specific parameters describing the semantic of the
+   * imported data, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + int getParamsCount(); + /** + * + * + *
+   * Additional domain-specific parameters describing the semantic of the
+   * imported data, 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 domain-specific parameters describing the semantic of the
+   * imported data, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Additional domain-specific parameters describing the semantic of the
+   * imported data, 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 domain-specific parameters describing the semantic of the
+   * imported data, 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.InputConfig.SourceCase getSourceCase(); +} 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 new file mode 100644 index 000000000..0f6b74819 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Io.java @@ -0,0 +1,134 @@ +/* + * 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 final class Io { + private Io() {} + + 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_InputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_InputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_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_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_GcsDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_GcsDestination_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\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 " + + "\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 + * Request message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. + * + * + * Protobuf type {@code google.cloud.automl.v1.ListDatasetsRequest} + */ +public final class ListDatasetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ListDatasetsRequest) + ListDatasetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDatasetsRequest.newBuilder() to construct. + private ListDatasetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDatasetsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDatasetsRequest( + 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(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 32: + { + pageSize_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListDatasetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListDatasetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListDatasetsRequest.class, + com.google.cloud.automl.v1.ListDatasetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The resource name of the project from which to list datasets.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the project from which to list datasets.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * 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:
+   *   * `translation_dataset_metadata:*` --> The dataset has
+   *                                          translation_dataset_metadata.
+   * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * 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:
+   *   * `translation_dataset_metadata:*` --> The dataset has
+   *                                          translation_dataset_metadata.
+   * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + * + * + *
+   * Requested page size. Server may return fewer results than requested.
+   * If unspecified, server will pick a default size.
+   * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A token identifying a page of results for the server to return
+   * Typically obtained via
+   * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+   * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+   * 
+ * + * string page_token = 6; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results for the server to return
+   * Typically obtained via
+   * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+   * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+   * 
+ * + * string page_token = 6; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ListDatasetsRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ListDatasetsRequest other = + (com.google.cloud.automl.v1.ListDatasetsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ListDatasetsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListDatasetsRequest 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.ListDatasetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListDatasetsRequest 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.ListDatasetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListDatasetsRequest 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.ListDatasetsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListDatasetsRequest 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.ListDatasetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListDatasetsRequest 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.ListDatasetsRequest 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.ListDatasetsRequest 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.ListDatasetsRequest 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.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListDatasetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ListDatasetsRequest) + com.google.cloud.automl.v1.ListDatasetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListDatasetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListDatasetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListDatasetsRequest.class, + com.google.cloud.automl.v1.ListDatasetsRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ListDatasetsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + 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_ListDatasetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListDatasetsRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ListDatasetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListDatasetsRequest build() { + com.google.cloud.automl.v1.ListDatasetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListDatasetsRequest buildPartial() { + com.google.cloud.automl.v1.ListDatasetsRequest result = + new com.google.cloud.automl.v1.ListDatasetsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ListDatasetsRequest) { + return mergeFrom((com.google.cloud.automl.v1.ListDatasetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ListDatasetsRequest other) { + if (other == com.google.cloud.automl.v1.ListDatasetsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ListDatasetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ListDatasetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The resource name of the project from which to list datasets.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the project from which to list datasets.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the project from which to list datasets.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the project from which to list datasets.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the project from which to list datasets.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * 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:
+     *   * `translation_dataset_metadata:*` --> The dataset has
+     *                                          translation_dataset_metadata.
+     * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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:
+     *   * `translation_dataset_metadata:*` --> The dataset has
+     *                                          translation_dataset_metadata.
+     * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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:
+     *   * `translation_dataset_metadata:*` --> The dataset has
+     *                                          translation_dataset_metadata.
+     * 
+ * + * string filter = 3; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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:
+     *   * `translation_dataset_metadata:*` --> The dataset has
+     *                                          translation_dataset_metadata.
+     * 
+ * + * string filter = 3; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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:
+     *   * `translation_dataset_metadata:*` --> The dataset has
+     *                                          translation_dataset_metadata.
+     * 
+ * + * string filter = 3; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size. Server may return fewer results than requested.
+     * If unspecified, server will pick a default size.
+     * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer results than requested.
+     * If unspecified, server will pick a default size.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer results than requested.
+     * If unspecified, server will pick a default size.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+     * 
+ * + * string page_token = 6; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+     * 
+ * + * string page_token = 6; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ListDatasetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListDatasetsRequest) + private static final com.google.cloud.automl.v1.ListDatasetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ListDatasetsRequest(); + } + + public static com.google.cloud.automl.v1.ListDatasetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDatasetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDatasetsRequest(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.ListDatasetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..b143aea9c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsRequestOrBuilder.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/service.proto + +package com.google.cloud.automl.v1; + +public interface ListDatasetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ListDatasetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the project from which to list datasets.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * The resource name of the project from which to list datasets.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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:
+   *   * `translation_dataset_metadata:*` --> The dataset has
+   *                                          translation_dataset_metadata.
+   * 
+ * + * string filter = 3; + */ + 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:
+   *   * `translation_dataset_metadata:*` --> The dataset has
+   *                                          translation_dataset_metadata.
+   * 
+ * + * string filter = 3; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer results than requested.
+   * If unspecified, server will pick a default size.
+   * 
+ * + * int32 page_size = 4; + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results for the server to return
+   * Typically obtained via
+   * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+   * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+   * 
+ * + * string page_token = 6; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results for the server to return
+   * Typically obtained via
+   * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous
+   * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call.
+   * 
+ * + * string page_token = 6; + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsResponse.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsResponse.java new file mode 100644 index 000000000..f631d41ee --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsResponse.java @@ -0,0 +1,1107 @@ +/* + * 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; + +/** + * + * + *
+ * Response message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListDatasetsResponse} + */ +public final class ListDatasetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ListDatasetsResponse) + ListDatasetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDatasetsResponse.newBuilder() to construct. + private ListDatasetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDatasetsResponse() { + datasets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDatasetsResponse( + 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)) { + datasets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + datasets_.add( + input.readMessage( + com.google.cloud.automl.v1.Dataset.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + datasets_ = java.util.Collections.unmodifiableList(datasets_); + } + 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_ListDatasetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListDatasetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListDatasetsResponse.class, + com.google.cloud.automl.v1.ListDatasetsResponse.Builder.class); + } + + private int bitField0_; + public static final int DATASETS_FIELD_NUMBER = 1; + private java.util.List datasets_; + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public java.util.List getDatasetsList() { + return datasets_; + } + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public java.util.List + getDatasetsOrBuilderList() { + return datasets_; + } + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public int getDatasetsCount() { + return datasets_.size(); + } + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1.Dataset getDatasets(int index) { + return datasets_.get(index); + } + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1.DatasetOrBuilder getDatasetsOrBuilder(int index) { + return datasets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < datasets_.size(); i++) { + output.writeMessage(1, datasets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < datasets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, datasets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ListDatasetsResponse)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ListDatasetsResponse other = + (com.google.cloud.automl.v1.ListDatasetsResponse) obj; + + if (!getDatasetsList().equals(other.getDatasetsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDatasetsCount() > 0) { + hash = (37 * hash) + DATASETS_FIELD_NUMBER; + hash = (53 * hash) + getDatasetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ListDatasetsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListDatasetsResponse 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.ListDatasetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListDatasetsResponse 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.ListDatasetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListDatasetsResponse 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.ListDatasetsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListDatasetsResponse 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.ListDatasetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListDatasetsResponse 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.ListDatasetsResponse 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.ListDatasetsResponse 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.ListDatasetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListDatasetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ListDatasetsResponse) + com.google.cloud.automl.v1.ListDatasetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListDatasetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListDatasetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListDatasetsResponse.class, + com.google.cloud.automl.v1.ListDatasetsResponse.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ListDatasetsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDatasetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (datasetsBuilder_ == null) { + datasets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + datasetsBuilder_.clear(); + } + nextPageToken_ = ""; + + 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_ListDatasetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListDatasetsResponse getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ListDatasetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListDatasetsResponse build() { + com.google.cloud.automl.v1.ListDatasetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListDatasetsResponse buildPartial() { + com.google.cloud.automl.v1.ListDatasetsResponse result = + new com.google.cloud.automl.v1.ListDatasetsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (datasetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + datasets_ = java.util.Collections.unmodifiableList(datasets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.datasets_ = datasets_; + } else { + result.datasets_ = datasetsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + 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.ListDatasetsResponse) { + return mergeFrom((com.google.cloud.automl.v1.ListDatasetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ListDatasetsResponse other) { + if (other == com.google.cloud.automl.v1.ListDatasetsResponse.getDefaultInstance()) + return this; + if (datasetsBuilder_ == null) { + if (!other.datasets_.isEmpty()) { + if (datasets_.isEmpty()) { + datasets_ = other.datasets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDatasetsIsMutable(); + datasets_.addAll(other.datasets_); + } + onChanged(); + } + } else { + if (!other.datasets_.isEmpty()) { + if (datasetsBuilder_.isEmpty()) { + datasetsBuilder_.dispose(); + datasetsBuilder_ = null; + datasets_ = other.datasets_; + bitField0_ = (bitField0_ & ~0x00000001); + datasetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDatasetsFieldBuilder() + : null; + } else { + datasetsBuilder_.addAllMessages(other.datasets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ListDatasetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ListDatasetsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List datasets_ = + java.util.Collections.emptyList(); + + private void ensureDatasetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + datasets_ = new java.util.ArrayList(datasets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder> + datasetsBuilder_; + + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public java.util.List getDatasetsList() { + if (datasetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(datasets_); + } else { + return datasetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public int getDatasetsCount() { + if (datasetsBuilder_ == null) { + return datasets_.size(); + } else { + return datasetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1.Dataset getDatasets(int index) { + if (datasetsBuilder_ == null) { + return datasets_.get(index); + } else { + return datasetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder setDatasets(int index, com.google.cloud.automl.v1.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.set(index, value); + onChanged(); + } else { + datasetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder setDatasets( + int index, com.google.cloud.automl.v1.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.set(index, builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder addDatasets(com.google.cloud.automl.v1.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.add(value); + onChanged(); + } else { + datasetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder addDatasets(int index, com.google.cloud.automl.v1.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.add(index, value); + onChanged(); + } else { + datasetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder addDatasets(com.google.cloud.automl.v1.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.add(builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder addDatasets( + int index, com.google.cloud.automl.v1.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.add(index, builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder addAllDatasets( + java.lang.Iterable values) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, datasets_); + onChanged(); + } else { + datasetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder clearDatasets() { + if (datasetsBuilder_ == null) { + datasets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + datasetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public Builder removeDatasets(int index) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.remove(index); + onChanged(); + } else { + datasetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1.Dataset.Builder getDatasetsBuilder(int index) { + return getDatasetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1.DatasetOrBuilder getDatasetsOrBuilder(int index) { + if (datasetsBuilder_ == null) { + return datasets_.get(index); + } else { + return datasetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public java.util.List + getDatasetsOrBuilderList() { + if (datasetsBuilder_ != null) { + return datasetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(datasets_); + } + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1.Dataset.Builder addDatasetsBuilder() { + return getDatasetsFieldBuilder() + .addBuilder(com.google.cloud.automl.v1.Dataset.getDefaultInstance()); + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1.Dataset.Builder addDatasetsBuilder(int index) { + return getDatasetsFieldBuilder() + .addBuilder(index, com.google.cloud.automl.v1.Dataset.getDefaultInstance()); + } + /** + * + * + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + public java.util.List getDatasetsBuilderList() { + return getDatasetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder> + getDatasetsFieldBuilder() { + if (datasetsBuilder_ == null) { + datasetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder>( + datasets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + datasets_ = null; + } + return datasetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ListDatasetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListDatasetsResponse) + private static final com.google.cloud.automl.v1.ListDatasetsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ListDatasetsResponse(); + } + + public static com.google.cloud.automl.v1.ListDatasetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDatasetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDatasetsResponse(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.ListDatasetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsResponseOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsResponseOrBuilder.java new file mode 100644 index 000000000..62e076385 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsResponseOrBuilder.java @@ -0,0 +1,99 @@ +/* + * 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 ListDatasetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ListDatasetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + java.util.List getDatasetsList(); + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + com.google.cloud.automl.v1.Dataset getDatasets(int index); + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + int getDatasetsCount(); + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + java.util.List getDatasetsOrBuilderList(); + /** + * + * + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + com.google.cloud.automl.v1.DatasetOrBuilder getDatasetsOrBuilder(int index); + + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsRequest.java new file mode 100644 index 000000000..0fc1a280a --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsRequest.java @@ -0,0 +1,1099 @@ +/* + * 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.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListModelEvaluationsRequest} + */ +public final class ListModelEvaluationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ListModelEvaluationsRequest) + ListModelEvaluationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListModelEvaluationsRequest.newBuilder() to construct. + private ListModelEvaluationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListModelEvaluationsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListModelEvaluationsRequest( + 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(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 32: + { + pageSize_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelEvaluationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelEvaluationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListModelEvaluationsRequest.class, + com.google.cloud.automl.v1.ListModelEvaluationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the model to list the model evaluations for.
+   * If modelId is set as "-", this will list model evaluations from across all
+   * models of the parent location.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the model to list the model evaluations for.
+   * If modelId is set as "-", this will list model evaluations from across all
+   * models of the parent location.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * An expression for filtering the results of the request.
+   *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+   *                          the last.
+   * Some examples of using the filter are:
+   *   * `annotation_spec_id!=4` --> The model evaluation was done for
+   *                             annotation spec with ID different than 4.
+   *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+   *                                aggregate of all annotation specs.
+   * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * An expression for filtering the results of the request.
+   *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+   *                          the last.
+   * Some examples of using the filter are:
+   *   * `annotation_spec_id!=4` --> The model evaluation was done for
+   *                             annotation spec with ID different than 4.
+   *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+   *                                aggregate of all annotation specs.
+   * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + * + * + *
+   * Requested page size.
+   * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A token identifying a page of results for the server to return.
+   * Typically obtained via
+   * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+   * 
+ * + * string page_token = 6; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results for the server to return.
+   * Typically obtained via
+   * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+   * 
+ * + * string page_token = 6; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ListModelEvaluationsRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ListModelEvaluationsRequest other = + (com.google.cloud.automl.v1.ListModelEvaluationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsRequest 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.ListModelEvaluationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsRequest 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.ListModelEvaluationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsRequest 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.ListModelEvaluationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsRequest 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.ListModelEvaluationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsRequest 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.ListModelEvaluationsRequest 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.ListModelEvaluationsRequest 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.ListModelEvaluationsRequest 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.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListModelEvaluationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ListModelEvaluationsRequest) + com.google.cloud.automl.v1.ListModelEvaluationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelEvaluationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelEvaluationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListModelEvaluationsRequest.class, + com.google.cloud.automl.v1.ListModelEvaluationsRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ListModelEvaluationsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + 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_ListModelEvaluationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelEvaluationsRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ListModelEvaluationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelEvaluationsRequest build() { + com.google.cloud.automl.v1.ListModelEvaluationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelEvaluationsRequest buildPartial() { + com.google.cloud.automl.v1.ListModelEvaluationsRequest result = + new com.google.cloud.automl.v1.ListModelEvaluationsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ListModelEvaluationsRequest) { + return mergeFrom((com.google.cloud.automl.v1.ListModelEvaluationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ListModelEvaluationsRequest other) { + if (other == com.google.cloud.automl.v1.ListModelEvaluationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ListModelEvaluationsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ListModelEvaluationsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the model to list the model evaluations for.
+     * If modelId is set as "-", this will list model evaluations from across all
+     * models of the parent location.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the model to list the model evaluations for.
+     * If modelId is set as "-", this will list model evaluations from across all
+     * models of the parent location.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the model to list the model evaluations for.
+     * If modelId is set as "-", this will list model evaluations from across all
+     * models of the parent location.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the model to list the model evaluations for.
+     * If modelId is set as "-", this will list model evaluations from across all
+     * models of the parent location.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the model to list the model evaluations for.
+     * If modelId is set as "-", this will list model evaluations from across all
+     * models of the parent location.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+     *                          the last.
+     * Some examples of using the filter are:
+     *   * `annotation_spec_id!=4` --> The model evaluation was done for
+     *                             annotation spec with ID different than 4.
+     *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+     *                                aggregate of all annotation specs.
+     * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+     *                          the last.
+     * Some examples of using the filter are:
+     *   * `annotation_spec_id!=4` --> The model evaluation was done for
+     *                             annotation spec with ID different than 4.
+     *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+     *                                aggregate of all annotation specs.
+     * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+     *                          the last.
+     * Some examples of using the filter are:
+     *   * `annotation_spec_id!=4` --> The model evaluation was done for
+     *                             annotation spec with ID different than 4.
+     *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+     *                                aggregate of all annotation specs.
+     * 
+ * + * string filter = 3; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+     *                          the last.
+     * Some examples of using the filter are:
+     *   * `annotation_spec_id!=4` --> The model evaluation was done for
+     *                             annotation spec with ID different than 4.
+     *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+     *                                aggregate of all annotation specs.
+     * 
+ * + * string filter = 3; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+     *                          the last.
+     * Some examples of using the filter are:
+     *   * `annotation_spec_id!=4` --> The model evaluation was done for
+     *                             annotation spec with ID different than 4.
+     *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+     *                                aggregate of all annotation specs.
+     * 
+ * + * string filter = 3; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results for the server to return.
+     * Typically obtained via
+     * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+     * 
+ * + * string page_token = 6; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results for the server to return.
+     * Typically obtained via
+     * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+     * 
+ * + * string page_token = 6; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results for the server to return.
+     * Typically obtained via
+     * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results for the server to return.
+     * Typically obtained via
+     * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results for the server to return.
+     * Typically obtained via
+     * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ListModelEvaluationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListModelEvaluationsRequest) + private static final com.google.cloud.automl.v1.ListModelEvaluationsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ListModelEvaluationsRequest(); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListModelEvaluationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListModelEvaluationsRequest(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.ListModelEvaluationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsRequestOrBuilder.java new file mode 100644 index 000000000..df0eced6f --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * 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 ListModelEvaluationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ListModelEvaluationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the model to list the model evaluations for.
+   * If modelId is set as "-", this will list model evaluations from across all
+   * models of the parent location.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the model to list the model evaluations for.
+   * If modelId is set as "-", this will list model evaluations from across all
+   * models of the parent location.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * An expression for filtering the results of the request.
+   *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+   *                          the last.
+   * Some examples of using the filter are:
+   *   * `annotation_spec_id!=4` --> The model evaluation was done for
+   *                             annotation spec with ID different than 4.
+   *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+   *                                aggregate of all annotation specs.
+   * 
+ * + * string filter = 3; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * An expression for filtering the results of the request.
+   *   * `annotation_spec_id` - for =, !=  or existence. See example below for
+   *                          the last.
+   * Some examples of using the filter are:
+   *   * `annotation_spec_id!=4` --> The model evaluation was done for
+   *                             annotation spec with ID different than 4.
+   *   * `NOT annotation_spec_id:*` --> The model evaluation was done for
+   *                                aggregate of all annotation specs.
+   * 
+ * + * string filter = 3; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Requested page size.
+   * 
+ * + * int32 page_size = 4; + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results for the server to return.
+   * Typically obtained via
+   * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+   * 
+ * + * string page_token = 6; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results for the server to return.
+   * Typically obtained via
+   * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call.
+   * 
+ * + * string page_token = 6; + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsResponse.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsResponse.java new file mode 100644 index 000000000..1ae658f66 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsResponse.java @@ -0,0 +1,1125 @@ +/* + * 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; + +/** + * + * + *
+ * Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListModelEvaluationsResponse} + */ +public final class ListModelEvaluationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ListModelEvaluationsResponse) + ListModelEvaluationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListModelEvaluationsResponse.newBuilder() to construct. + private ListModelEvaluationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListModelEvaluationsResponse() { + modelEvaluation_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListModelEvaluationsResponse( + 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)) { + modelEvaluation_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + modelEvaluation_.add( + input.readMessage( + com.google.cloud.automl.v1.ModelEvaluation.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + modelEvaluation_ = java.util.Collections.unmodifiableList(modelEvaluation_); + } + 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_ListModelEvaluationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelEvaluationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListModelEvaluationsResponse.class, + com.google.cloud.automl.v1.ListModelEvaluationsResponse.Builder.class); + } + + private int bitField0_; + public static final int MODEL_EVALUATION_FIELD_NUMBER = 1; + private java.util.List modelEvaluation_; + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public java.util.List getModelEvaluationList() { + return modelEvaluation_; + } + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public java.util.List + getModelEvaluationOrBuilderList() { + return modelEvaluation_; + } + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public int getModelEvaluationCount() { + return modelEvaluation_.size(); + } + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1.ModelEvaluation getModelEvaluation(int index) { + return modelEvaluation_.get(index); + } + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1.ModelEvaluationOrBuilder getModelEvaluationOrBuilder( + int index) { + return modelEvaluation_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < modelEvaluation_.size(); i++) { + output.writeMessage(1, modelEvaluation_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < modelEvaluation_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, modelEvaluation_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ListModelEvaluationsResponse)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ListModelEvaluationsResponse other = + (com.google.cloud.automl.v1.ListModelEvaluationsResponse) obj; + + if (!getModelEvaluationList().equals(other.getModelEvaluationList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getModelEvaluationCount() > 0) { + hash = (37 * hash) + MODEL_EVALUATION_FIELD_NUMBER; + hash = (53 * hash) + getModelEvaluationList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsResponse 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.ListModelEvaluationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsResponse 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.ListModelEvaluationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsResponse 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.ListModelEvaluationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsResponse 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.ListModelEvaluationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsResponse 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.ListModelEvaluationsResponse 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.ListModelEvaluationsResponse 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.ListModelEvaluationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListModelEvaluationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ListModelEvaluationsResponse) + com.google.cloud.automl.v1.ListModelEvaluationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelEvaluationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelEvaluationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListModelEvaluationsResponse.class, + com.google.cloud.automl.v1.ListModelEvaluationsResponse.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ListModelEvaluationsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getModelEvaluationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (modelEvaluationBuilder_ == null) { + modelEvaluation_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + modelEvaluationBuilder_.clear(); + } + nextPageToken_ = ""; + + 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_ListModelEvaluationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelEvaluationsResponse getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ListModelEvaluationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelEvaluationsResponse build() { + com.google.cloud.automl.v1.ListModelEvaluationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelEvaluationsResponse buildPartial() { + com.google.cloud.automl.v1.ListModelEvaluationsResponse result = + new com.google.cloud.automl.v1.ListModelEvaluationsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (modelEvaluationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + modelEvaluation_ = java.util.Collections.unmodifiableList(modelEvaluation_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.modelEvaluation_ = modelEvaluation_; + } else { + result.modelEvaluation_ = modelEvaluationBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + 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.ListModelEvaluationsResponse) { + return mergeFrom((com.google.cloud.automl.v1.ListModelEvaluationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ListModelEvaluationsResponse other) { + if (other == com.google.cloud.automl.v1.ListModelEvaluationsResponse.getDefaultInstance()) + return this; + if (modelEvaluationBuilder_ == null) { + if (!other.modelEvaluation_.isEmpty()) { + if (modelEvaluation_.isEmpty()) { + modelEvaluation_ = other.modelEvaluation_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureModelEvaluationIsMutable(); + modelEvaluation_.addAll(other.modelEvaluation_); + } + onChanged(); + } + } else { + if (!other.modelEvaluation_.isEmpty()) { + if (modelEvaluationBuilder_.isEmpty()) { + modelEvaluationBuilder_.dispose(); + modelEvaluationBuilder_ = null; + modelEvaluation_ = other.modelEvaluation_; + bitField0_ = (bitField0_ & ~0x00000001); + modelEvaluationBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getModelEvaluationFieldBuilder() + : null; + } else { + modelEvaluationBuilder_.addAllMessages(other.modelEvaluation_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ListModelEvaluationsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ListModelEvaluationsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List modelEvaluation_ = + java.util.Collections.emptyList(); + + private void ensureModelEvaluationIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + modelEvaluation_ = + new java.util.ArrayList(modelEvaluation_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ModelEvaluation, + com.google.cloud.automl.v1.ModelEvaluation.Builder, + com.google.cloud.automl.v1.ModelEvaluationOrBuilder> + modelEvaluationBuilder_; + + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public java.util.List getModelEvaluationList() { + if (modelEvaluationBuilder_ == null) { + return java.util.Collections.unmodifiableList(modelEvaluation_); + } else { + return modelEvaluationBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public int getModelEvaluationCount() { + if (modelEvaluationBuilder_ == null) { + return modelEvaluation_.size(); + } else { + return modelEvaluationBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1.ModelEvaluation getModelEvaluation(int index) { + if (modelEvaluationBuilder_ == null) { + return modelEvaluation_.get(index); + } else { + return modelEvaluationBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder setModelEvaluation(int index, com.google.cloud.automl.v1.ModelEvaluation value) { + if (modelEvaluationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelEvaluationIsMutable(); + modelEvaluation_.set(index, value); + onChanged(); + } else { + modelEvaluationBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder setModelEvaluation( + int index, com.google.cloud.automl.v1.ModelEvaluation.Builder builderForValue) { + if (modelEvaluationBuilder_ == null) { + ensureModelEvaluationIsMutable(); + modelEvaluation_.set(index, builderForValue.build()); + onChanged(); + } else { + modelEvaluationBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder addModelEvaluation(com.google.cloud.automl.v1.ModelEvaluation value) { + if (modelEvaluationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelEvaluationIsMutable(); + modelEvaluation_.add(value); + onChanged(); + } else { + modelEvaluationBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder addModelEvaluation(int index, com.google.cloud.automl.v1.ModelEvaluation value) { + if (modelEvaluationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelEvaluationIsMutable(); + modelEvaluation_.add(index, value); + onChanged(); + } else { + modelEvaluationBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder addModelEvaluation( + com.google.cloud.automl.v1.ModelEvaluation.Builder builderForValue) { + if (modelEvaluationBuilder_ == null) { + ensureModelEvaluationIsMutable(); + modelEvaluation_.add(builderForValue.build()); + onChanged(); + } else { + modelEvaluationBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder addModelEvaluation( + int index, com.google.cloud.automl.v1.ModelEvaluation.Builder builderForValue) { + if (modelEvaluationBuilder_ == null) { + ensureModelEvaluationIsMutable(); + modelEvaluation_.add(index, builderForValue.build()); + onChanged(); + } else { + modelEvaluationBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder addAllModelEvaluation( + java.lang.Iterable values) { + if (modelEvaluationBuilder_ == null) { + ensureModelEvaluationIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, modelEvaluation_); + onChanged(); + } else { + modelEvaluationBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder clearModelEvaluation() { + if (modelEvaluationBuilder_ == null) { + modelEvaluation_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + modelEvaluationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public Builder removeModelEvaluation(int index) { + if (modelEvaluationBuilder_ == null) { + ensureModelEvaluationIsMutable(); + modelEvaluation_.remove(index); + onChanged(); + } else { + modelEvaluationBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1.ModelEvaluation.Builder getModelEvaluationBuilder(int index) { + return getModelEvaluationFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1.ModelEvaluationOrBuilder getModelEvaluationOrBuilder( + int index) { + if (modelEvaluationBuilder_ == null) { + return modelEvaluation_.get(index); + } else { + return modelEvaluationBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public java.util.List + getModelEvaluationOrBuilderList() { + if (modelEvaluationBuilder_ != null) { + return modelEvaluationBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(modelEvaluation_); + } + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1.ModelEvaluation.Builder addModelEvaluationBuilder() { + return getModelEvaluationFieldBuilder() + .addBuilder(com.google.cloud.automl.v1.ModelEvaluation.getDefaultInstance()); + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1.ModelEvaluation.Builder addModelEvaluationBuilder(int index) { + return getModelEvaluationFieldBuilder() + .addBuilder(index, com.google.cloud.automl.v1.ModelEvaluation.getDefaultInstance()); + } + /** + * + * + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + public java.util.List + getModelEvaluationBuilderList() { + return getModelEvaluationFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ModelEvaluation, + com.google.cloud.automl.v1.ModelEvaluation.Builder, + com.google.cloud.automl.v1.ModelEvaluationOrBuilder> + getModelEvaluationFieldBuilder() { + if (modelEvaluationBuilder_ == null) { + modelEvaluationBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ModelEvaluation, + com.google.cloud.automl.v1.ModelEvaluation.Builder, + com.google.cloud.automl.v1.ModelEvaluationOrBuilder>( + modelEvaluation_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + modelEvaluation_ = null; + } + return modelEvaluationBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ListModelEvaluationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListModelEvaluationsResponse) + private static final com.google.cloud.automl.v1.ListModelEvaluationsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ListModelEvaluationsResponse(); + } + + public static com.google.cloud.automl.v1.ListModelEvaluationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListModelEvaluationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListModelEvaluationsResponse(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.ListModelEvaluationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsResponseOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsResponseOrBuilder.java new file mode 100644 index 000000000..88b47f11d --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelEvaluationsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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 ListModelEvaluationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ListModelEvaluationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + java.util.List getModelEvaluationList(); + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + com.google.cloud.automl.v1.ModelEvaluation getModelEvaluation(int index); + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + int getModelEvaluationCount(); + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + java.util.List + getModelEvaluationOrBuilderList(); + /** + * + * + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + com.google.cloud.automl.v1.ModelEvaluationOrBuilder getModelEvaluationOrBuilder(int index); + + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} 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 new file mode 100644 index 000000000..814644e55 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequest.java @@ -0,0 +1,1075 @@ +/* + * 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.ListModels][google.cloud.automl.v1.AutoMl.ListModels].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListModelsRequest} + */ +public final class ListModelsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ListModelsRequest) + ListModelsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListModelsRequest.newBuilder() to construct. + private ListModelsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListModelsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListModelsRequest( + 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(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 32: + { + pageSize_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListModelsRequest.class, + com.google.cloud.automl.v1.ListModelsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the project, from which to list the models.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the project, from which to list the models.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * An expression for filtering the results of the request.
+   *   * `model_metadata` - for existence of the case (e.g.
+   *             video_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.
+   *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+   * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * An expression for filtering the results of the request.
+   *   * `model_metadata` - for existence of the case (e.g.
+   *             video_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.
+   *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+   * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + * + * + *
+   * Requested page size.
+   * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A token identifying a page of results for the server to return
+   * Typically obtained via
+   * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+   * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+   * 
+ * + * string page_token = 6; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results for the server to return
+   * Typically obtained via
+   * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+   * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+   * 
+ * + * string page_token = 6; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ListModelsRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ListModelsRequest other = + (com.google.cloud.automl.v1.ListModelsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ListModelsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelsRequest 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.ListModelsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelsRequest 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.ListModelsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelsRequest 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.ListModelsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListModelsRequest 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.ListModelsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListModelsRequest 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.ListModelsRequest 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.ListModelsRequest 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.ListModelsRequest 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.ListModels][google.cloud.automl.v1.AutoMl.ListModels].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListModelsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ListModelsRequest) + com.google.cloud.automl.v1.ListModelsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListModelsRequest.class, + com.google.cloud.automl.v1.ListModelsRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ListModelsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + 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_ListModelsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelsRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ListModelsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelsRequest build() { + com.google.cloud.automl.v1.ListModelsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelsRequest buildPartial() { + com.google.cloud.automl.v1.ListModelsRequest result = + new com.google.cloud.automl.v1.ListModelsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ListModelsRequest) { + return mergeFrom((com.google.cloud.automl.v1.ListModelsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ListModelsRequest other) { + if (other == com.google.cloud.automl.v1.ListModelsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ListModelsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ListModelsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the project, from which to list the models.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the project, from which to list the models.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the project, from which to list the models.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the project, from which to list the models.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the project, from which to list the models.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `model_metadata` - for existence of the case (e.g.
+     *             video_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.
+     *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+     * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `model_metadata` - for existence of the case (e.g.
+     *             video_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.
+     *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+     * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `model_metadata` - for existence of the case (e.g.
+     *             video_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.
+     *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+     * 
+ * + * string filter = 3; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `model_metadata` - for existence of the case (e.g.
+     *             video_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.
+     *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+     * 
+ * + * string filter = 3; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * An expression for filtering the results of the request.
+     *   * `model_metadata` - for existence of the case (e.g.
+     *             video_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.
+     *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+     * 
+ * + * string filter = 3; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+     * 
+ * + * string page_token = 6; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+     * 
+ * + * string page_token = 6; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results for the server to return
+     * Typically obtained via
+     * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+     * 
+ * + * string page_token = 6; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ListModelsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListModelsRequest) + private static final com.google.cloud.automl.v1.ListModelsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ListModelsRequest(); + } + + public static com.google.cloud.automl.v1.ListModelsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListModelsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListModelsRequest(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.ListModelsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..09191b4df --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * 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 ListModelsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ListModelsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the project, from which to list the models.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the project, from which to list the models.
+   * 
+ * + * string parent = 1; + */ + 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:*).
+   *   * `dataset_id` - for = or !=. Some examples of using the filter are:
+   *   * `image_classification_model_metadata:*` --> The model has
+   *                                        image_classification_model_metadata.
+   *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+   * 
+ * + * string filter = 3; + */ + 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:*).
+   *   * `dataset_id` - for = or !=. Some examples of using the filter are:
+   *   * `image_classification_model_metadata:*` --> The model has
+   *                                        image_classification_model_metadata.
+   *   * `dataset_id=5` --> The model was created from a dataset with ID 5.
+   * 
+ * + * string filter = 3; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Requested page size.
+   * 
+ * + * int32 page_size = 4; + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results for the server to return
+   * Typically obtained via
+   * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+   * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+   * 
+ * + * string page_token = 6; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results for the server to return
+   * Typically obtained via
+   * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous
+   * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call.
+   * 
+ * + * string page_token = 6; + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsResponse.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsResponse.java new file mode 100644 index 000000000..b6fb6fcdd --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsResponse.java @@ -0,0 +1,1103 @@ +/* + * 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; + +/** + * + * + *
+ * Response message for [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListModelsResponse} + */ +public final class ListModelsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ListModelsResponse) + ListModelsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListModelsResponse.newBuilder() to construct. + private ListModelsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListModelsResponse() { + model_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListModelsResponse( + 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)) { + model_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + model_.add( + input.readMessage(com.google.cloud.automl.v1.Model.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + model_ = java.util.Collections.unmodifiableList(model_); + } + 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_ListModelsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListModelsResponse.class, + com.google.cloud.automl.v1.ListModelsResponse.Builder.class); + } + + private int bitField0_; + public static final int MODEL_FIELD_NUMBER = 1; + private java.util.List model_; + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public java.util.List getModelList() { + return model_; + } + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public java.util.List + getModelOrBuilderList() { + return model_; + } + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public int getModelCount() { + return model_.size(); + } + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.Model getModel(int index) { + return model_.get(index); + } + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder(int index) { + return model_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < model_.size(); i++) { + output.writeMessage(1, model_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < model_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, model_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ListModelsResponse)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ListModelsResponse other = + (com.google.cloud.automl.v1.ListModelsResponse) obj; + + if (!getModelList().equals(other.getModelList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getModelCount() > 0) { + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModelList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ListModelsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelsResponse 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.ListModelsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelsResponse 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.ListModelsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ListModelsResponse 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.ListModelsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListModelsResponse 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.ListModelsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ListModelsResponse 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.ListModelsResponse 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.ListModelsResponse 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.ListModelsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ListModelsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ListModelsResponse) + com.google.cloud.automl.v1.ListModelsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ListModelsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ListModelsResponse.class, + com.google.cloud.automl.v1.ListModelsResponse.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ListModelsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getModelFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (modelBuilder_ == null) { + model_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + modelBuilder_.clear(); + } + nextPageToken_ = ""; + + 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_ListModelsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelsResponse getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ListModelsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelsResponse build() { + com.google.cloud.automl.v1.ListModelsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ListModelsResponse buildPartial() { + com.google.cloud.automl.v1.ListModelsResponse result = + new com.google.cloud.automl.v1.ListModelsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (modelBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + model_ = java.util.Collections.unmodifiableList(model_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.model_ = model_; + } else { + result.model_ = modelBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + 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.ListModelsResponse) { + return mergeFrom((com.google.cloud.automl.v1.ListModelsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ListModelsResponse other) { + if (other == com.google.cloud.automl.v1.ListModelsResponse.getDefaultInstance()) return this; + if (modelBuilder_ == null) { + if (!other.model_.isEmpty()) { + if (model_.isEmpty()) { + model_ = other.model_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureModelIsMutable(); + model_.addAll(other.model_); + } + onChanged(); + } + } else { + if (!other.model_.isEmpty()) { + if (modelBuilder_.isEmpty()) { + modelBuilder_.dispose(); + modelBuilder_ = null; + model_ = other.model_; + bitField0_ = (bitField0_ & ~0x00000001); + modelBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getModelFieldBuilder() + : null; + } else { + modelBuilder_.addAllMessages(other.model_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ListModelsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ListModelsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List model_ = + java.util.Collections.emptyList(); + + private void ensureModelIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + model_ = new java.util.ArrayList(model_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder> + modelBuilder_; + + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public java.util.List getModelList() { + if (modelBuilder_ == null) { + return java.util.Collections.unmodifiableList(model_); + } else { + return modelBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public int getModelCount() { + if (modelBuilder_ == null) { + return model_.size(); + } else { + return modelBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.Model getModel(int index) { + if (modelBuilder_ == null) { + return model_.get(index); + } else { + return modelBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder setModel(int index, com.google.cloud.automl.v1.Model value) { + if (modelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelIsMutable(); + model_.set(index, value); + onChanged(); + } else { + modelBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder setModel(int index, com.google.cloud.automl.v1.Model.Builder builderForValue) { + if (modelBuilder_ == null) { + ensureModelIsMutable(); + model_.set(index, builderForValue.build()); + onChanged(); + } else { + modelBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder addModel(com.google.cloud.automl.v1.Model value) { + if (modelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelIsMutable(); + model_.add(value); + onChanged(); + } else { + modelBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder addModel(int index, com.google.cloud.automl.v1.Model value) { + if (modelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelIsMutable(); + model_.add(index, value); + onChanged(); + } else { + modelBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder addModel(com.google.cloud.automl.v1.Model.Builder builderForValue) { + if (modelBuilder_ == null) { + ensureModelIsMutable(); + model_.add(builderForValue.build()); + onChanged(); + } else { + modelBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder addModel(int index, com.google.cloud.automl.v1.Model.Builder builderForValue) { + if (modelBuilder_ == null) { + ensureModelIsMutable(); + model_.add(index, builderForValue.build()); + onChanged(); + } else { + modelBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder addAllModel( + java.lang.Iterable values) { + if (modelBuilder_ == null) { + ensureModelIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, model_); + onChanged(); + } else { + modelBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder clearModel() { + if (modelBuilder_ == null) { + model_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + modelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public Builder removeModel(int index) { + if (modelBuilder_ == null) { + ensureModelIsMutable(); + model_.remove(index); + onChanged(); + } else { + modelBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.Model.Builder getModelBuilder(int index) { + return getModelFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder(int index) { + if (modelBuilder_ == null) { + return model_.get(index); + } else { + return modelBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public java.util.List + getModelOrBuilderList() { + if (modelBuilder_ != null) { + return modelBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(model_); + } + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.Model.Builder addModelBuilder() { + return getModelFieldBuilder() + .addBuilder(com.google.cloud.automl.v1.Model.getDefaultInstance()); + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.Model.Builder addModelBuilder(int index) { + return getModelFieldBuilder() + .addBuilder(index, com.google.cloud.automl.v1.Model.getDefaultInstance()); + } + /** + * + * + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + public java.util.List getModelBuilderList() { + return getModelFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder> + getModelFieldBuilder() { + if (modelBuilder_ == null) { + modelBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder>( + model_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + model_ = null; + } + return modelBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve next page of results.
+     * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ListModelsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListModelsResponse) + private static final com.google.cloud.automl.v1.ListModelsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ListModelsResponse(); + } + + public static com.google.cloud.automl.v1.ListModelsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListModelsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListModelsResponse(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.ListModelsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsResponseOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsResponseOrBuilder.java new file mode 100644 index 000000000..865f5a933 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsResponseOrBuilder.java @@ -0,0 +1,99 @@ +/* + * 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 ListModelsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ListModelsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + java.util.List getModelList(); + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + com.google.cloud.automl.v1.Model getModel(int index); + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + int getModelCount(); + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + java.util.List getModelOrBuilderList(); + /** + * + * + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1.Model model = 1; + */ + com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder(int index); + + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to retrieve next page of results.
+   * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/LocationName.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/LocationName.java new file mode 100644 index 000000000..8c4fa647c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/LocationName.java @@ -0,0 +1,182 @@ +/* + * 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 LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return 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); + 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); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() {} + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} 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 new file mode 100644 index 000000000..820395299 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Model.java @@ -0,0 +1,2524 @@ +/* + * 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/model.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * API proto representing a trained machine learning model.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.Model} + */ +public final class Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.Model) + ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Model() { + name_ = ""; + displayName_ = ""; + datasetId_ = ""; + deploymentState_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Model( + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + datasetId_ = s; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 64: + { + int rawValue = input.readEnum(); + + deploymentState_ = rawValue; + break; + } + case 90: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 122: + { + com.google.cloud.automl.v1.TranslationModelMetadata.Builder subBuilder = null; + if (modelMetadataCase_ == 15) { + subBuilder = + ((com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_) + .toBuilder(); + } + modelMetadata_ = + input.readMessage( + com.google.cloud.automl.v1.TranslationModelMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_); + modelMetadata_ = subBuilder.buildPartial(); + } + modelMetadataCase_ = 15; + break; + } + case 274: + { + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000080; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.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.ModelOuterClass + .internal_static_google_cloud_automl_v1_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 34: + return internalGetLabels(); + 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.ModelOuterClass + .internal_static_google_cloud_automl_v1_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Model.class, com.google.cloud.automl.v1.Model.Builder.class); + } + + /** + * + * + *
+   * Deployment state of the model.
+   * 
+ * + * Protobuf enum {@code google.cloud.automl.v1.Model.DeploymentState} + */ + public enum DeploymentState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Should not be used, an un-set enum has this value by default.
+     * 
+ * + * DEPLOYMENT_STATE_UNSPECIFIED = 0; + */ + DEPLOYMENT_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Model is deployed.
+     * 
+ * + * DEPLOYED = 1; + */ + DEPLOYED(1), + /** + * + * + *
+     * Model is not deployed.
+     * 
+ * + * UNDEPLOYED = 2; + */ + UNDEPLOYED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Should not be used, an un-set enum has this value by default.
+     * 
+ * + * DEPLOYMENT_STATE_UNSPECIFIED = 0; + */ + public static final int DEPLOYMENT_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Model is deployed.
+     * 
+ * + * DEPLOYED = 1; + */ + public static final int DEPLOYED_VALUE = 1; + /** + * + * + *
+     * Model is not deployed.
+     * 
+ * + * UNDEPLOYED = 2; + */ + public static final int UNDEPLOYED_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 DeploymentState valueOf(int value) { + return forNumber(value); + } + + public static DeploymentState forNumber(int value) { + switch (value) { + case 0: + return DEPLOYMENT_STATE_UNSPECIFIED; + case 1: + return DEPLOYED; + case 2: + return UNDEPLOYED; + 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 DeploymentState findValueByNumber(int number) { + return DeploymentState.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.Model.getDescriptor().getEnumTypes().get(0); + } + + private static final DeploymentState[] VALUES = values(); + + public static DeploymentState 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 DeploymentState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1.Model.DeploymentState) + } + + private int bitField0_; + private int modelMetadataCase_ = 0; + private java.lang.Object modelMetadata_; + + public enum ModelMetadataCase implements com.google.protobuf.Internal.EnumLite { + TRANSLATION_MODEL_METADATA(15), + MODELMETADATA_NOT_SET(0); + private final int value; + + private ModelMetadataCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ModelMetadataCase valueOf(int value) { + return forNumber(value); + } + + public static ModelMetadataCase forNumber(int value) { + switch (value) { + case 15: + return TRANSLATION_MODEL_METADATA; + case 0: + return MODELMETADATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModelMetadataCase getModelMetadataCase() { + return ModelMetadataCase.forNumber(modelMetadataCase_); + } + + public static final int TRANSLATION_MODEL_METADATA_FIELD_NUMBER = 15; + /** + * + * + *
+   * 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 (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; + */ + public com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder + getTranslationModelMetadataOrBuilder() { + if (modelMetadataCase_ == 15) { + return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Resource name of the model.
+   * Format: `projects/{project_id}/locations/{location_id}/models/{model_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 model.
+   * Format: `projects/{project_id}/locations/{location_id}/models/{model_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 model to show in the interface. The name can 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. It must start with a letter.
+   * 
+ * + * 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 model to show in the interface. The name can 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. It must start with a letter.
+   * 
+ * + * 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 DATASET_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object datasetId_; + /** + * + * + *
+   * Required. The resource ID of the dataset used to create the model. The dataset must
+   * come from the same ancestor project and location.
+   * 
+ * + * string dataset_id = 3; + */ + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + 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(); + datasetId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource ID of the dataset used to create the model. The dataset must
+   * come from the same ancestor project and location.
+   * 
+ * + * string dataset_id = 3; + */ + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when the model training finished  and can be used for prediction.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the model training finished  and can be used for prediction.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the model training finished  and can be used for prediction.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Timestamp when this model was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when this model was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Timestamp when this model was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int DEPLOYMENT_STATE_FIELD_NUMBER = 8; + private int deploymentState_; + /** + * + * + *
+   * Output only. Deployment state of the model. A model can only serve
+   * prediction requests after it gets deployed.
+   * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + public int getDeploymentStateValue() { + return deploymentState_; + } + /** + * + * + *
+   * Output only. Deployment state of the model. A model can only serve
+   * prediction requests after it gets deployed.
+   * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + public com.google.cloud.automl.v1.Model.DeploymentState getDeploymentState() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.Model.DeploymentState result = + com.google.cloud.automl.v1.Model.DeploymentState.valueOf(deploymentState_); + return result == null ? com.google.cloud.automl.v1.Model.DeploymentState.UNRECOGNIZED : result; + } + + public static final int LABELS_FIELD_NUMBER = 34; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.automl.v1.ModelOuterClass + .internal_static_google_cloud_automl_v1_Model_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDatasetIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, datasetId_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (deploymentState_ + != com.google.cloud.automl.v1.Model.DeploymentState.DEPLOYMENT_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, deploymentState_); + } + if (updateTime_ != null) { + output.writeMessage(11, getUpdateTime()); + } + if (modelMetadataCase_ == 15) { + output.writeMessage(15, (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 34); + 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 (!getDatasetIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, datasetId_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (deploymentState_ + != com.google.cloud.automl.v1.Model.DeploymentState.DEPLOYMENT_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, deploymentState_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getUpdateTime()); + } + 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()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, labels__); + } + 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.Model)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.Model other = (com.google.cloud.automl.v1.Model) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDatasetId().equals(other.getDatasetId())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (deploymentState_ != other.deploymentState_) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getModelMetadataCase().equals(other.getModelMetadataCase())) return false; + switch (modelMetadataCase_) { + case 15: + if (!getTranslationModelMetadata().equals(other.getTranslationModelMetadata())) + 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(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DATASET_ID_FIELD_NUMBER; + hash = (53 * hash) + getDatasetId().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + DEPLOYMENT_STATE_FIELD_NUMBER; + hash = (53 * hash) + deploymentState_; + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + switch (modelMetadataCase_) { + case 15: + hash = (37 * hash) + TRANSLATION_MODEL_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTranslationModelMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.Model parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Model 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.Model parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Model 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.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Model 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.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Model 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.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Model 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.Model 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.Model 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.Model 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; + } + /** + * + * + *
+   * API proto representing a trained machine learning model.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.Model} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.Model) + com.google.cloud.automl.v1.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ModelOuterClass + .internal_static_google_cloud_automl_v1_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 34: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 34: + return internalGetMutableLabels(); + 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.ModelOuterClass + .internal_static_google_cloud_automl_v1_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Model.class, + com.google.cloud.automl.v1.Model.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.Model.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_ = ""; + + datasetId_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + deploymentState_ = 0; + + internalGetMutableLabels().clear(); + modelMetadataCase_ = 0; + modelMetadata_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ModelOuterClass + .internal_static_google_cloud_automl_v1_Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Model getDefaultInstanceForType() { + return com.google.cloud.automl.v1.Model.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.Model build() { + com.google.cloud.automl.v1.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Model buildPartial() { + com.google.cloud.automl.v1.Model result = new com.google.cloud.automl.v1.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (modelMetadataCase_ == 15) { + if (translationModelMetadataBuilder_ == null) { + result.modelMetadata_ = modelMetadata_; + } else { + result.modelMetadata_ = translationModelMetadataBuilder_.build(); + } + } + result.name_ = name_; + result.displayName_ = displayName_; + result.datasetId_ = datasetId_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.deploymentState_ = deploymentState_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.bitField0_ = to_bitField0_; + result.modelMetadataCase_ = modelMetadataCase_; + 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.Model) { + return mergeFrom((com.google.cloud.automl.v1.Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.Model other) { + if (other == com.google.cloud.automl.v1.Model.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDatasetId().isEmpty()) { + datasetId_ = other.datasetId_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.deploymentState_ != 0) { + setDeploymentStateValue(other.getDeploymentStateValue()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + switch (other.getModelMetadataCase()) { + case TRANSLATION_MODEL_METADATA: + { + mergeTranslationModelMetadata(other.getTranslationModelMetadata()); + break; + } + case MODELMETADATA_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.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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Resource name of the model.
+     * Format: `projects/{project_id}/locations/{location_id}/models/{model_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 model.
+     * Format: `projects/{project_id}/locations/{location_id}/models/{model_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 model.
+     * Format: `projects/{project_id}/locations/{location_id}/models/{model_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 model.
+     * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Resource name of the model.
+     * Format: `projects/{project_id}/locations/{location_id}/models/{model_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 model to show in the interface. The name can 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. It must start with a letter.
+     * 
+ * + * 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 model to show in the interface. The name can 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. It must start with a letter.
+     * 
+ * + * 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 model to show in the interface. The name can 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. It must start with a letter.
+     * 
+ * + * 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 model to show in the interface. The name can 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. It must start with a letter.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the model to show in the interface. The name can 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. It must start with a letter.
+     * 
+ * + * 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 java.lang.Object datasetId_ = ""; + /** + * + * + *
+     * Required. The resource ID of the dataset used to create the model. The dataset must
+     * come from the same ancestor project and location.
+     * 
+ * + * string dataset_id = 3; + */ + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource ID of the dataset used to create the model. The dataset must
+     * come from the same ancestor project and location.
+     * 
+ * + * string dataset_id = 3; + */ + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource ID of the dataset used to create the model. The dataset must
+     * come from the same ancestor project and location.
+     * 
+ * + * string dataset_id = 3; + */ + public Builder setDatasetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + datasetId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource ID of the dataset used to create the model. The dataset must
+     * come from the same ancestor project and location.
+     * 
+ * + * string dataset_id = 3; + */ + public Builder clearDatasetId() { + + datasetId_ = getDefaultInstance().getDatasetId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource ID of the dataset used to create the model. The dataset must
+     * come from the same ancestor project and location.
+     * 
+ * + * string dataset_id = 3; + */ + public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + datasetId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the model training finished  and can be used for prediction.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when this model was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private int deploymentState_ = 0; + /** + * + * + *
+     * Output only. Deployment state of the model. A model can only serve
+     * prediction requests after it gets deployed.
+     * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + public int getDeploymentStateValue() { + return deploymentState_; + } + /** + * + * + *
+     * Output only. Deployment state of the model. A model can only serve
+     * prediction requests after it gets deployed.
+     * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + public Builder setDeploymentStateValue(int value) { + deploymentState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Deployment state of the model. A model can only serve
+     * prediction requests after it gets deployed.
+     * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + public com.google.cloud.automl.v1.Model.DeploymentState getDeploymentState() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.Model.DeploymentState result = + com.google.cloud.automl.v1.Model.DeploymentState.valueOf(deploymentState_); + return result == null + ? com.google.cloud.automl.v1.Model.DeploymentState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Deployment state of the model. A model can only serve
+     * prediction requests after it gets deployed.
+     * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + public Builder setDeploymentState(com.google.cloud.automl.v1.Model.DeploymentState value) { + if (value == null) { + throw new NullPointerException(); + } + + deploymentState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Deployment state of the model. A model can only serve
+     * prediction requests after it gets deployed.
+     * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + public Builder clearDeploymentState() { + + deploymentState_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your model.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 34; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your model.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 34; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your model.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 34; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your model.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 34; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your model.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 34; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your model.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 34; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata to organize your model.
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     * Label values are optional. Label keys must start with a letter.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 34; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().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.Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.Model) + private static final com.google.cloud.automl.v1.Model DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.Model(); + } + + public static com.google.cloud.automl.v1.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(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.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..a4fc52a03 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluation.java @@ -0,0 +1,1552 @@ +/* + * 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/model_evaluation.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Evaluation results of a model.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ModelEvaluation} + */ +public final class ModelEvaluation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ModelEvaluation) + ModelEvaluationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ModelEvaluation.newBuilder() to construct. + private ModelEvaluation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ModelEvaluation() { + name_ = ""; + annotationSpecId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ModelEvaluation( + 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(); + + annotationSpecId_ = s; + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + evaluatedExampleCount_ = input.readInt32(); + break; + } + case 74: + { + com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder subBuilder = null; + if (metricsCase_ == 9) { + subBuilder = + ((com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_) + .toBuilder(); + } + metrics_ = + input.readMessage( + com.google.cloud.automl.v1.TranslationEvaluationMetrics.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_); + metrics_ = subBuilder.buildPartial(); + } + metricsCase_ = 9; + 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.ModelEvaluationOuterClass + .internal_static_google_cloud_automl_v1_ModelEvaluation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ModelEvaluationOuterClass + .internal_static_google_cloud_automl_v1_ModelEvaluation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ModelEvaluation.class, + com.google.cloud.automl.v1.ModelEvaluation.Builder.class); + } + + private int metricsCase_ = 0; + private java.lang.Object metrics_; + + public enum MetricsCase implements com.google.protobuf.Internal.EnumLite { + TRANSLATION_EVALUATION_METRICS(9), + METRICS_NOT_SET(0); + private final int value; + + private MetricsCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static MetricsCase valueOf(int value) { + return forNumber(value); + } + + public static MetricsCase forNumber(int value) { + switch (value) { + case 9: + return TRANSLATION_EVALUATION_METRICS; + case 0: + return METRICS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MetricsCase getMetricsCase() { + return MetricsCase.forNumber(metricsCase_); + } + + public static final int TRANSLATION_EVALUATION_METRICS_FIELD_NUMBER = 9; + /** + * + * + *
+   * 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 (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; + * + */ + public com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder + getTranslationEvaluationMetricsOrBuilder() { + if (metricsCase_ == 9) { + return (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Resource name of the model evaluation.
+   * Format:
+   * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_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 model evaluation.
+   * Format:
+   * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_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 ANNOTATION_SPEC_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object annotationSpecId_; + /** + * + * + *
+   * 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; + */ + 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 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; + */ + 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 CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when this model evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when this model evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Timestamp when this model evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int EVALUATED_EXAMPLE_COUNT_FIELD_NUMBER = 6; + private int evaluatedExampleCount_; + /** + * + * + *
+   * Output only. The number of examples used for model evaluation, i.e. for
+   * which ground truth from time of model creation is compared against the
+   * predicted annotations created by the model.
+   * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is
+   * 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].
+   * 
+ * + * int32 evaluated_example_count = 6; + */ + public int getEvaluatedExampleCount() { + return evaluatedExampleCount_; + } + + 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 (!getAnnotationSpecIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, annotationSpecId_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (evaluatedExampleCount_ != 0) { + output.writeInt32(6, evaluatedExampleCount_); + } + if (metricsCase_ == 9) { + output.writeMessage(9, (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_); + } + 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 (!getAnnotationSpecIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, annotationSpecId_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (evaluatedExampleCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, evaluatedExampleCount_); + } + if (metricsCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_); + } + 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.ModelEvaluation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ModelEvaluation other = + (com.google.cloud.automl.v1.ModelEvaluation) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAnnotationSpecId().equals(other.getAnnotationSpecId())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (getEvaluatedExampleCount() != other.getEvaluatedExampleCount()) return false; + if (!getMetricsCase().equals(other.getMetricsCase())) return false; + switch (metricsCase_) { + case 9: + if (!getTranslationEvaluationMetrics().equals(other.getTranslationEvaluationMetrics())) + 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(); + hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationSpecId().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + EVALUATED_EXAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getEvaluatedExampleCount(); + switch (metricsCase_) { + case 9: + hash = (37 * hash) + TRANSLATION_EVALUATION_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getTranslationEvaluationMetrics().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ModelEvaluation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ModelEvaluation 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.ModelEvaluation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ModelEvaluation 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.ModelEvaluation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ModelEvaluation 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.ModelEvaluation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ModelEvaluation 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.ModelEvaluation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ModelEvaluation 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.ModelEvaluation 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.ModelEvaluation 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.ModelEvaluation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Evaluation results of a model.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ModelEvaluation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ModelEvaluation) + com.google.cloud.automl.v1.ModelEvaluationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ModelEvaluationOuterClass + .internal_static_google_cloud_automl_v1_ModelEvaluation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ModelEvaluationOuterClass + .internal_static_google_cloud_automl_v1_ModelEvaluation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ModelEvaluation.class, + com.google.cloud.automl.v1.ModelEvaluation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ModelEvaluation.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_ = ""; + + annotationSpecId_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + evaluatedExampleCount_ = 0; + + metricsCase_ = 0; + metrics_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ModelEvaluationOuterClass + .internal_static_google_cloud_automl_v1_ModelEvaluation_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ModelEvaluation getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ModelEvaluation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ModelEvaluation build() { + com.google.cloud.automl.v1.ModelEvaluation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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_ == 9) { + if (translationEvaluationMetricsBuilder_ == null) { + result.metrics_ = metrics_; + } else { + result.metrics_ = translationEvaluationMetricsBuilder_.build(); + } + } + result.name_ = name_; + result.annotationSpecId_ = annotationSpecId_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.evaluatedExampleCount_ = evaluatedExampleCount_; + result.metricsCase_ = metricsCase_; + 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.ModelEvaluation) { + return mergeFrom((com.google.cloud.automl.v1.ModelEvaluation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ModelEvaluation other) { + if (other == com.google.cloud.automl.v1.ModelEvaluation.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAnnotationSpecId().isEmpty()) { + annotationSpecId_ = other.annotationSpecId_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.getEvaluatedExampleCount() != 0) { + setEvaluatedExampleCount(other.getEvaluatedExampleCount()); + } + switch (other.getMetricsCase()) { + case TRANSLATION_EVALUATION_METRICS: + { + mergeTranslationEvaluationMetrics(other.getTranslationEvaluationMetrics()); + break; + } + case METRICS_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.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.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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Resource name of the model evaluation.
+     * Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_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 model evaluation.
+     * Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_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 model evaluation.
+     * Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_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 model evaluation.
+     * Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Resource name of the model evaluation.
+     * Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_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 annotationSpecId_ = ""; + /** + * + * + *
+     * 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; + */ + 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 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; + */ + 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 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; + */ + public Builder setAnnotationSpecId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + annotationSpecId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder clearAnnotationSpecId() { + + annotationSpecId_ = getDefaultInstance().getAnnotationSpecId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder setAnnotationSpecIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + annotationSpecId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when this model evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int evaluatedExampleCount_; + /** + * + * + *
+     * Output only. The number of examples used for model evaluation, i.e. for
+     * which ground truth from time of model creation is compared against the
+     * predicted annotations created by the model.
+     * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is
+     * 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].
+     * 
+ * + * int32 evaluated_example_count = 6; + */ + public int getEvaluatedExampleCount() { + return evaluatedExampleCount_; + } + /** + * + * + *
+     * Output only. The number of examples used for model evaluation, i.e. for
+     * which ground truth from time of model creation is compared against the
+     * predicted annotations created by the model.
+     * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is
+     * 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].
+     * 
+ * + * int32 evaluated_example_count = 6; + */ + public Builder setEvaluatedExampleCount(int value) { + + evaluatedExampleCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of examples used for model evaluation, i.e. for
+     * which ground truth from time of model creation is compared against the
+     * predicted annotations created by the model.
+     * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is
+     * 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].
+     * 
+ * + * int32 evaluated_example_count = 6; + */ + public Builder clearEvaluatedExampleCount() { + + evaluatedExampleCount_ = 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.ModelEvaluation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ModelEvaluation) + private static final com.google.cloud.automl.v1.ModelEvaluation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ModelEvaluation(); + } + + public static com.google.cloud.automl.v1.ModelEvaluation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ModelEvaluation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ModelEvaluation(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.ModelEvaluation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationName.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationName.java new file mode 100644 index 000000000..5cc15edc5 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationName.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 ModelEvaluationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String model; + private final String modelEvaluation; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getModel() { + return model; + } + + public String getModelEvaluation() { + return modelEvaluation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ModelEvaluationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + model = Preconditions.checkNotNull(builder.getModel()); + modelEvaluation = Preconditions.checkNotNull(builder.getModelEvaluation()); + } + + public static ModelEvaluationName of( + String project, String location, String model, String modelEvaluation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setModel(model) + .setModelEvaluation(modelEvaluation) + .build(); + } + + public static String format( + String project, String location, String model, String modelEvaluation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setModel(model) + .setModelEvaluation(modelEvaluation) + .build() + .toString(); + } + + public static ModelEvaluationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ModelEvaluationName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("model"), + matchMap.get("model_evaluation")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ModelEvaluationName 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("model", model); + fieldMapBuilder.put("modelEvaluation", modelEvaluation); + 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, + "model", + model, + "model_evaluation", + modelEvaluation); + } + + /** Builder for ModelEvaluationName. */ + public static class Builder { + + private String project; + private String location; + private String model; + private String modelEvaluation; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getModel() { + return model; + } + + public String getModelEvaluation() { + return modelEvaluation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setModel(String model) { + this.model = model; + return this; + } + + public Builder setModelEvaluation(String modelEvaluation) { + this.modelEvaluation = modelEvaluation; + return this; + } + + private Builder() {} + + private Builder(ModelEvaluationName modelEvaluationName) { + project = modelEvaluationName.project; + location = modelEvaluationName.location; + model = modelEvaluationName.model; + modelEvaluation = modelEvaluationName.modelEvaluation; + } + + public ModelEvaluationName build() { + return new ModelEvaluationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ModelEvaluationName) { + ModelEvaluationName that = (ModelEvaluationName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.model.equals(that.model)) + && (this.modelEvaluation.equals(that.modelEvaluation)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= model.hashCode(); + h *= 1000003; + h ^= modelEvaluation.hashCode(); + return h; + } +} 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 new file mode 100644 index 000000000..1d35478fa --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOrBuilder.java @@ -0,0 +1,159 @@ +/* + * 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/model_evaluation.proto + +package com.google.cloud.automl.v1; + +public interface ModelEvaluationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ModelEvaluation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Model evaluation metrics for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + boolean hasTranslationEvaluationMetrics(); + /** + * + * + *
+   * Model evaluation metrics for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + com.google.cloud.automl.v1.TranslationEvaluationMetrics getTranslationEvaluationMetrics(); + /** + * + * + *
+   * Model evaluation metrics for translation.
+   * 
+ * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder + getTranslationEvaluationMetricsOrBuilder(); + + /** + * + * + *
+   * Output only. Resource name of the model evaluation.
+   * Format:
+   * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Resource name of the model evaluation.
+   * Format:
+   * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}`
+   * 
+ * + * string name = 1; + */ + 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.
+   * 
+ * + * string annotation_spec_id = 2; + */ + 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.
+   * 
+ * + * string annotation_spec_id = 2; + */ + com.google.protobuf.ByteString getAnnotationSpecIdBytes(); + + /** + * + * + *
+   * Output only. Timestamp when this model evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when this model evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when this model evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The number of examples used for model evaluation, i.e. for
+   * which ground truth from time of model creation is compared against the
+   * predicted annotations created by the model.
+   * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is
+   * 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].
+   * 
+ * + * int32 evaluated_example_count = 6; + */ + int getEvaluatedExampleCount(); + + public com.google.cloud.automl.v1.ModelEvaluation.MetricsCase getMetricsCase(); +} 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 new file mode 100644 index 000000000..3ff72783f --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOuterClass.java @@ -0,0 +1,95 @@ +/* + * 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/model_evaluation.proto + +package com.google.cloud.automl.v1; + +public final class ModelEvaluationOuterClass { + private ModelEvaluationOuterClass() {} + + 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_ModelEvaluation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ModelEvaluation_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/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 fieldValuesMap; + + private final String project; + private final String location; + private final String model; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getModel() { + return model; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ModelName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + model = Preconditions.checkNotNull(builder.getModel()); + } + + public static ModelName of(String project, String location, String model) { + return newBuilder().setProject(project).setLocation(location).setModel(model).build(); + } + + public static String format(String project, String location, String model) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setModel(model) + .build() + .toString(); + } + + public static ModelName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ModelName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("model")); + } + + 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 (ModelName 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("model", model); + 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, "model", model); + } + + /** Builder for ModelName. */ + public static class Builder { + + private String project; + private String location; + private String model; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getModel() { + return model; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setModel(String model) { + this.model = model; + return this; + } + + private Builder() {} + + private Builder(ModelName modelName) { + project = modelName.project; + location = modelName.location; + model = modelName.model; + } + + public ModelName build() { + return new ModelName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ModelName) { + ModelName that = (ModelName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.model.equals(that.model)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= model.hashCode(); + return h; + } +} 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 new file mode 100644 index 000000000..4bd166f97 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOrBuilder.java @@ -0,0 +1,296 @@ +/* + * 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/model.proto + +package com.google.cloud.automl.v1; + +public interface ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + */ + boolean hasTranslationModelMetadata(); + /** + * + * + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + */ + com.google.cloud.automl.v1.TranslationModelMetadata getTranslationModelMetadata(); + /** + * + * + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + */ + com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder + getTranslationModelMetadataOrBuilder(); + + /** + * + * + *
+   * Output only. Resource name of the model.
+   * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Resource name of the model.
+   * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The name of the model to show in the interface. The name can 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. It must start with a letter.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The name of the model to show in the interface. The name can 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. It must start with a letter.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. The resource ID of the dataset used to create the model. The dataset must
+   * come from the same ancestor project and location.
+   * 
+ * + * string dataset_id = 3; + */ + java.lang.String getDatasetId(); + /** + * + * + *
+   * Required. The resource ID of the dataset used to create the model. The dataset must
+   * come from the same ancestor project and location.
+   * 
+ * + * string dataset_id = 3; + */ + com.google.protobuf.ByteString getDatasetIdBytes(); + + /** + * + * + *
+   * Output only. Timestamp when the model training finished  and can be used for prediction.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the model training finished  and can be used for prediction.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the model training finished  and can be used for prediction.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when this model was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when this model was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when this model was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Deployment state of the model. A model can only serve
+   * prediction requests after it gets deployed.
+   * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + int getDeploymentStateValue(); + /** + * + * + *
+   * Output only. Deployment state of the model. A model can only serve
+   * prediction requests after it gets deployed.
+   * 
+ * + * .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + com.google.cloud.automl.v1.Model.DeploymentState getDeploymentState(); + + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. The labels with user-defined metadata to organize your model.
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   * Label values are optional. Label keys must start with a letter.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 34; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + public com.google.cloud.automl.v1.Model.ModelMetadataCase getModelMetadataCase(); +} 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 new file mode 100644 index 000000000..e9c67bb40 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOuterClass.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/model.proto + +package com.google.cloud.automl.v1; + +public final class ModelOuterClass { + private ModelOuterClass() {} + + 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_Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_Model_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_Model_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_Model_LabelsEntry_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/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 + * Metadata used across all long running operations returned by AutoML API. + * + * + * Protobuf type {@code google.cloud.automl.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + partialFailures_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + 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_ & 0x00000008) != 0)) { + partialFailures_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + partialFailures_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.cloud.automl.v1.DeleteOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 8) { + subBuilder = + ((com.google.cloud.automl.v1.DeleteOperationMetadata) details_).toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.DeleteOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.DeleteOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 8; + break; + } + case 82: + { + com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 10) { + subBuilder = + ((com.google.cloud.automl.v1.CreateModelOperationMetadata) details_) + .toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.CreateModelOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 10; + break; + } + case 104: + { + progressPercent_ = 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_ & 0x00000008) != 0)) { + partialFailures_ = java.util.Collections.unmodifiableList(partialFailures_); + } + 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_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.OperationMetadata.class, + com.google.cloud.automl.v1.OperationMetadata.Builder.class); + } + + private int bitField0_; + private int detailsCase_ = 0; + private java.lang.Object details_; + + public enum DetailsCase implements com.google.protobuf.Internal.EnumLite { + DELETE_DETAILS(8), + CREATE_MODEL_DETAILS(10), + DETAILS_NOT_SET(0); + private final int value; + + private DetailsCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DetailsCase valueOf(int value) { + return forNumber(value); + } + + public static DetailsCase forNumber(int value) { + switch (value) { + case 8: + return DELETE_DETAILS; + case 10: + return CREATE_MODEL_DETAILS; + case 0: + return DETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DetailsCase getDetailsCase() { + return DetailsCase.forNumber(detailsCase_); + } + + public static final int DELETE_DETAILS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Details of a Delete operation.
+   * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public boolean hasDeleteDetails() { + return detailsCase_ == 8; + } + /** + * + * + *
+   * Details of a Delete operation.
+   * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public com.google.cloud.automl.v1.DeleteOperationMetadata getDeleteDetails() { + if (detailsCase_ == 8) { + return (com.google.cloud.automl.v1.DeleteOperationMetadata) details_; + } + return com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Details of a Delete operation.
+   * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder getDeleteDetailsOrBuilder() { + if (detailsCase_ == 8) { + return (com.google.cloud.automl.v1.DeleteOperationMetadata) details_; + } + return com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance(); + } + + public static final int CREATE_MODEL_DETAILS_FIELD_NUMBER = 10; + /** + * + * + *
+   * 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 (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; + */ + public com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder + getCreateModelDetailsOrBuilder() { + if (detailsCase_ == 10) { + return (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.CreateModelOperationMetadata.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) { + output.writeMessage(4, getUpdateTime()); + } + if (detailsCase_ == 8) { + output.writeMessage(8, (com.google.cloud.automl.v1.DeleteOperationMetadata) details_); + } + if (detailsCase_ == 10) { + output.writeMessage(10, (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_); + } + if (progressPercent_ != 0) { + output.writeInt32(13, progressPercent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < partialFailures_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, partialFailures_.get(i)); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + if (detailsCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.automl.v1.DeleteOperationMetadata) details_); + } + if (detailsCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_); + } + if (progressPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(13, progressPercent_); + } + 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.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.OperationMetadata other = + (com.google.cloud.automl.v1.OperationMetadata) obj; + + if (getProgressPercent() != other.getProgressPercent()) return false; + if (!getPartialFailuresList().equals(other.getPartialFailuresList())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getDetailsCase().equals(other.getDetailsCase())) return false; + switch (detailsCase_) { + case 8: + if (!getDeleteDetails().equals(other.getDeleteDetails())) return false; + break; + case 10: + if (!getCreateModelDetails().equals(other.getCreateModelDetails())) 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) + PROGRESS_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercent(); + if (getPartialFailuresCount() > 0) { + hash = (37 * hash) + PARTIAL_FAILURES_FIELD_NUMBER; + hash = (53 * hash) + getPartialFailuresList().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + switch (detailsCase_) { + case 8: + hash = (37 * hash) + DELETE_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDeleteDetails().hashCode(); + break; + case 10: + hash = (37 * hash) + CREATE_MODEL_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getCreateModelDetails().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.OperationMetadata 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.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.OperationMetadata 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.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.OperationMetadata 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.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.OperationMetadata 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.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.OperationMetadata 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.OperationMetadata 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.OperationMetadata 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.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata used across all long running operations returned by AutoML API.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.OperationMetadata) + com.google.cloud.automl.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.OperationMetadata.class, + com.google.cloud.automl.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPartialFailuresFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + progressPercent_ = 0; + + if (partialFailuresBuilder_ == null) { + partialFailures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + partialFailuresBuilder_.clear(); + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + detailsCase_ = 0; + details_ = 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_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.OperationMetadata build() { + com.google.cloud.automl.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.OperationMetadata buildPartial() { + com.google.cloud.automl.v1.OperationMetadata result = + new com.google.cloud.automl.v1.OperationMetadata(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (detailsCase_ == 8) { + if (deleteDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = deleteDetailsBuilder_.build(); + } + } + if (detailsCase_ == 10) { + if (createModelDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = createModelDetailsBuilder_.build(); + } + } + result.progressPercent_ = progressPercent_; + if (partialFailuresBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + partialFailures_ = java.util.Collections.unmodifiableList(partialFailures_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.partialFailures_ = partialFailures_; + } else { + result.partialFailures_ = partialFailuresBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + result.detailsCase_ = detailsCase_; + 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.OperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.OperationMetadata other) { + if (other == com.google.cloud.automl.v1.OperationMetadata.getDefaultInstance()) return this; + if (other.getProgressPercent() != 0) { + setProgressPercent(other.getProgressPercent()); + } + if (partialFailuresBuilder_ == null) { + if (!other.partialFailures_.isEmpty()) { + if (partialFailures_.isEmpty()) { + partialFailures_ = other.partialFailures_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePartialFailuresIsMutable(); + partialFailures_.addAll(other.partialFailures_); + } + onChanged(); + } + } else { + if (!other.partialFailures_.isEmpty()) { + if (partialFailuresBuilder_.isEmpty()) { + partialFailuresBuilder_.dispose(); + partialFailuresBuilder_ = null; + partialFailures_ = other.partialFailures_; + bitField0_ = (bitField0_ & ~0x00000008); + partialFailuresBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPartialFailuresFieldBuilder() + : null; + } else { + partialFailuresBuilder_.addAllMessages(other.partialFailures_); + } + } + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getDetailsCase()) { + case DELETE_DETAILS: + { + mergeDeleteDetails(other.getDeleteDetails()); + break; + } + case CREATE_MODEL_DETAILS: + { + mergeCreateModelDetails(other.getCreateModelDetails()); + break; + } + case DETAILS_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.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int detailsCase_ = 0; + private java.lang.Object details_; + + public DetailsCase getDetailsCase() { + return DetailsCase.forNumber(detailsCase_); + } + + public Builder clearDetails() { + detailsCase_ = 0; + details_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DeleteOperationMetadata, + com.google.cloud.automl.v1.DeleteOperationMetadata.Builder, + com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder> + deleteDetailsBuilder_; + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public boolean hasDeleteDetails() { + return detailsCase_ == 8; + } + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public com.google.cloud.automl.v1.DeleteOperationMetadata getDeleteDetails() { + if (deleteDetailsBuilder_ == null) { + if (detailsCase_ == 8) { + return (com.google.cloud.automl.v1.DeleteOperationMetadata) details_; + } + return com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 8) { + return deleteDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public Builder setDeleteDetails(com.google.cloud.automl.v1.DeleteOperationMetadata value) { + if (deleteDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + deleteDetailsBuilder_.setMessage(value); + } + detailsCase_ = 8; + return this; + } + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public Builder setDeleteDetails( + com.google.cloud.automl.v1.DeleteOperationMetadata.Builder builderForValue) { + if (deleteDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + deleteDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 8; + return this; + } + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public Builder mergeDeleteDetails(com.google.cloud.automl.v1.DeleteOperationMetadata value) { + if (deleteDetailsBuilder_ == null) { + if (detailsCase_ == 8 + && details_ + != com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance()) { + details_ = + com.google.cloud.automl.v1.DeleteOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.DeleteOperationMetadata) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 8) { + deleteDetailsBuilder_.mergeFrom(value); + } + deleteDetailsBuilder_.setMessage(value); + } + detailsCase_ = 8; + return this; + } + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public Builder clearDeleteDetails() { + if (deleteDetailsBuilder_ == null) { + if (detailsCase_ == 8) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 8) { + detailsCase_ = 0; + details_ = null; + } + deleteDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public com.google.cloud.automl.v1.DeleteOperationMetadata.Builder getDeleteDetailsBuilder() { + return getDeleteDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + public com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder getDeleteDetailsOrBuilder() { + if ((detailsCase_ == 8) && (deleteDetailsBuilder_ != null)) { + return deleteDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 8) { + return (com.google.cloud.automl.v1.DeleteOperationMetadata) details_; + } + return com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of a Delete operation.
+     * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DeleteOperationMetadata, + com.google.cloud.automl.v1.DeleteOperationMetadata.Builder, + com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder> + getDeleteDetailsFieldBuilder() { + if (deleteDetailsBuilder_ == null) { + if (!(detailsCase_ == 8)) { + details_ = com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance(); + } + deleteDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DeleteOperationMetadata, + com.google.cloud.automl.v1.DeleteOperationMetadata.Builder, + com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.DeleteOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 8; + onChanged(); + ; + return deleteDetailsBuilder_; + } + + 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 int progressPercent_; + /** + * + * + *
+     * Output only. Progress of operation. Range: [0, 100].
+     * Not used currently.
+     * 
+ * + * int32 progress_percent = 13; + */ + public int getProgressPercent() { + return progressPercent_; + } + /** + * + * + *
+     * Output only. Progress of operation. Range: [0, 100].
+     * Not used currently.
+     * 
+ * + * int32 progress_percent = 13; + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Progress of operation. Range: [0, 100].
+     * Not used currently.
+     * 
+ * + * int32 progress_percent = 13; + */ + public Builder clearProgressPercent() { + + progressPercent_ = 0; + onChanged(); + return this; + } + + private java.util.List partialFailures_ = + java.util.Collections.emptyList(); + + private void ensurePartialFailuresIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + partialFailures_ = new java.util.ArrayList(partialFailures_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + partialFailuresBuilder_; + + /** + * + * + *
+     * 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() { + if (partialFailuresBuilder_ == null) { + return java.util.Collections.unmodifiableList(partialFailures_); + } else { + return partialFailuresBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * 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() { + if (partialFailuresBuilder_ == null) { + return partialFailures_.size(); + } else { + return partialFailuresBuilder_.getCount(); + } + } + /** + * + * + *
+     * 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) { + if (partialFailuresBuilder_ == null) { + return partialFailures_.get(index); + } else { + return partialFailuresBuilder_.getMessage(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 Builder setPartialFailures(int index, com.google.rpc.Status value) { + if (partialFailuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialFailuresIsMutable(); + partialFailures_.set(index, value); + onChanged(); + } else { + partialFailuresBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * 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 Builder setPartialFailures(int index, com.google.rpc.Status.Builder builderForValue) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.set(index, builderForValue.build()); + onChanged(); + } else { + partialFailuresBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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 Builder addPartialFailures(com.google.rpc.Status value) { + if (partialFailuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialFailuresIsMutable(); + partialFailures_.add(value); + onChanged(); + } else { + partialFailuresBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * 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 Builder addPartialFailures(int index, com.google.rpc.Status value) { + if (partialFailuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialFailuresIsMutable(); + partialFailures_.add(index, value); + onChanged(); + } else { + partialFailuresBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * 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 Builder addPartialFailures(com.google.rpc.Status.Builder builderForValue) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.add(builderForValue.build()); + onChanged(); + } else { + partialFailuresBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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 Builder addPartialFailures(int index, com.google.rpc.Status.Builder builderForValue) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.add(index, builderForValue.build()); + onChanged(); + } else { + partialFailuresBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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 Builder addAllPartialFailures( + java.lang.Iterable values) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, partialFailures_); + onChanged(); + } else { + partialFailuresBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * 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 Builder clearPartialFailures() { + if (partialFailuresBuilder_ == null) { + partialFailures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + partialFailuresBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * 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 Builder removePartialFailures(int index) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.remove(index); + onChanged(); + } else { + partialFailuresBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * 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.Builder getPartialFailuresBuilder(int index) { + return getPartialFailuresFieldBuilder().getBuilder(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) { + if (partialFailuresBuilder_ == null) { + return partialFailures_.get(index); + } else { + return partialFailuresBuilder_.getMessageOrBuilder(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 java.util.List + getPartialFailuresOrBuilderList() { + if (partialFailuresBuilder_ != null) { + return partialFailuresBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(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 com.google.rpc.Status.Builder addPartialFailuresBuilder() { + return getPartialFailuresFieldBuilder() + .addBuilder(com.google.rpc.Status.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.
+     * 
+ * + * repeated .google.rpc.Status partial_failures = 2; + */ + public com.google.rpc.Status.Builder addPartialFailuresBuilder(int index) { + return getPartialFailuresFieldBuilder() + .addBuilder(index, com.google.rpc.Status.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.
+     * 
+ * + * repeated .google.rpc.Status partial_failures = 2; + */ + public java.util.List getPartialFailuresBuilderList() { + return getPartialFailuresFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getPartialFailuresFieldBuilder() { + if (partialFailuresBuilder_ == null) { + partialFailuresBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + partialFailures_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + partialFailures_ = null; + } + return partialFailuresBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || 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() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.OperationMetadata) + private static final com.google.cloud.automl.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.OperationMetadata(); + } + + public static com.google.cloud.automl.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(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.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..b590babc5 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,229 @@ +/* + * 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 OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Details of a Delete operation.
+   * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + boolean hasDeleteDetails(); + /** + * + * + *
+   * Details of a Delete operation.
+   * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + com.google.cloud.automl.v1.DeleteOperationMetadata getDeleteDetails(); + /** + * + * + *
+   * Details of a Delete operation.
+   * 
+ * + * .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + */ + com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder getDeleteDetailsOrBuilder(); + + /** + * + * + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + boolean hasCreateModelDetails(); + /** + * + * + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + com.google.cloud.automl.v1.CreateModelOperationMetadata getCreateModelDetails(); + /** + * + * + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder getCreateModelDetailsOrBuilder(); + + /** + * + * + *
+   * Output only. Progress of operation. Range: [0, 100].
+   * Not used currently.
+   * 
+ * + * int32 progress_percent = 13; + */ + int getProgressPercent(); + + /** + * + * + *
+   * 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; + */ + java.util.List getPartialFailuresList(); + /** + * + * + *
+   * 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; + */ + com.google.rpc.Status getPartialFailures(int 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; + */ + int getPartialFailuresCount(); + /** + * + * + *
+   * 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; + */ + java.util.List getPartialFailuresOrBuilderList(); + /** + * + * + *
+   * 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; + */ + com.google.rpc.StatusOrBuilder getPartialFailuresOrBuilder(int index); + + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + public com.google.cloud.automl.v1.OperationMetadata.DetailsCase getDetailsCase(); +} 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 new file mode 100644 index 000000000..85f5d7f14 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Operations.java @@ -0,0 +1,137 @@ +/* + * 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 final class Operations { + private Operations() {} + + 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_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_CreateModelOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_CreateModelOperationMetadata_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/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/google/cloud/auto" + + "ml/v1/prediction_service.proto\032$google/c" + + "loud/automl/v1/service.proto\032\033google/pro" + + "tobuf/empty.proto\032\037google/protobuf/times" + + "tamp.proto\032\027google/rpc/status.proto\032\034goo" + + "gle/api/annotations.proto\"\351\002\n\021OperationM" + + "etadata\022I\n\016delete_details\030\010 \001(\0132/.google" + + ".cloud.automl.v1.DeleteOperationMetadata" + + "H\000\022T\n\024create_model_details\030\n \001(\01324.googl" + + "e.cloud.automl.v1.CreateModelOperationMe" + + "tadataH\000\022\030\n\020progress_percent\030\r \001(\005\022,\n\020pa" + + "rtial_failures\030\002 \003(\0132\022.google.rpc.Status" + + "\022/\n\013create_time\030\003 \001(\0132\032.google.protobuf." + + "Timestamp\022/\n\013update_time\030\004 \001(\0132\032.google." + + "protobuf.TimestampB\t\n\007details\"\031\n\027DeleteO" + + "perationMetadata\"\036\n\034CreateModelOperation" + + "MetadataB\252\001\n\032com.google.cloud.automl.v1P" + + "\001Z + * * 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} + */ +public final class OutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.OutputConfig) + OutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputConfig.newBuilder() to construct. + private OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputConfig() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OutputConfig( + 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_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.OutputConfig.class, + com.google.cloud.automl.v1.OutputConfig.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; + /** + * + * + *
+   * 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:
+   * 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; + */ + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * 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:
+   * 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; + */ + 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(); + } + /** + * + * + *
+   * 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:
+   * 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; + */ + 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.OutputConfig)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.OutputConfig other = (com.google.cloud.automl.v1.OutputConfig) 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.OutputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.OutputConfig 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.OutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.OutputConfig 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.OutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.OutputConfig 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.OutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.OutputConfig 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.OutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.OutputConfig 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.OutputConfig 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.OutputConfig 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.OutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * *  For 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} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.OutputConfig) + com.google.cloud.automl.v1.OutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.OutputConfig.class, + com.google.cloud.automl.v1.OutputConfig.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.OutputConfig.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_OutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.OutputConfig getDefaultInstanceForType() { + return com.google.cloud.automl.v1.OutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.OutputConfig build() { + com.google.cloud.automl.v1.OutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.OutputConfig buildPartial() { + com.google.cloud.automl.v1.OutputConfig result = + new com.google.cloud.automl.v1.OutputConfig(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.OutputConfig) { + return mergeFrom((com.google.cloud.automl.v1.OutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.OutputConfig other) { + if (other == com.google.cloud.automl.v1.OutputConfig.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.OutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.OutputConfig) 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_; + /** + * + * + *
+     * 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:
+     * 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; + */ + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * 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:
+     * 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; + */ + 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(); + } + } + /** + * + * + *
+     * 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:
+     * 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; + */ + 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; + } + /** + * + * + *
+     * 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:
+     * 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; + */ + 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; + } + /** + * + * + *
+     * 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:
+     * 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; + */ + 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; + } + /** + * + * + *
+     * 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:
+     * 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; + */ + 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; + } + /** + * + * + *
+     * 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:
+     * 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; + */ + public com.google.cloud.automl.v1.GcsDestination.Builder getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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:
+     * 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; + */ + 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(); + } + } + /** + * + * + *
+     * 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:
+     * 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; + */ + 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.OutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.OutputConfig) + private static final com.google.cloud.automl.v1.OutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.OutputConfig(); + } + + public static com.google.cloud.automl.v1.OutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OutputConfig(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.OutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..d6f7b9c4d --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OutputConfigOrBuilder.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/io.proto + +package com.google.cloud.automl.v1; + +public interface OutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.OutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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:
+   * 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; + */ + 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:
+   * 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; + */ + 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:
+   * 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; + */ + com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + public com.google.cloud.automl.v1.OutputConfig.DestinationCase getDestinationCase(); +} 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 new file mode 100644 index 000000000..1af62b0b8 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequest.java @@ -0,0 +1,1216 @@ +/* + * 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.Predict][google.cloud.automl.v1.PredictionService.Predict].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.PredictRequest} + */ +public final class PredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.PredictRequest) + PredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictRequest.newBuilder() to construct. + private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictRequest( + 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.ExamplePayload.Builder subBuilder = null; + if (payload_ != null) { + subBuilder = payload_.toBuilder(); + } + payload_ = + input.readMessage( + com.google.cloud.automl.v1.ExamplePayload.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(payload_); + payload_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + 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; + } + 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_PredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + 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_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.PredictRequest.class, + com.google.cloud.automl.v1.PredictRequest.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 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 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 PAYLOAD_FIELD_NUMBER = 2; + private com.google.cloud.automl.v1.ExamplePayload payload_; + /** + * + * + *
+   * Required. Payload to perform a prediction on. The payload must match the
+   * problem type that the model was trained to solve.
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public boolean hasPayload() { + return payload_ != null; + } + /** + * + * + *
+   * Required. Payload to perform a prediction on. The payload must match the
+   * problem type that the model was trained to solve.
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1.ExamplePayload getPayload() { + return payload_ == null + ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance() + : payload_; + } + /** + * + * + *
+   * Required. Payload to perform a prediction on. The payload must match the
+   * problem type that the model was trained to solve.
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPayloadOrBuilder() { + return getPayload(); + } + + public static final int PARAMS_FIELD_NUMBER = 3; + + 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_PredictRequest_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, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + 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, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + 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, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + 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 (payload_ != null) { + output.writeMessage(2, getPayload()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 3); + 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 (payload_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPayload()); + } + 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(3, 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.PredictRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.PredictRequest other = + (com.google.cloud.automl.v1.PredictRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasPayload() != other.hasPayload()) return false; + if (hasPayload()) { + if (!getPayload().equals(other.getPayload())) 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 (hasPayload()) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().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.PredictRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.PredictRequest 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.PredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.PredictRequest 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.PredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.PredictRequest 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.PredictRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.PredictRequest 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.PredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.PredictRequest 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.PredictRequest 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.PredictRequest 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.PredictRequest 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.Predict][google.cloud.automl.v1.PredictionService.Predict].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.PredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.PredictRequest) + com.google.cloud.automl.v1.PredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_PredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + 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_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.PredictRequest.class, + com.google.cloud.automl.v1.PredictRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.PredictRequest.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 (payloadBuilder_ == null) { + payload_ = null; + } else { + payload_ = null; + payloadBuilder_ = 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_PredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.PredictRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.PredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.PredictRequest build() { + com.google.cloud.automl.v1.PredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.PredictRequest buildPartial() { + com.google.cloud.automl.v1.PredictRequest result = + new com.google.cloud.automl.v1.PredictRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (payloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = payloadBuilder_.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.PredictRequest) { + return mergeFrom((com.google.cloud.automl.v1.PredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.PredictRequest other) { + if (other == com.google.cloud.automl.v1.PredictRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasPayload()) { + mergePayload(other.getPayload()); + } + 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.PredictRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.PredictRequest) 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 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 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 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 prediction.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the model requested to serve the 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.ExamplePayload payload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExamplePayload, + com.google.cloud.automl.v1.ExamplePayload.Builder, + com.google.cloud.automl.v1.ExamplePayloadOrBuilder> + payloadBuilder_; + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public boolean hasPayload() { + return payloadBuilder_ != null || payload_ != null; + } + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1.ExamplePayload getPayload() { + if (payloadBuilder_ == null) { + return payload_ == null + ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance() + : payload_; + } else { + return payloadBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public Builder setPayload(com.google.cloud.automl.v1.ExamplePayload value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + payloadBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public Builder setPayload(com.google.cloud.automl.v1.ExamplePayload.Builder builderForValue) { + if (payloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public Builder mergePayload(com.google.cloud.automl.v1.ExamplePayload value) { + if (payloadBuilder_ == null) { + if (payload_ != null) { + payload_ = + com.google.cloud.automl.v1.ExamplePayload.newBuilder(payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + payloadBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public Builder clearPayload() { + if (payloadBuilder_ == null) { + payload_ = null; + onChanged(); + } else { + payload_ = null; + payloadBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1.ExamplePayload.Builder getPayloadBuilder() { + + onChanged(); + return getPayloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPayloadOrBuilder() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + return payload_ == null + ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance() + : payload_; + } + } + /** + * + * + *
+     * Required. Payload to perform a prediction on. The payload must match the
+     * problem type that the model was trained to solve.
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExamplePayload, + com.google.cloud.automl.v1.ExamplePayload.Builder, + com.google.cloud.automl.v1.ExamplePayloadOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExamplePayload, + com.google.cloud.automl.v1.ExamplePayload.Builder, + com.google.cloud.automl.v1.ExamplePayloadOrBuilder>( + getPayload(), getParentForChildren(), isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + 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, any string must be up to 25000
+     * characters long.
+     * 
+ * + * map<string, string> params = 3; + */ + 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, any string must be up to 25000
+     * characters long.
+     * 
+ * + * map<string, string> params = 3; + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Additional domain-specific parameters, any string must be up to 25000
+     * characters long.
+     * 
+ * + * map<string, string> params = 3; + */ + 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, any string must be up to 25000
+     * characters long.
+     * 
+ * + * map<string, string> params = 3; + */ + 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, any string must be up to 25000
+     * characters long.
+     * 
+ * + * map<string, string> params = 3; + */ + 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, any string must be up to 25000
+     * characters long.
+     * 
+ * + * map<string, string> params = 3; + */ + 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, any string must be up to 25000
+     * characters long.
+     * 
+ * + * map<string, string> params = 3; + */ + 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.PredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.PredictRequest) + private static final com.google.cloud.automl.v1.PredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.PredictRequest(); + } + + public static com.google.cloud.automl.v1.PredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictRequest(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.PredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..6623665b7 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequestOrBuilder.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/prediction_service.proto + +package com.google.cloud.automl.v1; + +public interface PredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.PredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the model requested to serve the prediction.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the model requested to serve the prediction.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Payload to perform a prediction on. The payload must match the
+   * problem type that the model was trained to solve.
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + boolean hasPayload(); + /** + * + * + *
+   * Required. Payload to perform a prediction on. The payload must match the
+   * problem type that the model was trained to solve.
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + com.google.cloud.automl.v1.ExamplePayload getPayload(); + /** + * + * + *
+   * Required. Payload to perform a prediction on. The payload must match the
+   * problem type that the model was trained to solve.
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload payload = 2; + */ + com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPayloadOrBuilder(); + + /** + * + * + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + int getParamsCount(); + /** + * + * + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + boolean containsParams(java.lang.String key); + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + /** + * + * + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + java.lang.String getParamsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * 
+ * + * map<string, string> params = 3; + */ + java.lang.String getParamsOrThrow(java.lang.String key); +} 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 new file mode 100644 index 000000000..c811b5dc7 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponse.java @@ -0,0 +1,1274 @@ +/* + * 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; + +/** + * + * + *
+ * Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.PredictResponse} + */ +public final class PredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.PredictResponse) + PredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictResponse.newBuilder() to construct. + private PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictResponse() { + payload_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictResponse( + 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)) { + payload_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + payload_.add( + input.readMessage( + com.google.cloud.automl.v1.AnnotationPayload.parser(), extensionRegistry)); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + payload_ = java.util.Collections.unmodifiableList(payload_); + } + 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_PredictResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + 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_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.PredictResponse.class, + com.google.cloud.automl.v1.PredictResponse.Builder.class); + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private java.util.List payload_; + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public java.util.List getPayloadList() { + return payload_; + } + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public java.util.List + getPayloadOrBuilderList() { + return payload_; + } + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public int getPayloadCount() { + return payload_.size(); + } + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1.AnnotationPayload getPayload(int index) { + return payload_.get(index); + } + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index) { + return payload_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 2; + + 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_PredictResponse_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.
+   * 
+ * + * map<string, string> metadata = 2; + */ + 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.
+   * 
+ * + * map<string, string> metadata = 2; + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * 
+ * + * map<string, string> metadata = 2; + */ + 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.
+   * 
+ * + * map<string, string> metadata = 2; + */ + 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 { + for (int i = 0; i < payload_.size(); i++) { + output.writeMessage(1, payload_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < payload_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, payload_.get(i)); + } + 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(2, 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.PredictResponse)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.PredictResponse other = + (com.google.cloud.automl.v1.PredictResponse) obj; + + if (!getPayloadList().equals(other.getPayloadList())) return false; + 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 (getPayloadCount() > 0) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayloadList().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.PredictResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.PredictResponse 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.PredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.PredictResponse 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.PredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.PredictResponse 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.PredictResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.PredictResponse 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.PredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.PredictResponse 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.PredictResponse 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.PredictResponse 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.PredictResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.PredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.PredictResponse) + com.google.cloud.automl.v1.PredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_PredictResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + 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_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.PredictResponse.class, + com.google.cloud.automl.v1.PredictResponse.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.PredictResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPayloadFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (payloadBuilder_ == null) { + payload_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + payloadBuilder_.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_PredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.PredictResponse getDefaultInstanceForType() { + return com.google.cloud.automl.v1.PredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.PredictResponse build() { + com.google.cloud.automl.v1.PredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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_; + if (payloadBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + payload_ = java.util.Collections.unmodifiableList(payload_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.payload_ = payload_; + } else { + result.payload_ = payloadBuilder_.build(); + } + 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.PredictResponse) { + return mergeFrom((com.google.cloud.automl.v1.PredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.PredictResponse other) { + if (other == com.google.cloud.automl.v1.PredictResponse.getDefaultInstance()) return this; + if (payloadBuilder_ == null) { + if (!other.payload_.isEmpty()) { + if (payload_.isEmpty()) { + payload_ = other.payload_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePayloadIsMutable(); + payload_.addAll(other.payload_); + } + onChanged(); + } + } else { + if (!other.payload_.isEmpty()) { + if (payloadBuilder_.isEmpty()) { + payloadBuilder_.dispose(); + payloadBuilder_ = null; + payload_ = other.payload_; + bitField0_ = (bitField0_ & ~0x00000001); + payloadBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPayloadFieldBuilder() + : null; + } else { + payloadBuilder_.addAllMessages(other.payload_); + } + } + } + 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.PredictResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.PredictResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List payload_ = + java.util.Collections.emptyList(); + + private void ensurePayloadIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + payload_ = new java.util.ArrayList(payload_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.AnnotationPayload, + com.google.cloud.automl.v1.AnnotationPayload.Builder, + com.google.cloud.automl.v1.AnnotationPayloadOrBuilder> + payloadBuilder_; + + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public java.util.List getPayloadList() { + if (payloadBuilder_ == null) { + return java.util.Collections.unmodifiableList(payload_); + } else { + return payloadBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public int getPayloadCount() { + if (payloadBuilder_ == null) { + return payload_.size(); + } else { + return payloadBuilder_.getCount(); + } + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1.AnnotationPayload getPayload(int index) { + if (payloadBuilder_ == null) { + return payload_.get(index); + } else { + return payloadBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder setPayload(int index, com.google.cloud.automl.v1.AnnotationPayload value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePayloadIsMutable(); + payload_.set(index, value); + onChanged(); + } else { + payloadBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder setPayload( + int index, com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + payload_.set(index, builderForValue.build()); + onChanged(); + } else { + payloadBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder addPayload(com.google.cloud.automl.v1.AnnotationPayload value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePayloadIsMutable(); + payload_.add(value); + onChanged(); + } else { + payloadBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder addPayload(int index, com.google.cloud.automl.v1.AnnotationPayload value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePayloadIsMutable(); + payload_.add(index, value); + onChanged(); + } else { + payloadBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder addPayload( + com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + payload_.add(builderForValue.build()); + onChanged(); + } else { + payloadBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder addPayload( + int index, com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + payload_.add(index, builderForValue.build()); + onChanged(); + } else { + payloadBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder addAllPayload( + java.lang.Iterable values) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, payload_); + onChanged(); + } else { + payloadBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder clearPayload() { + if (payloadBuilder_ == null) { + payload_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + payloadBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public Builder removePayload(int index) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + payload_.remove(index); + onChanged(); + } else { + payloadBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1.AnnotationPayload.Builder getPayloadBuilder(int index) { + return getPayloadFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index) { + if (payloadBuilder_ == null) { + return payload_.get(index); + } else { + return payloadBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public java.util.List + getPayloadOrBuilderList() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(payload_); + } + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1.AnnotationPayload.Builder addPayloadBuilder() { + return getPayloadFieldBuilder() + .addBuilder(com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance()); + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1.AnnotationPayload.Builder addPayloadBuilder(int index) { + return getPayloadFieldBuilder() + .addBuilder(index, com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance()); + } + /** + * + * + *
+     * Prediction result.
+     * Translation and Text Sentiment will return precisely one payload.
+     * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + public java.util.List + getPayloadBuilderList() { + return getPayloadFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.AnnotationPayload, + com.google.cloud.automl.v1.AnnotationPayload.Builder, + com.google.cloud.automl.v1.AnnotationPayloadOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.AnnotationPayload, + com.google.cloud.automl.v1.AnnotationPayload.Builder, + com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>( + payload_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + 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.
+     * 
+ * + * map<string, string> metadata = 2; + */ + 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.
+     * 
+ * + * map<string, string> metadata = 2; + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Additional domain-specific prediction response metadata.
+     * 
+ * + * map<string, string> metadata = 2; + */ + 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.
+     * 
+ * + * map<string, string> metadata = 2; + */ + 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.
+     * 
+ * + * map<string, string> metadata = 2; + */ + 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.
+     * 
+ * + * map<string, string> metadata = 2; + */ + 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.
+     * 
+ * + * map<string, string> metadata = 2; + */ + 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.PredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.PredictResponse) + private static final com.google.cloud.automl.v1.PredictResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.PredictResponse(); + } + + public static com.google.cloud.automl.v1.PredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictResponse(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.PredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..43140f250 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponseOrBuilder.java @@ -0,0 +1,136 @@ +/* + * 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 PredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.PredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + java.util.List getPayloadList(); + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + com.google.cloud.automl.v1.AnnotationPayload getPayload(int index); + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + int getPayloadCount(); + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + java.util.List + getPayloadOrBuilderList(); + /** + * + * + *
+   * Prediction result.
+   * Translation and Text Sentiment will return precisely one payload.
+   * 
+ * + * repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index); + + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * 
+ * + * map<string, string> metadata = 2; + */ + int getMetadataCount(); + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * 
+ * + * map<string, string> metadata = 2; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * 
+ * + * map<string, string> metadata = 2; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * 
+ * + * map<string, string> metadata = 2; + */ + java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * 
+ * + * map<string, string> metadata = 2; + */ + java.lang.String getMetadataOrThrow(java.lang.String key); +} 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 new file mode 100644 index 000000000..6fe3699c2 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceProto.java @@ -0,0 +1,152 @@ +/* + * 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 final class PredictionServiceProto { + private PredictionServiceProto() {} + + 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_PredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_PredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_PredictRequest_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_PredictRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_PredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_PredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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; + + 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/prediction_serv" + + "ice.proto\022\026google.cloud.automl.v1\032\034googl" + + "e/api/annotations.proto\032/google/cloud/au" + + "toml/v1/annotation_payload.proto\032\'google" + + "/cloud/automl/v1/data_items.proto\032\037googl" + + "e/cloud/automl/v1/io.proto\032#google/longr" + + "unning/operations.proto\032\027google/api/clie" + + "nt.proto\"\312\001\n\016PredictRequest\022\014\n\004name\030\001 \001(" + + "\t\0227\n\007payload\030\002 \001(\0132&.google.cloud.automl" + + ".v1.ExamplePayload\022B\n\006params\030\003 \003(\01322.goo" + + "gle.cloud.automl.v1.PredictRequest.Param" + + "sEntry\032-\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\"\307\001\n\017PredictResponse\022:\n\007pay" + + "load\030\001 \003(\0132).google.cloud.automl.v1.Anno" + + "tationPayload\022G\n\010metadata\030\002 \003(\01325.google" + + ".cloud.automl.v1.PredictResponse.Metadat" + + "aEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\0012\372\001\n\021PredictionService\022\231\001" + + "\n\007Predict\022&.google.cloud.automl.v1.Predi" + + "ctRequest\032\'.google.cloud.automl.v1.Predi" + + "ctResponse\"=\202\323\344\223\0027\"2/v1/{name=projects/*" + + "/locations/*/models/*}:predict:\001*\032I\312A\025au" + + "toml.googleapis.com\322A.https://www.google" + + "apis.com/auth/cloud-platformB\302\001\n\032com.goo" + + "gle.cloud.automl.v1B\026PredictionServicePr" + + "otoP\001Z + * A representation of a text snippet. + * + * + * Protobuf type {@code google.cloud.automl.v1.TextSnippet} + */ +public final class TextSnippet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextSnippet) + TextSnippetOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextSnippet.newBuilder() to construct. + private TextSnippet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextSnippet() { + content_ = ""; + mimeType_ = ""; + contentUri_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextSnippet( + 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(); + + content_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + mimeType_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + contentUri_ = 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_TextSnippet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_TextSnippet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSnippet.class, + com.google.cloud.automl.v1.TextSnippet.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + /** + * + * + *
+   * Required. The content of the text snippet as a string. Up to 250000
+   * characters long.
+   * 
+ * + * string content = 1; + */ + 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; + } + } + /** + * + * + *
+   * Required. The content of the text snippet as a string. Up to 250000
+   * characters long.
+   * 
+ * + * string content = 1; + */ + 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 MIME_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object mimeType_; + /** + * + * + *
+   * 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; + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + 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(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * 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; + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_URI_FIELD_NUMBER = 4; + private volatile java.lang.Object contentUri_; + /** + * + * + *
+   * Output only. HTTP URI where you can download the content.
+   * 
+ * + * string content_uri = 4; + */ + public java.lang.String getContentUri() { + java.lang.Object ref = contentUri_; + 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(); + contentUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. HTTP URI where you can download the content.
+   * 
+ * + * string content_uri = 4; + */ + public com.google.protobuf.ByteString getContentUriBytes() { + java.lang.Object ref = contentUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentUri_ = 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 (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (!getMimeTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); + } + if (!getContentUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, contentUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (!getMimeTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); + } + if (!getContentUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, contentUri_); + } + 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.TextSnippet)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextSnippet other = (com.google.cloud.automl.v1.TextSnippet) obj; + + if (!getContent().equals(other.getContent())) return false; + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getContentUri().equals(other.getContentUri())) 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) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + hash = (37 * hash) + CONTENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getContentUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextSnippet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSnippet 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.TextSnippet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSnippet 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.TextSnippet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSnippet 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.TextSnippet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSnippet 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.TextSnippet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSnippet 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.TextSnippet 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.TextSnippet 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.TextSnippet 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 a text snippet.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSnippet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextSnippet) + com.google.cloud.automl.v1.TextSnippetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_TextSnippet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_TextSnippet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSnippet.class, + com.google.cloud.automl.v1.TextSnippet.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextSnippet.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_ = ""; + + mimeType_ = ""; + + contentUri_ = ""; + + 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_TextSnippet_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSnippet getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextSnippet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSnippet build() { + com.google.cloud.automl.v1.TextSnippet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSnippet buildPartial() { + com.google.cloud.automl.v1.TextSnippet result = + new com.google.cloud.automl.v1.TextSnippet(this); + result.content_ = content_; + result.mimeType_ = mimeType_; + result.contentUri_ = contentUri_; + 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.TextSnippet) { + return mergeFrom((com.google.cloud.automl.v1.TextSnippet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextSnippet other) { + if (other == com.google.cloud.automl.v1.TextSnippet.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + onChanged(); + } + if (!other.getContentUri().isEmpty()) { + contentUri_ = other.contentUri_; + 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.TextSnippet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.TextSnippet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + * + * + *
+     * Required. The content of the text snippet as a string. Up to 250000
+     * characters long.
+     * 
+ * + * string content = 1; + */ + 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; + } + } + /** + * + * + *
+     * Required. The content of the text snippet as a string. Up to 250000
+     * characters long.
+     * 
+ * + * string content = 1; + */ + 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; + } + } + /** + * + * + *
+     * Required. The content of the text snippet as a string. Up to 250000
+     * characters long.
+     * 
+ * + * string content = 1; + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The content of the text snippet as a string. Up to 250000
+     * characters long.
+     * 
+ * + * string content = 1; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The content of the text snippet as a string. Up to 250000
+     * characters long.
+     * 
+ * + * string content = 1; + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * 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; + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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; + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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; + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mimeType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder clearMimeType() { + + mimeType_ = getDefaultInstance().getMimeType(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mimeType_ = value; + onChanged(); + return this; + } + + private java.lang.Object contentUri_ = ""; + /** + * + * + *
+     * Output only. HTTP URI where you can download the content.
+     * 
+ * + * string content_uri = 4; + */ + public java.lang.String getContentUri() { + java.lang.Object ref = contentUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. HTTP URI where you can download the content.
+     * 
+ * + * string content_uri = 4; + */ + public com.google.protobuf.ByteString getContentUriBytes() { + java.lang.Object ref = contentUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. HTTP URI where you can download the content.
+     * 
+ * + * string content_uri = 4; + */ + public Builder setContentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. HTTP URI where you can download the content.
+     * 
+ * + * string content_uri = 4; + */ + public Builder clearContentUri() { + + contentUri_ = getDefaultInstance().getContentUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. HTTP URI where you can download the content.
+     * 
+ * + * string content_uri = 4; + */ + public Builder setContentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentUri_ = 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.TextSnippet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextSnippet) + private static final com.google.cloud.automl.v1.TextSnippet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextSnippet(); + } + + public static com.google.cloud.automl.v1.TextSnippet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextSnippet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextSnippet(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.TextSnippet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..e6d7e55d6 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSnippetOrBuilder.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/data_items.proto + +package com.google.cloud.automl.v1; + +public interface TextSnippetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextSnippet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The content of the text snippet as a string. Up to 250000
+   * characters long.
+   * 
+ * + * string content = 1; + */ + java.lang.String getContent(); + /** + * + * + *
+   * Required. The content of the text snippet as a string. Up to 250000
+   * characters long.
+   * 
+ * + * string content = 1; + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
+   * 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; + */ + 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].
+   * 
+ * + * string mime_type = 2; + */ + com.google.protobuf.ByteString getMimeTypeBytes(); + + /** + * + * + *
+   * Output only. HTTP URI where you can download the content.
+   * 
+ * + * string content_uri = 4; + */ + java.lang.String getContentUri(); + /** + * + * + *
+   * Output only. HTTP URI where you can download the content.
+   * 
+ * + * string content_uri = 4; + */ + com.google.protobuf.ByteString getContentUriBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationAnnotation.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationAnnotation.java new file mode 100644 index 000000000..c91520fe0 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationAnnotation.java @@ -0,0 +1,717 @@ +/* + * 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/translation.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Annotation details specific to translation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TranslationAnnotation} + */ +public final class TranslationAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TranslationAnnotation) + TranslationAnnotationOrBuilder { + private static final long serialVersionUID = 0L; + // Use TranslationAnnotation.newBuilder() to construct. + private TranslationAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TranslationAnnotation() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TranslationAnnotation( + 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.TextSnippet.Builder subBuilder = null; + if (translatedContent_ != null) { + subBuilder = translatedContent_.toBuilder(); + } + translatedContent_ = + input.readMessage( + com.google.cloud.automl.v1.TextSnippet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(translatedContent_); + translatedContent_ = 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.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TranslationAnnotation.class, + com.google.cloud.automl.v1.TranslationAnnotation.Builder.class); + } + + public static final int TRANSLATED_CONTENT_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.TextSnippet translatedContent_; + /** + * + * + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public boolean hasTranslatedContent() { + return translatedContent_ != null; + } + /** + * + * + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1.TextSnippet getTranslatedContent() { + return translatedContent_ == null + ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() + : translatedContent_; + } + /** + * + * + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1.TextSnippetOrBuilder getTranslatedContentOrBuilder() { + return getTranslatedContent(); + } + + 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 (translatedContent_ != null) { + output.writeMessage(1, getTranslatedContent()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (translatedContent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTranslatedContent()); + } + 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.TranslationAnnotation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TranslationAnnotation other = + (com.google.cloud.automl.v1.TranslationAnnotation) obj; + + if (hasTranslatedContent() != other.hasTranslatedContent()) return false; + if (hasTranslatedContent()) { + if (!getTranslatedContent().equals(other.getTranslatedContent())) 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 (hasTranslatedContent()) { + hash = (37 * hash) + TRANSLATED_CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getTranslatedContent().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TranslationAnnotation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationAnnotation 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.TranslationAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationAnnotation 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.TranslationAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationAnnotation 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.TranslationAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TranslationAnnotation 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.TranslationAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TranslationAnnotation 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.TranslationAnnotation 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.TranslationAnnotation 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.TranslationAnnotation 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 specific to translation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TranslationAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TranslationAnnotation) + com.google.cloud.automl.v1.TranslationAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TranslationAnnotation.class, + com.google.cloud.automl.v1.TranslationAnnotation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TranslationAnnotation.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 (translatedContentBuilder_ == null) { + translatedContent_ = null; + } else { + translatedContent_ = null; + translatedContentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationAnnotation getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationAnnotation build() { + com.google.cloud.automl.v1.TranslationAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationAnnotation buildPartial() { + com.google.cloud.automl.v1.TranslationAnnotation result = + new com.google.cloud.automl.v1.TranslationAnnotation(this); + if (translatedContentBuilder_ == null) { + result.translatedContent_ = translatedContent_; + } else { + result.translatedContent_ = translatedContentBuilder_.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.TranslationAnnotation) { + return mergeFrom((com.google.cloud.automl.v1.TranslationAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TranslationAnnotation other) { + if (other == com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance()) + return this; + if (other.hasTranslatedContent()) { + mergeTranslatedContent(other.getTranslatedContent()); + } + 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.TranslationAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.TranslationAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.TextSnippet translatedContent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSnippet, + com.google.cloud.automl.v1.TextSnippet.Builder, + com.google.cloud.automl.v1.TextSnippetOrBuilder> + translatedContentBuilder_; + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public boolean hasTranslatedContent() { + return translatedContentBuilder_ != null || translatedContent_ != null; + } + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1.TextSnippet getTranslatedContent() { + if (translatedContentBuilder_ == null) { + return translatedContent_ == null + ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() + : translatedContent_; + } else { + return translatedContentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public Builder setTranslatedContent(com.google.cloud.automl.v1.TextSnippet value) { + if (translatedContentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + translatedContent_ = value; + onChanged(); + } else { + translatedContentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public Builder setTranslatedContent( + com.google.cloud.automl.v1.TextSnippet.Builder builderForValue) { + if (translatedContentBuilder_ == null) { + translatedContent_ = builderForValue.build(); + onChanged(); + } else { + translatedContentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public Builder mergeTranslatedContent(com.google.cloud.automl.v1.TextSnippet value) { + if (translatedContentBuilder_ == null) { + if (translatedContent_ != null) { + translatedContent_ = + com.google.cloud.automl.v1.TextSnippet.newBuilder(translatedContent_) + .mergeFrom(value) + .buildPartial(); + } else { + translatedContent_ = value; + } + onChanged(); + } else { + translatedContentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public Builder clearTranslatedContent() { + if (translatedContentBuilder_ == null) { + translatedContent_ = null; + onChanged(); + } else { + translatedContent_ = null; + translatedContentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1.TextSnippet.Builder getTranslatedContentBuilder() { + + onChanged(); + return getTranslatedContentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1.TextSnippetOrBuilder getTranslatedContentOrBuilder() { + if (translatedContentBuilder_ != null) { + return translatedContentBuilder_.getMessageOrBuilder(); + } else { + return translatedContent_ == null + ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() + : translatedContent_; + } + } + /** + * + * + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSnippet, + com.google.cloud.automl.v1.TextSnippet.Builder, + com.google.cloud.automl.v1.TextSnippetOrBuilder> + getTranslatedContentFieldBuilder() { + if (translatedContentBuilder_ == null) { + translatedContentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSnippet, + com.google.cloud.automl.v1.TextSnippet.Builder, + com.google.cloud.automl.v1.TextSnippetOrBuilder>( + getTranslatedContent(), getParentForChildren(), isClean()); + translatedContent_ = null; + } + return translatedContentBuilder_; + } + + @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.TranslationAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TranslationAnnotation) + private static final com.google.cloud.automl.v1.TranslationAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TranslationAnnotation(); + } + + public static com.google.cloud.automl.v1.TranslationAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranslationAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranslationAnnotation(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.TranslationAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationAnnotationOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationAnnotationOrBuilder.java new file mode 100644 index 000000000..3f8f1c882 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationAnnotationOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/translation.proto + +package com.google.cloud.automl.v1; + +public interface TranslationAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TranslationAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + boolean hasTranslatedContent(); + /** + * + * + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + com.google.cloud.automl.v1.TextSnippet getTranslatedContent(); + /** + * + * + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + com.google.cloud.automl.v1.TextSnippetOrBuilder getTranslatedContentOrBuilder(); +} 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 new file mode 100644 index 000000000..101f6e909 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadata.java @@ -0,0 +1,775 @@ +/* + * 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/translation.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Dataset metadata that is specific to translation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TranslationDatasetMetadata} + */ +public final class TranslationDatasetMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TranslationDatasetMetadata) + TranslationDatasetMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TranslationDatasetMetadata.newBuilder() to construct. + private TranslationDatasetMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TranslationDatasetMetadata() { + sourceLanguageCode_ = ""; + targetLanguageCode_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TranslationDatasetMetadata( + 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(); + + sourceLanguageCode_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + targetLanguageCode_ = 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.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TranslationDatasetMetadata.class, + com.google.cloud.automl.v1.TranslationDatasetMetadata.Builder.class); + } + + public static final int SOURCE_LANGUAGE_CODE_FIELD_NUMBER = 1; + private volatile java.lang.Object sourceLanguageCode_; + /** + * + * + *
+   * Required. The BCP-47 language code of the source language.
+   * 
+ * + * string source_language_code = 1; + */ + public java.lang.String getSourceLanguageCode() { + java.lang.Object ref = sourceLanguageCode_; + 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(); + sourceLanguageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BCP-47 language code of the source language.
+   * 
+ * + * string source_language_code = 1; + */ + public com.google.protobuf.ByteString getSourceLanguageCodeBytes() { + java.lang.Object ref = sourceLanguageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object targetLanguageCode_; + /** + * + * + *
+   * Required. The BCP-47 language code of the target language.
+   * 
+ * + * string target_language_code = 2; + */ + public java.lang.String getTargetLanguageCode() { + java.lang.Object ref = targetLanguageCode_; + 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(); + targetLanguageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BCP-47 language code of the target language.
+   * 
+ * + * string target_language_code = 2; + */ + public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { + java.lang.Object ref = targetLanguageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLanguageCode_ = 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 (!getSourceLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sourceLanguageCode_); + } + if (!getTargetLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, targetLanguageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSourceLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sourceLanguageCode_); + } + if (!getTargetLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, targetLanguageCode_); + } + 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.TranslationDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TranslationDatasetMetadata other = + (com.google.cloud.automl.v1.TranslationDatasetMetadata) obj; + + if (!getSourceLanguageCode().equals(other.getSourceLanguageCode())) return false; + if (!getTargetLanguageCode().equals(other.getTargetLanguageCode())) 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) + SOURCE_LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getSourceLanguageCode().hashCode(); + hash = (37 * hash) + TARGET_LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getTargetLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TranslationDatasetMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationDatasetMetadata 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.TranslationDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationDatasetMetadata 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.TranslationDatasetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationDatasetMetadata 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.TranslationDatasetMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TranslationDatasetMetadata 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.TranslationDatasetMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TranslationDatasetMetadata 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.TranslationDatasetMetadata 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.TranslationDatasetMetadata 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.TranslationDatasetMetadata 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 translation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TranslationDatasetMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TranslationDatasetMetadata) + com.google.cloud.automl.v1.TranslationDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TranslationDatasetMetadata.class, + com.google.cloud.automl.v1.TranslationDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TranslationDatasetMetadata.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(); + sourceLanguageCode_ = ""; + + targetLanguageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationDatasetMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationDatasetMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationDatasetMetadata build() { + com.google.cloud.automl.v1.TranslationDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationDatasetMetadata buildPartial() { + com.google.cloud.automl.v1.TranslationDatasetMetadata result = + new com.google.cloud.automl.v1.TranslationDatasetMetadata(this); + result.sourceLanguageCode_ = sourceLanguageCode_; + result.targetLanguageCode_ = targetLanguageCode_; + 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.TranslationDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1.TranslationDatasetMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TranslationDatasetMetadata other) { + if (other == com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance()) + return this; + if (!other.getSourceLanguageCode().isEmpty()) { + sourceLanguageCode_ = other.sourceLanguageCode_; + onChanged(); + } + if (!other.getTargetLanguageCode().isEmpty()) { + targetLanguageCode_ = other.targetLanguageCode_; + 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.TranslationDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TranslationDatasetMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object sourceLanguageCode_ = ""; + /** + * + * + *
+     * Required. The BCP-47 language code of the source language.
+     * 
+ * + * string source_language_code = 1; + */ + public java.lang.String getSourceLanguageCode() { + java.lang.Object ref = sourceLanguageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceLanguageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BCP-47 language code of the source language.
+     * 
+ * + * string source_language_code = 1; + */ + public com.google.protobuf.ByteString getSourceLanguageCodeBytes() { + java.lang.Object ref = sourceLanguageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BCP-47 language code of the source language.
+     * 
+ * + * string source_language_code = 1; + */ + public Builder setSourceLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceLanguageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BCP-47 language code of the source language.
+     * 
+ * + * string source_language_code = 1; + */ + public Builder clearSourceLanguageCode() { + + sourceLanguageCode_ = getDefaultInstance().getSourceLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BCP-47 language code of the source language.
+     * 
+ * + * string source_language_code = 1; + */ + public Builder setSourceLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceLanguageCode_ = value; + onChanged(); + return this; + } + + private java.lang.Object targetLanguageCode_ = ""; + /** + * + * + *
+     * Required. The BCP-47 language code of the target language.
+     * 
+ * + * string target_language_code = 2; + */ + public java.lang.String getTargetLanguageCode() { + java.lang.Object ref = targetLanguageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetLanguageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BCP-47 language code of the target language.
+     * 
+ * + * string target_language_code = 2; + */ + public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { + java.lang.Object ref = targetLanguageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BCP-47 language code of the target language.
+     * 
+ * + * string target_language_code = 2; + */ + public Builder setTargetLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + targetLanguageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BCP-47 language code of the target language.
+     * 
+ * + * string target_language_code = 2; + */ + public Builder clearTargetLanguageCode() { + + targetLanguageCode_ = getDefaultInstance().getTargetLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BCP-47 language code of the target language.
+     * 
+ * + * string target_language_code = 2; + */ + public Builder setTargetLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + targetLanguageCode_ = 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.TranslationDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TranslationDatasetMetadata) + private static final com.google.cloud.automl.v1.TranslationDatasetMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TranslationDatasetMetadata(); + } + + public static com.google.cloud.automl.v1.TranslationDatasetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranslationDatasetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranslationDatasetMetadata(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.TranslationDatasetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 000000000..ed7ffbf5b --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadataOrBuilder.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/translation.proto + +package com.google.cloud.automl.v1; + +public interface TranslationDatasetMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TranslationDatasetMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The BCP-47 language code of the source language.
+   * 
+ * + * string source_language_code = 1; + */ + java.lang.String getSourceLanguageCode(); + /** + * + * + *
+   * Required. The BCP-47 language code of the source language.
+   * 
+ * + * string source_language_code = 1; + */ + com.google.protobuf.ByteString getSourceLanguageCodeBytes(); + + /** + * + * + *
+   * Required. The BCP-47 language code of the target language.
+   * 
+ * + * string target_language_code = 2; + */ + java.lang.String getTargetLanguageCode(); + /** + * + * + *
+   * Required. The BCP-47 language code of the target language.
+   * 
+ * + * string target_language_code = 2; + */ + com.google.protobuf.ByteString getTargetLanguageCodeBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationEvaluationMetrics.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationEvaluationMetrics.java new file mode 100644 index 000000000..db7986fe9 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationEvaluationMetrics.java @@ -0,0 +1,618 @@ +/* + * 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/translation.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Evaluation metrics for the dataset.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TranslationEvaluationMetrics} + */ +public final class TranslationEvaluationMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TranslationEvaluationMetrics) + TranslationEvaluationMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TranslationEvaluationMetrics.newBuilder() to construct. + private TranslationEvaluationMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TranslationEvaluationMetrics() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TranslationEvaluationMetrics( + 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 9: + { + bleuScore_ = input.readDouble(); + break; + } + case 17: + { + baseBleuScore_ = input.readDouble(); + 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.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TranslationEvaluationMetrics.class, + com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder.class); + } + + public static final int BLEU_SCORE_FIELD_NUMBER = 1; + private double bleuScore_; + /** + * + * + *
+   * Output only. BLEU score.
+   * 
+ * + * double bleu_score = 1; + */ + public double getBleuScore() { + return bleuScore_; + } + + public static final int BASE_BLEU_SCORE_FIELD_NUMBER = 2; + private double baseBleuScore_; + /** + * + * + *
+   * Output only. BLEU score for base model.
+   * 
+ * + * double base_bleu_score = 2; + */ + public double getBaseBleuScore() { + return baseBleuScore_; + } + + 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 (bleuScore_ != 0D) { + output.writeDouble(1, bleuScore_); + } + if (baseBleuScore_ != 0D) { + output.writeDouble(2, baseBleuScore_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (bleuScore_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, bleuScore_); + } + if (baseBleuScore_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, baseBleuScore_); + } + 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.TranslationEvaluationMetrics)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TranslationEvaluationMetrics other = + (com.google.cloud.automl.v1.TranslationEvaluationMetrics) obj; + + if (java.lang.Double.doubleToLongBits(getBleuScore()) + != java.lang.Double.doubleToLongBits(other.getBleuScore())) return false; + if (java.lang.Double.doubleToLongBits(getBaseBleuScore()) + != java.lang.Double.doubleToLongBits(other.getBaseBleuScore())) 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) + BLEU_SCORE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getBleuScore())); + hash = (37 * hash) + BASE_BLEU_SCORE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getBaseBleuScore())); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TranslationEvaluationMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationEvaluationMetrics 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.TranslationEvaluationMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationEvaluationMetrics 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.TranslationEvaluationMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationEvaluationMetrics 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.TranslationEvaluationMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TranslationEvaluationMetrics 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.TranslationEvaluationMetrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TranslationEvaluationMetrics 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.TranslationEvaluationMetrics 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.TranslationEvaluationMetrics 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.TranslationEvaluationMetrics prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Evaluation metrics for the dataset.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TranslationEvaluationMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TranslationEvaluationMetrics) + com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TranslationEvaluationMetrics.class, + com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TranslationEvaluationMetrics.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(); + bleuScore_ = 0D; + + baseBleuScore_ = 0D; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationEvaluationMetrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationEvaluationMetrics getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationEvaluationMetrics build() { + com.google.cloud.automl.v1.TranslationEvaluationMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationEvaluationMetrics buildPartial() { + com.google.cloud.automl.v1.TranslationEvaluationMetrics result = + new com.google.cloud.automl.v1.TranslationEvaluationMetrics(this); + result.bleuScore_ = bleuScore_; + result.baseBleuScore_ = baseBleuScore_; + 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.TranslationEvaluationMetrics) { + return mergeFrom((com.google.cloud.automl.v1.TranslationEvaluationMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TranslationEvaluationMetrics other) { + if (other == com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance()) + return this; + if (other.getBleuScore() != 0D) { + setBleuScore(other.getBleuScore()); + } + if (other.getBaseBleuScore() != 0D) { + setBaseBleuScore(other.getBaseBleuScore()); + } + 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.TranslationEvaluationMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TranslationEvaluationMetrics) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private double bleuScore_; + /** + * + * + *
+     * Output only. BLEU score.
+     * 
+ * + * double bleu_score = 1; + */ + public double getBleuScore() { + return bleuScore_; + } + /** + * + * + *
+     * Output only. BLEU score.
+     * 
+ * + * double bleu_score = 1; + */ + public Builder setBleuScore(double value) { + + bleuScore_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. BLEU score.
+     * 
+ * + * double bleu_score = 1; + */ + public Builder clearBleuScore() { + + bleuScore_ = 0D; + onChanged(); + return this; + } + + private double baseBleuScore_; + /** + * + * + *
+     * Output only. BLEU score for base model.
+     * 
+ * + * double base_bleu_score = 2; + */ + public double getBaseBleuScore() { + return baseBleuScore_; + } + /** + * + * + *
+     * Output only. BLEU score for base model.
+     * 
+ * + * double base_bleu_score = 2; + */ + public Builder setBaseBleuScore(double value) { + + baseBleuScore_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. BLEU score for base model.
+     * 
+ * + * double base_bleu_score = 2; + */ + public Builder clearBaseBleuScore() { + + baseBleuScore_ = 0D; + 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.TranslationEvaluationMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TranslationEvaluationMetrics) + private static final com.google.cloud.automl.v1.TranslationEvaluationMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TranslationEvaluationMetrics(); + } + + public static com.google.cloud.automl.v1.TranslationEvaluationMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranslationEvaluationMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranslationEvaluationMetrics(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.TranslationEvaluationMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationEvaluationMetricsOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationEvaluationMetricsOrBuilder.java new file mode 100644 index 000000000..6459eb50f --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationEvaluationMetricsOrBuilder.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/translation.proto + +package com.google.cloud.automl.v1; + +public interface TranslationEvaluationMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TranslationEvaluationMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. BLEU score.
+   * 
+ * + * double bleu_score = 1; + */ + double getBleuScore(); + + /** + * + * + *
+   * Output only. BLEU score for base model.
+   * 
+ * + * double base_bleu_score = 2; + */ + double getBaseBleuScore(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationModelMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationModelMetadata.java new file mode 100644 index 000000000..8868bb5bf --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationModelMetadata.java @@ -0,0 +1,970 @@ +/* + * 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/translation.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model metadata that is specific to translation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TranslationModelMetadata} + */ +public final class TranslationModelMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TranslationModelMetadata) + TranslationModelMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TranslationModelMetadata.newBuilder() to construct. + private TranslationModelMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TranslationModelMetadata() { + baseModel_ = ""; + sourceLanguageCode_ = ""; + targetLanguageCode_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TranslationModelMetadata( + 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(); + + baseModel_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceLanguageCode_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + targetLanguageCode_ = 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.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TranslationModelMetadata.class, + com.google.cloud.automl.v1.TranslationModelMetadata.Builder.class); + } + + public static final int BASE_MODEL_FIELD_NUMBER = 1; + private volatile java.lang.Object baseModel_; + /** + * + * + *
+   * The resource name of the model to use as a baseline to train the custom
+   * model. If unset, we use the default base model provided by Google
+   * Translate. Format:
+   * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+   * 
+ * + * string base_model = 1; + */ + public java.lang.String getBaseModel() { + java.lang.Object ref = baseModel_; + 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(); + baseModel_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the model to use as a baseline to train the custom
+   * model. If unset, we use the default base model provided by Google
+   * Translate. Format:
+   * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+   * 
+ * + * string base_model = 1; + */ + public com.google.protobuf.ByteString getBaseModelBytes() { + java.lang.Object ref = baseModel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + baseModel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object sourceLanguageCode_; + /** + * + * + *
+   * Output only. Inferred from the dataset.
+   * The source languge (The BCP-47 language code) that is used for training.
+   * 
+ * + * string source_language_code = 2; + */ + public java.lang.String getSourceLanguageCode() { + java.lang.Object ref = sourceLanguageCode_; + 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(); + sourceLanguageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Inferred from the dataset.
+   * The source languge (The BCP-47 language code) that is used for training.
+   * 
+ * + * string source_language_code = 2; + */ + public com.google.protobuf.ByteString getSourceLanguageCodeBytes() { + java.lang.Object ref = sourceLanguageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object targetLanguageCode_; + /** + * + * + *
+   * Output only. The target languge (The BCP-47 language code) that is used for
+   * training.
+   * 
+ * + * string target_language_code = 3; + */ + public java.lang.String getTargetLanguageCode() { + java.lang.Object ref = targetLanguageCode_; + 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(); + targetLanguageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The target languge (The BCP-47 language code) that is used for
+   * training.
+   * 
+ * + * string target_language_code = 3; + */ + public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { + java.lang.Object ref = targetLanguageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLanguageCode_ = 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 (!getBaseModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, baseModel_); + } + if (!getSourceLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceLanguageCode_); + } + if (!getTargetLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, targetLanguageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getBaseModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, baseModel_); + } + if (!getSourceLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceLanguageCode_); + } + if (!getTargetLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, targetLanguageCode_); + } + 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.TranslationModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TranslationModelMetadata other = + (com.google.cloud.automl.v1.TranslationModelMetadata) obj; + + if (!getBaseModel().equals(other.getBaseModel())) return false; + if (!getSourceLanguageCode().equals(other.getSourceLanguageCode())) return false; + if (!getTargetLanguageCode().equals(other.getTargetLanguageCode())) 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_FIELD_NUMBER; + hash = (53 * hash) + getBaseModel().hashCode(); + hash = (37 * hash) + SOURCE_LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getSourceLanguageCode().hashCode(); + hash = (37 * hash) + TARGET_LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getTargetLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TranslationModelMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationModelMetadata 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.TranslationModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationModelMetadata 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.TranslationModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TranslationModelMetadata 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.TranslationModelMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TranslationModelMetadata 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.TranslationModelMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TranslationModelMetadata 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.TranslationModelMetadata 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.TranslationModelMetadata 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.TranslationModelMetadata 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 translation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TranslationModelMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TranslationModelMetadata) + com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TranslationModelMetadata.class, + com.google.cloud.automl.v1.TranslationModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TranslationModelMetadata.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(); + baseModel_ = ""; + + sourceLanguageCode_ = ""; + + targetLanguageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TranslationProto + .internal_static_google_cloud_automl_v1_TranslationModelMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationModelMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationModelMetadata build() { + com.google.cloud.automl.v1.TranslationModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TranslationModelMetadata buildPartial() { + com.google.cloud.automl.v1.TranslationModelMetadata result = + new com.google.cloud.automl.v1.TranslationModelMetadata(this); + result.baseModel_ = baseModel_; + result.sourceLanguageCode_ = sourceLanguageCode_; + result.targetLanguageCode_ = targetLanguageCode_; + 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.TranslationModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1.TranslationModelMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TranslationModelMetadata other) { + if (other == com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance()) + return this; + if (!other.getBaseModel().isEmpty()) { + baseModel_ = other.baseModel_; + onChanged(); + } + if (!other.getSourceLanguageCode().isEmpty()) { + sourceLanguageCode_ = other.sourceLanguageCode_; + onChanged(); + } + if (!other.getTargetLanguageCode().isEmpty()) { + targetLanguageCode_ = other.targetLanguageCode_; + 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.TranslationModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TranslationModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object baseModel_ = ""; + /** + * + * + *
+     * The resource name of the model to use as a baseline to train the custom
+     * model. If unset, we use the default base model provided by Google
+     * Translate. Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+     * 
+ * + * string base_model = 1; + */ + public java.lang.String getBaseModel() { + java.lang.Object ref = baseModel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseModel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the model to use as a baseline to train the custom
+     * model. If unset, we use the default base model provided by Google
+     * Translate. Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+     * 
+ * + * string base_model = 1; + */ + public com.google.protobuf.ByteString getBaseModelBytes() { + java.lang.Object ref = baseModel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + baseModel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the model to use as a baseline to train the custom
+     * model. If unset, we use the default base model provided by Google
+     * Translate. Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+     * 
+ * + * string base_model = 1; + */ + public Builder setBaseModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + baseModel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the model to use as a baseline to train the custom
+     * model. If unset, we use the default base model provided by Google
+     * Translate. Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+     * 
+ * + * string base_model = 1; + */ + public Builder clearBaseModel() { + + baseModel_ = getDefaultInstance().getBaseModel(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the model to use as a baseline to train the custom
+     * model. If unset, we use the default base model provided by Google
+     * Translate. Format:
+     * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+     * 
+ * + * string base_model = 1; + */ + public Builder setBaseModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + baseModel_ = value; + onChanged(); + return this; + } + + private java.lang.Object sourceLanguageCode_ = ""; + /** + * + * + *
+     * Output only. Inferred from the dataset.
+     * The source languge (The BCP-47 language code) that is used for training.
+     * 
+ * + * string source_language_code = 2; + */ + public java.lang.String getSourceLanguageCode() { + java.lang.Object ref = sourceLanguageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceLanguageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Inferred from the dataset.
+     * The source languge (The BCP-47 language code) that is used for training.
+     * 
+ * + * string source_language_code = 2; + */ + public com.google.protobuf.ByteString getSourceLanguageCodeBytes() { + java.lang.Object ref = sourceLanguageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Inferred from the dataset.
+     * The source languge (The BCP-47 language code) that is used for training.
+     * 
+ * + * string source_language_code = 2; + */ + public Builder setSourceLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceLanguageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Inferred from the dataset.
+     * The source languge (The BCP-47 language code) that is used for training.
+     * 
+ * + * string source_language_code = 2; + */ + public Builder clearSourceLanguageCode() { + + sourceLanguageCode_ = getDefaultInstance().getSourceLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Inferred from the dataset.
+     * The source languge (The BCP-47 language code) that is used for training.
+     * 
+ * + * string source_language_code = 2; + */ + public Builder setSourceLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceLanguageCode_ = value; + onChanged(); + return this; + } + + private java.lang.Object targetLanguageCode_ = ""; + /** + * + * + *
+     * Output only. The target languge (The BCP-47 language code) that is used for
+     * training.
+     * 
+ * + * string target_language_code = 3; + */ + public java.lang.String getTargetLanguageCode() { + java.lang.Object ref = targetLanguageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetLanguageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The target languge (The BCP-47 language code) that is used for
+     * training.
+     * 
+ * + * string target_language_code = 3; + */ + public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { + java.lang.Object ref = targetLanguageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The target languge (The BCP-47 language code) that is used for
+     * training.
+     * 
+ * + * string target_language_code = 3; + */ + public Builder setTargetLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + targetLanguageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The target languge (The BCP-47 language code) that is used for
+     * training.
+     * 
+ * + * string target_language_code = 3; + */ + public Builder clearTargetLanguageCode() { + + targetLanguageCode_ = getDefaultInstance().getTargetLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The target languge (The BCP-47 language code) that is used for
+     * training.
+     * 
+ * + * string target_language_code = 3; + */ + public Builder setTargetLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + targetLanguageCode_ = 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.TranslationModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TranslationModelMetadata) + private static final com.google.cloud.automl.v1.TranslationModelMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TranslationModelMetadata(); + } + + public static com.google.cloud.automl.v1.TranslationModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranslationModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranslationModelMetadata(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.TranslationModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationModelMetadataOrBuilder.java new file mode 100644 index 000000000..e52aab3ba --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationModelMetadataOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/translation.proto + +package com.google.cloud.automl.v1; + +public interface TranslationModelMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TranslationModelMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the model to use as a baseline to train the custom
+   * model. If unset, we use the default base model provided by Google
+   * Translate. Format:
+   * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+   * 
+ * + * string base_model = 1; + */ + java.lang.String getBaseModel(); + /** + * + * + *
+   * The resource name of the model to use as a baseline to train the custom
+   * model. If unset, we use the default base model provided by Google
+   * Translate. Format:
+   * `projects/{project_id}/locations/{location_id}/models/{model_id}`
+   * 
+ * + * string base_model = 1; + */ + com.google.protobuf.ByteString getBaseModelBytes(); + + /** + * + * + *
+   * Output only. Inferred from the dataset.
+   * The source languge (The BCP-47 language code) that is used for training.
+   * 
+ * + * string source_language_code = 2; + */ + java.lang.String getSourceLanguageCode(); + /** + * + * + *
+   * Output only. Inferred from the dataset.
+   * The source languge (The BCP-47 language code) that is used for training.
+   * 
+ * + * string source_language_code = 2; + */ + com.google.protobuf.ByteString getSourceLanguageCodeBytes(); + + /** + * + * + *
+   * Output only. The target languge (The BCP-47 language code) that is used for
+   * training.
+   * 
+ * + * string target_language_code = 3; + */ + java.lang.String getTargetLanguageCode(); + /** + * + * + *
+   * Output only. The target languge (The BCP-47 language code) that is used for
+   * training.
+   * 
+ * + * string target_language_code = 3; + */ + 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 new file mode 100644 index 000000000..11c27d0a2 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationProto.java @@ -0,0 +1,126 @@ +/* + * 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/translation.proto + +package com.google.cloud.automl.v1; + +public final class TranslationProto { + private TranslationProto() {} + + 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_TranslationDatasetMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TranslationDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TranslationEvaluationMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TranslationEvaluationMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TranslationModelMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TranslationModelMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TranslationAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TranslationAnnotation_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/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 + * Request message for [AutoMl.UpdateDataset][google.cloud.automl.v1.AutoMl.UpdateDataset] + * + * + * Protobuf type {@code google.cloud.automl.v1.UpdateDatasetRequest} + */ +public final class UpdateDatasetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.UpdateDatasetRequest) + UpdateDatasetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDatasetRequest.newBuilder() to construct. + private UpdateDatasetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDatasetRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateDatasetRequest( + 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.Dataset.Builder subBuilder = null; + if (dataset_ != null) { + subBuilder = dataset_.toBuilder(); + } + dataset_ = + input.readMessage(com.google.cloud.automl.v1.Dataset.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dataset_); + dataset_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = 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_UpdateDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UpdateDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.UpdateDatasetRequest.class, + com.google.cloud.automl.v1.UpdateDatasetRequest.Builder.class); + } + + public static final int DATASET_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.Dataset dataset_; + /** + * + * + *
+   * The dataset which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public boolean hasDataset() { + return dataset_ != null; + } + /** + * + * + *
+   * The dataset which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public com.google.cloud.automl.v1.Dataset getDataset() { + return dataset_ == null ? com.google.cloud.automl.v1.Dataset.getDefaultInstance() : dataset_; + } + /** + * + * + *
+   * The dataset which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public com.google.cloud.automl.v1.DatasetOrBuilder getDatasetOrBuilder() { + return getDataset(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (dataset_ != null) { + output.writeMessage(1, getDataset()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDataset()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.UpdateDatasetRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.UpdateDatasetRequest other = + (com.google.cloud.automl.v1.UpdateDatasetRequest) obj; + + if (hasDataset() != other.hasDataset()) return false; + if (hasDataset()) { + if (!getDataset().equals(other.getDataset())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasDataset()) { + hash = (37 * hash) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.UpdateDatasetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UpdateDatasetRequest 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.UpdateDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UpdateDatasetRequest 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.UpdateDatasetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UpdateDatasetRequest 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.UpdateDatasetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UpdateDatasetRequest 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.UpdateDatasetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UpdateDatasetRequest 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.UpdateDatasetRequest 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.UpdateDatasetRequest 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.UpdateDatasetRequest 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.UpdateDataset][google.cloud.automl.v1.AutoMl.UpdateDataset]
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.UpdateDatasetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.UpdateDatasetRequest) + com.google.cloud.automl.v1.UpdateDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UpdateDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UpdateDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.UpdateDatasetRequest.class, + com.google.cloud.automl.v1.UpdateDatasetRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.UpdateDatasetRequest.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 (datasetBuilder_ == null) { + dataset_ = null; + } else { + dataset_ = null; + datasetBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = 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_UpdateDatasetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UpdateDatasetRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.UpdateDatasetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.UpdateDatasetRequest build() { + com.google.cloud.automl.v1.UpdateDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UpdateDatasetRequest buildPartial() { + com.google.cloud.automl.v1.UpdateDatasetRequest result = + new com.google.cloud.automl.v1.UpdateDatasetRequest(this); + if (datasetBuilder_ == null) { + result.dataset_ = dataset_; + } else { + result.dataset_ = datasetBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.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.UpdateDatasetRequest) { + return mergeFrom((com.google.cloud.automl.v1.UpdateDatasetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.UpdateDatasetRequest other) { + if (other == com.google.cloud.automl.v1.UpdateDatasetRequest.getDefaultInstance()) + return this; + if (other.hasDataset()) { + mergeDataset(other.getDataset()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.UpdateDatasetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.UpdateDatasetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.Dataset dataset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder> + datasetBuilder_; + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public boolean hasDataset() { + return datasetBuilder_ != null || dataset_ != null; + } + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public com.google.cloud.automl.v1.Dataset getDataset() { + if (datasetBuilder_ == null) { + return dataset_ == null + ? com.google.cloud.automl.v1.Dataset.getDefaultInstance() + : dataset_; + } else { + return datasetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public Builder setDataset(com.google.cloud.automl.v1.Dataset value) { + if (datasetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataset_ = value; + onChanged(); + } else { + datasetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public Builder setDataset(com.google.cloud.automl.v1.Dataset.Builder builderForValue) { + if (datasetBuilder_ == null) { + dataset_ = builderForValue.build(); + onChanged(); + } else { + datasetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public Builder mergeDataset(com.google.cloud.automl.v1.Dataset value) { + if (datasetBuilder_ == null) { + if (dataset_ != null) { + dataset_ = + com.google.cloud.automl.v1.Dataset.newBuilder(dataset_) + .mergeFrom(value) + .buildPartial(); + } else { + dataset_ = value; + } + onChanged(); + } else { + datasetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public Builder clearDataset() { + if (datasetBuilder_ == null) { + dataset_ = null; + onChanged(); + } else { + dataset_ = null; + datasetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public com.google.cloud.automl.v1.Dataset.Builder getDatasetBuilder() { + + onChanged(); + return getDatasetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + public com.google.cloud.automl.v1.DatasetOrBuilder getDatasetOrBuilder() { + if (datasetBuilder_ != null) { + return datasetBuilder_.getMessageOrBuilder(); + } else { + return dataset_ == null + ? com.google.cloud.automl.v1.Dataset.getDefaultInstance() + : dataset_; + } + } + /** + * + * + *
+     * The dataset which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder> + getDatasetFieldBuilder() { + if (datasetBuilder_ == null) { + datasetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Dataset, + com.google.cloud.automl.v1.Dataset.Builder, + com.google.cloud.automl.v1.DatasetOrBuilder>( + getDataset(), getParentForChildren(), isClean()); + dataset_ = null; + } + return datasetBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.UpdateDatasetRequest) + private static final com.google.cloud.automl.v1.UpdateDatasetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.UpdateDatasetRequest(); + } + + public static com.google.cloud.automl.v1.UpdateDatasetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDatasetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateDatasetRequest(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.UpdateDatasetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateDatasetRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateDatasetRequestOrBuilder.java new file mode 100644 index 000000000..1594754f6 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateDatasetRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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 UpdateDatasetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.UpdateDatasetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The dataset which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + boolean hasDataset(); + /** + * + * + *
+   * The dataset which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + com.google.cloud.automl.v1.Dataset getDataset(); + /** + * + * + *
+   * The dataset which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Dataset dataset = 1; + */ + com.google.cloud.automl.v1.DatasetOrBuilder getDatasetOrBuilder(); + + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateModelRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateModelRequest.java new file mode 100644 index 000000000..bdbe920f1 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateModelRequest.java @@ -0,0 +1,967 @@ +/* + * 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.UpdateModel][google.cloud.automl.v1.AutoMl.UpdateModel]
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.UpdateModelRequest} + */ +public final class UpdateModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.UpdateModelRequest) + UpdateModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateModelRequest.newBuilder() to construct. + private UpdateModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateModelRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateModelRequest( + 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.Model.Builder subBuilder = null; + if (model_ != null) { + subBuilder = model_.toBuilder(); + } + model_ = + input.readMessage(com.google.cloud.automl.v1.Model.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(model_); + model_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = 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_UpdateModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UpdateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.UpdateModelRequest.class, + com.google.cloud.automl.v1.UpdateModelRequest.Builder.class); + } + + public static final int MODEL_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.Model model_; + /** + * + * + *
+   * The model which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public boolean hasModel() { + return model_ != null; + } + /** + * + * + *
+   * The model which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.Model getModel() { + return model_ == null ? com.google.cloud.automl.v1.Model.getDefaultInstance() : model_; + } + /** + * + * + *
+   * The model which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder() { + return getModel(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (model_ != null) { + output.writeMessage(1, getModel()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (model_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getModel()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.UpdateModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.UpdateModelRequest other = + (com.google.cloud.automl.v1.UpdateModelRequest) obj; + + if (hasModel() != other.hasModel()) return false; + if (hasModel()) { + if (!getModel().equals(other.getModel())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasModel()) { + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.UpdateModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UpdateModelRequest 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.UpdateModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UpdateModelRequest 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.UpdateModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UpdateModelRequest 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.UpdateModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UpdateModelRequest 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.UpdateModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UpdateModelRequest 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.UpdateModelRequest 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.UpdateModelRequest 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.UpdateModelRequest 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.UpdateModel][google.cloud.automl.v1.AutoMl.UpdateModel]
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.UpdateModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.UpdateModelRequest) + com.google.cloud.automl.v1.UpdateModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UpdateModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UpdateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.UpdateModelRequest.class, + com.google.cloud.automl.v1.UpdateModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.UpdateModelRequest.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 (modelBuilder_ == null) { + model_ = null; + } else { + model_ = null; + modelBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = 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_UpdateModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UpdateModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.UpdateModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.UpdateModelRequest build() { + com.google.cloud.automl.v1.UpdateModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UpdateModelRequest buildPartial() { + com.google.cloud.automl.v1.UpdateModelRequest result = + new com.google.cloud.automl.v1.UpdateModelRequest(this); + if (modelBuilder_ == null) { + result.model_ = model_; + } else { + result.model_ = modelBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.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.UpdateModelRequest) { + return mergeFrom((com.google.cloud.automl.v1.UpdateModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.UpdateModelRequest other) { + if (other == com.google.cloud.automl.v1.UpdateModelRequest.getDefaultInstance()) return this; + if (other.hasModel()) { + mergeModel(other.getModel()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.UpdateModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.UpdateModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.Model model_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder> + modelBuilder_; + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public boolean hasModel() { + return modelBuilder_ != null || model_ != null; + } + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.Model getModel() { + if (modelBuilder_ == null) { + return model_ == null ? com.google.cloud.automl.v1.Model.getDefaultInstance() : model_; + } else { + return modelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public Builder setModel(com.google.cloud.automl.v1.Model value) { + if (modelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + onChanged(); + } else { + modelBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public Builder setModel(com.google.cloud.automl.v1.Model.Builder builderForValue) { + if (modelBuilder_ == null) { + model_ = builderForValue.build(); + onChanged(); + } else { + modelBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public Builder mergeModel(com.google.cloud.automl.v1.Model value) { + if (modelBuilder_ == null) { + if (model_ != null) { + model_ = + com.google.cloud.automl.v1.Model.newBuilder(model_).mergeFrom(value).buildPartial(); + } else { + model_ = value; + } + onChanged(); + } else { + modelBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public Builder clearModel() { + if (modelBuilder_ == null) { + model_ = null; + onChanged(); + } else { + model_ = null; + modelBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.Model.Builder getModelBuilder() { + + onChanged(); + return getModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + public com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder() { + if (modelBuilder_ != null) { + return modelBuilder_.getMessageOrBuilder(); + } else { + return model_ == null ? com.google.cloud.automl.v1.Model.getDefaultInstance() : model_; + } + } + /** + * + * + *
+     * The model which replaces the resource on the server.
+     * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder> + getModelFieldBuilder() { + if (modelBuilder_ == null) { + modelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Model, + com.google.cloud.automl.v1.Model.Builder, + com.google.cloud.automl.v1.ModelOrBuilder>( + getModel(), getParentForChildren(), isClean()); + model_ = null; + } + return modelBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.UpdateModelRequest) + private static final com.google.cloud.automl.v1.UpdateModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.UpdateModelRequest(); + } + + public static com.google.cloud.automl.v1.UpdateModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateModelRequest(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.UpdateModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateModelRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateModelRequestOrBuilder.java new file mode 100644 index 000000000..8a7d31ebc --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UpdateModelRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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 UpdateModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.UpdateModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The model which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + boolean hasModel(); + /** + * + * + *
+   * The model which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + com.google.cloud.automl.v1.Model getModel(); + /** + * + * + *
+   * The model which replaces the resource on the server.
+   * 
+ * + * .google.cloud.automl.v1.Model model = 1; + */ + com.google.cloud.automl.v1.ModelOrBuilder getModelOrBuilder(); + + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} 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 new file mode 100644 index 000000000..9469c2618 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_payload.proto @@ -0,0 +1,39 @@ +// 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/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 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"; + +// Contains annotation information that is relevant to AutoML. +message AnnotationPayload { + // Output only . Additional information about the annotation + // specific to the AutoML domain. + oneof detail { + // Annotation details for translation. + TranslationAnnotation translation = 2; + } +} 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 new file mode 100644 index 000000000..d5337ac57 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/data_items.proto @@ -0,0 +1,55 @@ +// 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/io.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 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 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]. + string mime_type = 2; + + // Output only. HTTP URI where you can download the content. + string content_uri = 4; +} + +// Example data used for training or prediction. +message ExamplePayload { + // Required. Input only. The example data. + oneof payload { + // Example text. + TextSnippet text_snippet = 2; + } +} 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 new file mode 100644 index 000000000..73b7d6027 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/dataset.proto @@ -0,0 +1,74 @@ +// 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/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 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 workspace for solving a single, particular machine learning (ML) problem. +// A workspace contains examples that may be annotated. +message Dataset { + // Required. + // The dataset metadata that is specific to the problem type. + oneof dataset_metadata { + // Metadata for a dataset used for translation. + TranslationDatasetMetadata translation_dataset_metadata = 23; + } + + // Output only. The resource name of the dataset. + // Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + string name = 1; + + // Required. The name of the dataset to show in the interface. The name can 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. + string display_name = 2; + + // User-provided description of the dataset. The description can be up to + // 25000 characters long. + string description = 3; + + // Output only. The number of examples in the dataset. + int32 example_count = 21; + + // Output only. Timestamp when this dataset was created. + google.protobuf.Timestamp create_time = 14; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 17; + + // Optional. The labels with user-defined metadata to organize your dataset. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 39; +} 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 new file mode 100644 index 000000000..fd835d250 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/io.proto @@ -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 +// +// 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 go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option csharp_namespace = "Google.Cloud.AutoML.V1"; +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. +// +// 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] +// 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 +// 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 +// these values are nondeterministically selected from the given ones. +// +// 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 +// failures, up to a certain count cap, is listed in +// Operation.metadata.partial_failures. +// +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. + GcsSource gcs_source = 1; + } + + // Additional domain-specific parameters describing the semantic of the + // imported data, any string must be up to 25000 + // characters long. + map params = 2; +} + +// * 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. + 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: + // 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; + } +} + +// 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: + // * Full object path, e.g. gs://bucket/directory/object.csv + repeated string input_uris = 1; +} + +// The Google Cloud Storage location where the output is to be written to. +message GcsDestination { + // Required. Google Cloud Storage URI to output directory, up to 2000 + // characters long. + // Accepted forms: + // * 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; +} 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 new file mode 100644 index 000000000..5f820b420 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model.proto @@ -0,0 +1,86 @@ +// 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/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 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"; + +// API proto representing a trained machine learning model. +message Model { + // Deployment state of the model. + enum DeploymentState { + // Should not be used, an un-set enum has this value by default. + DEPLOYMENT_STATE_UNSPECIFIED = 0; + + // Model is deployed. + DEPLOYED = 1; + + // Model is not deployed. + UNDEPLOYED = 2; + } + + // Required. + // The model metadata that is specific to the problem type. + // Must match the metadata type of the dataset used to train the model. + oneof model_metadata { + // Metadata for translation models. + TranslationModelMetadata translation_model_metadata = 15; + } + + // Output only. Resource name of the model. + // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + string name = 1; + + // Required. The name of the model to show in the interface. The name can 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. It must start with a letter. + string display_name = 2; + + // Required. The resource ID of the dataset used to create the model. The dataset must + // come from the same ancestor project and location. + string dataset_id = 3; + + // Output only. Timestamp when the model training finished and can be used for prediction. + google.protobuf.Timestamp create_time = 7; + + // Output only. Timestamp when this model was last updated. + google.protobuf.Timestamp update_time = 11; + + // Output only. Deployment state of the model. A model can only serve + // prediction requests after it gets deployed. + DeploymentState deployment_state = 8; + + // Optional. The labels with user-defined metadata to organize your model. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 34; +} 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 new file mode 100644 index 000000000..fe9df1b94 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model_evaluation.proto @@ -0,0 +1,62 @@ +// 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/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 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"; + +// Evaluation results of a model. +message ModelEvaluation { + // Output only. Problem type specific evaluation metrics. + oneof metrics { + // Model evaluation metrics for translation. + TranslationEvaluationMetrics translation_evaluation_metrics = 9; + } + + // Output only. Resource name of the model evaluation. + // Format: + // + // `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. + string annotation_spec_id = 2; + + // Output only. Timestamp when this model evaluation was created. + google.protobuf.Timestamp create_time = 5; + + // Output only. The number of examples used for model evaluation, i.e. for + // which ground truth from time of model creation is compared against the + // predicted annotations created by the model. + // For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + // 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]. + 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 new file mode 100644 index 000000000..30a1f4689 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/operations.proto @@ -0,0 +1,74 @@ +// 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/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 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"; + +// Metadata used across all long running operations returned by AutoML API. +message OperationMetadata { + // Ouptut only. Details of specific operation. Even if this field is empty, + // the presence allows to distinguish different types of operations. + oneof details { + // Details of a Delete operation. + DeleteOperationMetadata delete_details = 8; + + // Details of CreateModel operation. + CreateModelOperationMetadata create_model_details = 10; + } + + // Output only. Progress of operation. Range: [0, 100]. + // Not used currently. + int32 progress_percent = 13; + + // 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; + + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 3; + + // Output only. Time when the operation was updated for the last time. + google.protobuf.Timestamp update_time = 4; +} + +// Details of operations that perform deletes of any entities. +message DeleteOperationMetadata { + +} + +// Details of CreateModel operation. +message CreateModelOperationMetadata { + +} 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 new file mode 100644 index 000000000..2f0ae2aaa --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/prediction_service.proto @@ -0,0 +1,78 @@ +// 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/annotation_payload.proto"; +import "google/cloud/automl/v1/data_items.proto"; +import "google/cloud/automl/v1/io.proto"; +import "google/longrunning/operations.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// AutoML Prediction API. +// +// On any input that is documented to expect a string parameter in +// snake_case or kebab-case, either of those cases is accepted. +service PredictionService { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // 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. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:predict" + body: "*" + }; + } +} + +// Request message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict]. +message PredictRequest { + // Name of the model requested to serve the prediction. + string name = 1; + + // Required. Payload to perform a prediction on. The payload must match the + // problem type that the model was trained to solve. + ExamplePayload payload = 2; + + // Additional domain-specific parameters, any string must be up to 25000 + // characters long. + map params = 3; +} + +// Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict]. +message PredictResponse { + // Prediction result. + // Translation and Text Sentiment will return precisely one payload. + repeated AnnotationPayload payload = 1; + + // Additional domain-specific prediction response metadata. + map metadata = 2; +} 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 new file mode 100644 index 000000000..f484eefd2 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/service.proto @@ -0,0 +1,372 @@ +// 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/annotation_payload.proto"; +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/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option java_multiple_files = true; +option java_outer_classname = "AutoMlProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// AutoML Server API. +// +// The resource names are assigned by the server. +// The server never reuses names that it has created after the resources with +// those names are deleted. +// +// An ID of a resource is the last element of the item's resource name. For +// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then +// the id for the item is `{dataset_id}`. +// +// Currently the only supported `location_id` is "us-central1". +// +// On any input that is documented to expect a string parameter in +// snake_case or kebab-case, either of those cases is accepted. +service AutoMl { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a dataset. + rpc CreateDataset(CreateDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/datasets" + body: "dataset" + }; + } + + // Gets a dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*}" + }; + } + + // Lists datasets in a project. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/datasets" + }; + } + + // Updates a dataset. + rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1/{dataset.name=projects/*/locations/*/datasets/*}" + body: "dataset" + }; + } + + // Deletes a dataset and all of its contents. + // Returns empty response in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/datasets/*}" + }; + } + + // Imports data into a dataset. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/datasets/*}:importData" + body: "*" + }; + } + + // Exports dataset's data to the provided output location. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/datasets/*}:exportData" + body: "*" + }; + } + + // Creates a model. + // Returns a Model in the [response][google.longrunning.Operation.response] + // field when it completes. + // When you create a model, several model evaluations are created for it: + // a global evaluation, and one evaluation for each annotation spec. + rpc CreateModel(CreateModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/models" + body: "model" + }; + } + + // Gets a model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*}" + }; + } + + // Lists models. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/models" + }; + } + + // Deletes a model. + // Returns `google.protobuf.Empty` in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/models/*}" + }; + } + + // Updates a model. + rpc UpdateModel(UpdateModelRequest) returns (Model) { + option (google.api.http) = { + patch: "/v1/{model.name=projects/*/locations/*/models/*}" + body: "model" + }; + } + + // Gets a model evaluation. + rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + }; + } + + // Lists model evaluations. + rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + }; + } +} + +// Request message for [AutoMl.CreateDataset][google.cloud.automl.v1.AutoMl.CreateDataset]. +message CreateDatasetRequest { + // The resource name of the project to create the dataset for. + string parent = 1; + + // The dataset to create. + Dataset dataset = 2; +} + +// Request message for [AutoMl.GetDataset][google.cloud.automl.v1.AutoMl.GetDataset]. +message GetDatasetRequest { + // The resource name of the dataset to retrieve. + string name = 1; +} + +// Request message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. +message ListDatasetsRequest { + // The resource name of the project from which to list datasets. + string parent = 1; + + // 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: + // + // * `translation_dataset_metadata:*` --> The dataset has + // translation_dataset_metadata. + string filter = 3; + + // Requested page size. Server may return fewer results than requested. + // If unspecified, server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + // [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. +message ListDatasetsResponse { + // The datasets read. + repeated Dataset datasets = 1; + + // A token to retrieve next page of results. + // Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateDataset][google.cloud.automl.v1.AutoMl.UpdateDataset] +message UpdateDatasetRequest { + // The dataset which replaces the resource on the server. + Dataset dataset = 1; + + // Required. The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1.AutoMl.DeleteDataset]. +message DeleteDatasetRequest { + // The resource name of the dataset to delete. + string name = 1; +} + +// Request message for [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData]. +message ImportDataRequest { + // Required. Dataset name. Dataset must already exist. All imported + // annotations and examples will be added. + string name = 1; + + // Required. The desired input location and its domain specific semantics, + // if any. + InputConfig input_config = 3; +} + +// Request message for [AutoMl.ExportData][google.cloud.automl.v1.AutoMl.ExportData]. +message ExportDataRequest { + // Required. The resource name of the dataset. + string name = 1; + + // Required. The desired output location. + OutputConfig output_config = 3; +} + +// Request message for [AutoMl.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel]. +message CreateModelRequest { + // Resource name of the parent project where the model is being created. + string parent = 1; + + // The model to create. + Model model = 4; +} + +// Request message for [AutoMl.GetModel][google.cloud.automl.v1.AutoMl.GetModel]. +message GetModelRequest { + // Resource name of the model. + string name = 1; +} + +// Request message for [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. +message ListModelsRequest { + // Resource name of the project, from which to list the models. + string parent = 1; + + // An expression for filtering the results of the request. + // + // * `model_metadata` - for existence of the case (e.g. + // video_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. + // * `dataset_id=5` --> The model was created from a dataset with ID 5. + string filter = 3; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + // [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. +message ListModelsResponse { + // List of models in the requested page. + repeated Model model = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.DeleteModel][google.cloud.automl.v1.AutoMl.DeleteModel]. +message DeleteModelRequest { + // Resource name of the model being deleted. + string name = 1; +} + +// Request message for [AutoMl.UpdateModel][google.cloud.automl.v1.AutoMl.UpdateModel] +message UpdateModelRequest { + // The model which replaces the resource on the server. + Model model = 1; + + // Required. The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [AutoMl.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation]. +message GetModelEvaluationRequest { + // Resource name for the model evaluation. + string name = 1; +} + +// Request message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsRequest { + // Resource name of the model to list the model evaluations for. + // If modelId is set as "-", this will list model evaluations from across all + // models of the parent location. + string parent = 1; + + // An expression for filtering the results of the request. + // + // * `annotation_spec_id` - for =, != or existence. See example below for + // the last. + // + // Some examples of using the filter are: + // + // * `annotation_spec_id!=4` --> The model evaluation was done for + // annotation spec with ID different than 4. + // * `NOT annotation_spec_id:*` --> The model evaluation was done for + // aggregate of all annotation specs. + string filter = 3; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained via + // [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsResponse { + // List of model evaluations in the requested page. + repeated ModelEvaluation model_evaluation = 1; + + // A token to retrieve next page of results. + // Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + string next_page_token = 2; +} 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 new file mode 100644 index 000000000..bc449fe79 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/translation.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/data_items.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 java_multiple_files = true; +option java_outer_classname = "TranslationProto"; +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 translation. +message TranslationDatasetMetadata { + // Required. The BCP-47 language code of the source language. + string source_language_code = 1; + + // Required. The BCP-47 language code of the target language. + string target_language_code = 2; +} + +// Evaluation metrics for the dataset. +message TranslationEvaluationMetrics { + // Output only. BLEU score. + double bleu_score = 1; + + // Output only. BLEU score for base model. + double base_bleu_score = 2; +} + +// Model metadata that is specific to translation. +message TranslationModelMetadata { + // The resource name of the model to use as a baseline to train the custom + // model. If unset, we use the default base model provided by Google + // Translate. Format: + // `projects/{project_id}/locations/{location_id}/models/{model_id}` + string base_model = 1; + + // Output only. Inferred from the dataset. + // The source languge (The BCP-47 language code) that is used for training. + string source_language_code = 2; + + // Output only. The target languge (The BCP-47 language code) that is used for + // training. + string target_language_code = 3; +} + +// Annotation details specific to translation. +message TranslationAnnotation { + // Output only . The translated content. + TextSnippet translated_content = 1; +} diff --git a/synth.metadata b/synth.metadata index 57a5c884c..c44847a8d 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-09-30T17:55:05.217967Z", + "updateTime": "2019-09-30T21:08:44.463643Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "95a9834487d476dc5cbf81de1136cf8c74d890bc", - "internalRef": "272006912" + "sha": "6e012ef87570a258933df38c7d89732f196780cb", + "internalRef": "272026449" } }, { @@ -34,6 +34,16 @@ "generator": "gapic", "config": "google/cloud/automl/artman_automl_v1beta1.yaml" } + }, + { + "client": { + "source": "googleapis", + "apiName": "automl", + "apiVersion": "v1", + "language": "java", + "generator": "gapic", + "config": "google/cloud/automl/artman_automl_v1.yaml" + } } ] } \ No newline at end of file diff --git a/synth.py b/synth.py index f049d1d0b..d1147c559 100644 --- a/synth.py +++ b/synth.py @@ -21,7 +21,7 @@ gapic = gcp.GAPICGenerator() service = 'automl' -versions = ['v1beta1'] +versions = ['v1beta1', 'v1'] config_pattern = '/google/cloud/automl/artman_automl_{version}.yaml' for version in versions: diff --git a/versions.txt b/versions.txt index 5707fffea..58f8354cb 100644 --- a/versions.txt +++ b/versions.txt @@ -2,5 +2,7 @@ # module:released-version:current-version proto-google-cloud-automl-v1beta1:0.76.1-SNAPSHOT:0.76.1-SNAPSHOT +proto-google-cloud-automl-v1:0.76.1-SNAPSHOT:0.76.1-SNAPSHOT grpc-google-cloud-automl-v1beta1:0.76.1-SNAPSHOT:0.76.1-SNAPSHOT +grpc-google-cloud-automl-v1:0.76.1-SNAPSHOT:0.76.1-SNAPSHOT google-cloud-automl:0.111.1-beta-SNAPSHOT:0.111.1-beta-SNAPSHOT \ No newline at end of file