From 3b70ca52c52fa44fab0c8043a9bc94f113c8bd66 Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Thu, 19 Jul 2018 15:14:24 -0700 Subject: [PATCH 1/2] add vision/v1p3beta1 and automl clients --- .../grpc-google-cloud-automl-v1beta1/pom.xml | 31 + .../cloud/automl/v1beta1/AutoMlGrpc.java | 1631 ++++ .../automl/v1beta1/PredictionServiceGrpc.java | 313 + .../pom.xml | 31 + .../vision/v1p3beta1/ImageAnnotatorGrpc.java | 435 + .../vision/v1p3beta1/ProductSearchGrpc.java | 2262 ++++++ google-api-grpc/pom.xml | 24 +- .../proto-google-cloud-automl-v1beta1/pom.xml | 31 + .../automl/v1beta1/AnnotationPayload.java | 1321 +++ .../v1beta1/AnnotationPayloadOrBuilder.java | 109 + .../v1beta1/AnnotationPayloadOuterClass.java | 73 + .../cloud/automl/v1beta1/AutoMlProto.java | 358 + .../automl/v1beta1/ClassificationProto.java | 5313 ++++++++++++ .../automl/v1beta1/CreateDatasetRequest.java | 781 ++ .../CreateDatasetRequestOrBuilder.java | 52 + .../v1beta1/CreateModelOperationMetadata.java | 396 + ...CreateModelOperationMetadataOrBuilder.java | 9 + .../automl/v1beta1/CreateModelRequest.java | 781 ++ .../v1beta1/CreateModelRequestOrBuilder.java | 52 + .../cloud/automl/v1beta1/DataItems.java | 95 + .../google/cloud/automl/v1beta1/Dataset.java | 1864 +++++ .../cloud/automl/v1beta1/DatasetName.java | 212 + .../automl/v1beta1/DatasetOrBuilder.java | 164 + .../automl/v1beta1/DatasetOuterClass.java | 91 + .../automl/v1beta1/DeleteDatasetRequest.java | 552 ++ .../DeleteDatasetRequestOrBuilder.java | 27 + .../automl/v1beta1/DeleteModelRequest.java | 552 ++ .../v1beta1/DeleteModelRequestOrBuilder.java | 27 + .../automl/v1beta1/DeployModelRequest.java | 552 ++ .../v1beta1/DeployModelRequestOrBuilder.java | 27 + .../cloud/automl/v1beta1/ExamplePayload.java | 969 +++ .../v1beta1/ExamplePayloadOrBuilder.java | 61 + .../automl/v1beta1/ExportDataRequest.java | 781 ++ .../v1beta1/ExportDataRequestOrBuilder.java | 52 + .../cloud/automl/v1beta1/GcsDestination.java | 587 ++ .../v1beta1/GcsDestinationOrBuilder.java | 37 + .../cloud/automl/v1beta1/GcsSource.java | 647 ++ .../automl/v1beta1/GcsSourceOrBuilder.java | 52 + .../automl/v1beta1/GetDatasetRequest.java | 552 ++ .../v1beta1/GetDatasetRequestOrBuilder.java | 27 + .../v1beta1/GetModelEvaluationRequest.java | 552 ++ .../GetModelEvaluationRequestOrBuilder.java | 27 + .../cloud/automl/v1beta1/GetModelRequest.java | 552 ++ .../v1beta1/GetModelRequestOrBuilder.java | 27 + .../google/cloud/automl/v1beta1/Image.java | 971 +++ .../ImageClassificationDatasetMetadata.java | 515 ++ ...lassificationDatasetMetadataOrBuilder.java | 28 + .../ImageClassificationModelMetadata.java | 897 ++ ...eClassificationModelMetadataOrBuilder.java | 74 + .../cloud/automl/v1beta1/ImageOrBuilder.java | 65 + .../cloud/automl/v1beta1/ImageProto.java | 84 + .../automl/v1beta1/ImportDataRequest.java | 788 ++ .../v1beta1/ImportDataRequestOrBuilder.java | 54 + .../cloud/automl/v1beta1/InputConfig.java | 717 ++ .../automl/v1beta1/InputConfigOrBuilder.java | 36 + .../com/google/cloud/automl/v1beta1/Io.java | 100 + .../automl/v1beta1/ListDatasetsRequest.java | 989 +++ .../v1beta1/ListDatasetsRequestOrBuilder.java | 87 + .../automl/v1beta1/ListDatasetsResponse.java | 999 +++ .../ListDatasetsResponseOrBuilder.java | 73 + .../v1beta1/ListModelEvaluationsRequest.java | 1020 +++ .../ListModelEvaluationsRequestOrBuilder.java | 96 + .../v1beta1/ListModelEvaluationsResponse.java | 999 +++ ...ListModelEvaluationsResponseOrBuilder.java | 73 + .../automl/v1beta1/ListModelsRequest.java | 1006 +++ .../v1beta1/ListModelsRequestOrBuilder.java | 92 + .../automl/v1beta1/ListModelsResponse.java | 999 +++ .../v1beta1/ListModelsResponseOrBuilder.java | 73 + .../cloud/automl/v1beta1/LocationName.java | 189 + .../google/cloud/automl/v1beta1/Model.java | 2470 ++++++ .../cloud/automl/v1beta1/ModelEvaluation.java | 1650 ++++ .../automl/v1beta1/ModelEvaluationName.java | 235 + .../v1beta1/ModelEvaluationOrBuilder.java | 150 + .../v1beta1/ModelEvaluationOuterClass.java | 79 + .../cloud/automl/v1beta1/ModelName.java | 212 + .../cloud/automl/v1beta1/ModelOrBuilder.java | 229 + .../cloud/automl/v1beta1/ModelOuterClass.java | 89 + .../automl/v1beta1/OperationMetadata.java | 1758 ++++ .../v1beta1/OperationMetadataOrBuilder.java | 154 + .../cloud/automl/v1beta1/Operations.java | 95 + .../cloud/automl/v1beta1/OutputConfig.java | 717 ++ .../automl/v1beta1/OutputConfigOrBuilder.java | 36 + .../cloud/automl/v1beta1/PredictRequest.java | 1192 +++ .../v1beta1/PredictRequestOrBuilder.java | 142 + .../cloud/automl/v1beta1/PredictResponse.java | 1156 +++ .../v1beta1/PredictResponseOrBuilder.java | 107 + .../v1beta1/PredictionServiceProto.java | 122 + .../TextClassificationDatasetMetadata.java | 515 ++ ...lassificationDatasetMetadataOrBuilder.java | 28 + .../TextClassificationModelMetadata.java | 396 + ...tClassificationModelMetadataOrBuilder.java | 9 + .../cloud/automl/v1beta1/TextProto.java | 79 + .../cloud/automl/v1beta1/TextSnippet.java | 890 ++ .../automl/v1beta1/TextSnippetOrBuilder.java | 71 + .../automl/v1beta1/TranslationAnnotation.java | 626 ++ .../TranslationAnnotationOrBuilder.java | 34 + .../v1beta1/TranslationDatasetMetadata.java | 707 ++ .../TranslationDatasetMetadataOrBuilder.java | 45 + .../v1beta1/TranslationEvaluationMetrics.java | 551 ++ ...TranslationEvaluationMetricsOrBuilder.java | 27 + .../v1beta1/TranslationModelMetadata.java | 897 ++ .../TranslationModelMetadataOrBuilder.java | 73 + .../automl/v1beta1/TranslationProto.java | 107 + .../automl/v1beta1/UndeployModelRequest.java | 552 ++ .../UndeployModelRequestOrBuilder.java | 27 + .../automl/v1beta1/annotation_payload.proto | 51 + .../cloud/automl/v1beta1/classification.proto | 118 + .../cloud/automl/v1beta1/data_items.proto | 73 + .../google/cloud/automl/v1beta1/dataset.proto | 63 + .../google/cloud/automl/v1beta1/image.proto | 56 + .../google/cloud/automl/v1beta1/io.proto | 61 + .../google/cloud/automl/v1beta1/model.proto | 85 + .../automl/v1beta1/model_evaluation.proto | 61 + .../cloud/automl/v1beta1/operations.proto | 59 + .../automl/v1beta1/prediction_service.proto | 73 + .../google/cloud/automl/v1beta1/service.proto | 365 + .../google/cloud/automl/v1beta1/text.proto | 38 + .../cloud/automl/v1beta1/translation.proto | 67 + .../pom.xml | 31 + .../AddProductToProductSetRequest.java | 735 ++ ...ddProductToProductSetRequestOrBuilder.java | 53 + .../v1p3beta1/AnnotateFileResponse.java | 1068 +++ .../AnnotateFileResponseOrBuilder.java | 78 + .../v1p3beta1/AnnotateImageRequest.java | 1297 +++ .../AnnotateImageRequestOrBuilder.java | 103 + .../v1p3beta1/AnnotateImageResponse.java | 4939 +++++++++++ .../AnnotateImageResponseOrBuilder.java | 496 ++ .../v1p3beta1/AsyncAnnotateFileRequest.java | 1524 ++++ .../AsyncAnnotateFileRequestOrBuilder.java | 128 + .../v1p3beta1/AsyncAnnotateFileResponse.java | 626 ++ .../AsyncAnnotateFileResponseOrBuilder.java | 34 + .../AsyncBatchAnnotateFilesRequest.java | 836 ++ ...yncBatchAnnotateFilesRequestOrBuilder.java | 53 + .../AsyncBatchAnnotateFilesResponse.java | 857 ++ ...ncBatchAnnotateFilesResponseOrBuilder.java | 58 + .../v1p3beta1/BatchAnnotateImagesRequest.java | 834 ++ .../BatchAnnotateImagesRequestOrBuilder.java | 53 + .../BatchAnnotateImagesResponse.java | 834 ++ .../BatchAnnotateImagesResponseOrBuilder.java | 53 + .../v1p3beta1/BatchOperationMetadata.java | 1157 +++ .../BatchOperationMetadataOrBuilder.java | 79 + .../google/cloud/vision/v1p3beta1/Block.java | 1837 +++++ .../vision/v1p3beta1/BlockOrBuilder.java | 171 + .../cloud/vision/v1p3beta1/BoundingPoly.java | 1269 +++ .../v1p3beta1/BoundingPolyOrBuilder.java | 97 + .../cloud/vision/v1p3beta1/ColorInfo.java | 786 ++ .../vision/v1p3beta1/ColorInfoOrBuilder.java | 53 + .../v1p3beta1/CreateProductRequest.java | 971 +++ .../CreateProductRequestOrBuilder.java | 80 + .../v1p3beta1/CreateProductSetRequest.java | 964 +++ .../CreateProductSetRequestOrBuilder.java | 78 + .../CreateReferenceImageRequest.java | 983 +++ .../CreateReferenceImageRequestOrBuilder.java | 83 + .../cloud/vision/v1p3beta1/CropHint.java | 796 ++ .../vision/v1p3beta1/CropHintOrBuilder.java | 56 + .../vision/v1p3beta1/CropHintsAnnotation.java | 834 ++ .../CropHintsAnnotationOrBuilder.java | 53 + .../vision/v1p3beta1/CropHintsParams.java | 645 ++ .../v1p3beta1/CropHintsParamsOrBuilder.java | 49 + .../v1p3beta1/DeleteProductRequest.java | 566 ++ .../DeleteProductRequestOrBuilder.java | 31 + .../v1p3beta1/DeleteProductSetRequest.java | 566 ++ .../DeleteProductSetRequestOrBuilder.java | 31 + .../DeleteReferenceImageRequest.java | 566 ++ .../DeleteReferenceImageRequestOrBuilder.java | 31 + .../v1p3beta1/DominantColorsAnnotation.java | 834 ++ .../DominantColorsAnnotationOrBuilder.java | 53 + .../vision/v1p3beta1/EntityAnnotation.java | 2377 ++++++ .../v1p3beta1/EntityAnnotationOrBuilder.java | 245 + .../vision/v1p3beta1/FaceAnnotation.java | 4069 ++++++++++ .../v1p3beta1/FaceAnnotationOrBuilder.java | 305 + .../cloud/vision/v1p3beta1/Feature.java | 1074 +++ .../vision/v1p3beta1/FeatureOrBuilder.java | 58 + .../vision/v1p3beta1/GcsDestination.java | 629 ++ .../v1p3beta1/GcsDestinationOrBuilder.java | 49 + .../cloud/vision/v1p3beta1/GcsSource.java | 559 ++ .../vision/v1p3beta1/GcsSourceOrBuilder.java | 29 + .../cloud/vision/v1p3beta1/GeometryProto.java | 115 + .../vision/v1p3beta1/GetProductRequest.java | 566 ++ .../v1p3beta1/GetProductRequestOrBuilder.java | 31 + .../v1p3beta1/GetProductSetRequest.java | 566 ++ .../GetProductSetRequestOrBuilder.java | 31 + .../v1p3beta1/GetReferenceImageRequest.java | 566 ++ .../GetReferenceImageRequestOrBuilder.java | 31 + .../google/cloud/vision/v1p3beta1/Image.java | 735 ++ .../v1p3beta1/ImageAnnotationContext.java | 632 ++ .../ImageAnnotationContextOrBuilder.java | 37 + .../vision/v1p3beta1/ImageAnnotatorProto.java | 648 ++ .../cloud/vision/v1p3beta1/ImageContext.java | 1631 ++++ .../v1p3beta1/ImageContextOrBuilder.java | 172 + .../vision/v1p3beta1/ImageOrBuilder.java | 51 + .../vision/v1p3beta1/ImageProperties.java | 626 ++ .../v1p3beta1/ImagePropertiesOrBuilder.java | 34 + .../cloud/vision/v1p3beta1/ImageSource.java | 826 ++ .../v1p3beta1/ImageSourceOrBuilder.java | 79 + .../v1p3beta1/ImportProductSetsGcsSource.java | 848 ++ .../ImportProductSetsGcsSourceOrBuilder.java | 111 + .../ImportProductSetsInputConfig.java | 729 ++ ...ImportProductSetsInputConfigOrBuilder.java | 39 + .../v1p3beta1/ImportProductSetsRequest.java | 788 ++ .../ImportProductSetsRequestOrBuilder.java | 54 + .../v1p3beta1/ImportProductSetsResponse.java | 1367 ++++ .../ImportProductSetsResponseOrBuilder.java | 117 + .../cloud/vision/v1p3beta1/InputConfig.java | 788 ++ .../v1p3beta1/InputConfigOrBuilder.java | 54 + .../cloud/vision/v1p3beta1/LatLongRect.java | 855 ++ .../v1p3beta1/LatLongRectOrBuilder.java | 59 + .../cloud/vision/v1p3beta1/Likelihood.java | 192 + .../v1p3beta1/ListProductSetsRequest.java | 788 ++ .../ListProductSetsRequestOrBuilder.java | 56 + .../v1p3beta1/ListProductSetsResponse.java | 999 +++ .../ListProductSetsResponseOrBuilder.java | 73 + .../ListProductsInProductSetRequest.java | 795 ++ ...tProductsInProductSetRequestOrBuilder.java | 58 + .../ListProductsInProductSetResponse.java | 999 +++ ...ProductsInProductSetResponseOrBuilder.java | 73 + .../vision/v1p3beta1/ListProductsRequest.java | 795 ++ .../ListProductsRequestOrBuilder.java | 58 + .../v1p3beta1/ListProductsResponse.java | 999 +++ .../ListProductsResponseOrBuilder.java | 73 + .../v1p3beta1/ListReferenceImagesRequest.java | 809 ++ .../ListReferenceImagesRequestOrBuilder.java | 62 + .../ListReferenceImagesResponse.java | 1066 +++ .../ListReferenceImagesResponseOrBuilder.java | 80 + .../v1p3beta1/LocalizedObjectAnnotation.java | 1182 +++ .../LocalizedObjectAnnotationOrBuilder.java | 101 + .../cloud/vision/v1p3beta1/LocationInfo.java | 626 ++ .../v1p3beta1/LocationInfoOrBuilder.java | 34 + .../cloud/vision/v1p3beta1/LocationName.java | 189 + .../v1p3beta1/NormalizedBoundingPoly.java | 834 ++ .../NormalizedBoundingPolyOrBuilder.java | 53 + .../vision/v1p3beta1/NormalizedVertex.java | 555 ++ .../v1p3beta1/NormalizedVertexOrBuilder.java | 27 + .../vision/v1p3beta1/OperationMetadata.java | 1135 +++ .../v1p3beta1/OperationMetadataOrBuilder.java | 76 + .../cloud/vision/v1p3beta1/OutputConfig.java | 732 ++ .../v1p3beta1/OutputConfigOrBuilder.java | 51 + .../google/cloud/vision/v1p3beta1/Page.java | 1299 +++ .../cloud/vision/v1p3beta1/PageOrBuilder.java | 107 + .../cloud/vision/v1p3beta1/Paragraph.java | 1540 ++++ .../vision/v1p3beta1/ParagraphOrBuilder.java | 154 + .../cloud/vision/v1p3beta1/Position.java | 632 ++ .../vision/v1p3beta1/PositionOrBuilder.java | 36 + .../cloud/vision/v1p3beta1/Product.java | 2404 ++++++ .../cloud/vision/v1p3beta1/ProductName.java | 212 + .../vision/v1p3beta1/ProductOrBuilder.java | 169 + .../v1p3beta1/ProductSearchCategory.java | 140 + .../vision/v1p3beta1/ProductSearchParams.java | 2077 +++++ .../ProductSearchParamsOrBuilder.java | 243 + .../vision/v1p3beta1/ProductSearchProto.java | 131 + .../v1p3beta1/ProductSearchResults.java | 3594 ++++++++ .../ProductSearchResultsOrBuilder.java | 166 + .../v1p3beta1/ProductSearchResultsView.java | 127 + .../v1p3beta1/ProductSearchServiceProto.java | 567 ++ .../cloud/vision/v1p3beta1/ProductSet.java | 1257 +++ .../vision/v1p3beta1/ProductSetName.java | 212 + .../vision/v1p3beta1/ProductSetOrBuilder.java | 118 + .../cloud/vision/v1p3beta1/Property.java | 782 ++ .../vision/v1p3beta1/PropertyOrBuilder.java | 54 + .../vision/v1p3beta1/ReferenceImage.java | 1322 +++ .../vision/v1p3beta1/ReferenceImageName.java | 235 + .../v1p3beta1/ReferenceImageOrBuilder.java | 129 + .../RemoveProductFromProductSetRequest.java | 735 ++ ...ProductFromProductSetRequestOrBuilder.java | 53 + .../v1p3beta1/SafeSearchAnnotation.java | 1005 +++ .../SafeSearchAnnotationOrBuilder.java | 108 + .../google/cloud/vision/v1p3beta1/Symbol.java | 1255 +++ .../vision/v1p3beta1/SymbolOrBuilder.java | 128 + .../vision/v1p3beta1/TextAnnotation.java | 3607 ++++++++ .../v1p3beta1/TextAnnotationOrBuilder.java | 71 + .../vision/v1p3beta1/TextAnnotationProto.java | 198 + .../v1p3beta1/UpdateProductRequest.java | 915 +++ .../UpdateProductRequestOrBuilder.java | 74 + .../v1p3beta1/UpdateProductSetRequest.java | 891 ++ .../UpdateProductSetRequestOrBuilder.java | 68 + .../google/cloud/vision/v1p3beta1/Vertex.java | 547 ++ .../vision/v1p3beta1/VertexOrBuilder.java | 27 + .../cloud/vision/v1p3beta1/WebDetection.java | 7229 +++++++++++++++++ .../v1p3beta1/WebDetectionOrBuilder.java | 288 + .../vision/v1p3beta1/WebDetectionParams.java | 472 ++ .../WebDetectionParamsOrBuilder.java | 18 + .../vision/v1p3beta1/WebDetectionProto.java | 129 + .../google/cloud/vision/v1p3beta1/Word.java | 1563 ++++ .../cloud/vision/v1p3beta1/WordOrBuilder.java | 159 + .../cloud/vision/v1p3beta1/geometry.proto | 76 + .../vision/v1p3beta1/image_annotator.proto | 801 ++ .../vision/v1p3beta1/product_search.proto | 161 + .../v1p3beta1/product_search_service.proto | 825 ++ .../vision/v1p3beta1/text_annotation.proto | 259 + .../vision/v1p3beta1/web_detection.proto | 105 + google-cloud-bom/pom.xml | 14 +- .../google-cloud-automl/README.md | 102 + .../google-cloud-automl/pom.xml | 68 + .../cloud/automl/v1beta1/AutoMlClient.java | 2090 +++++ .../cloud/automl/v1beta1/AutoMlSettings.java | 404 + .../v1beta1/PredictionServiceClient.java | 301 + .../v1beta1/PredictionServiceSettings.java | 174 + .../cloud/automl/v1beta1/package-info.java | 62 + .../cloud/automl/v1beta1/stub/AutoMlStub.java | 169 + .../v1beta1/stub/AutoMlStubSettings.java | 1018 +++ .../stub/GrpcAutoMlCallableFactory.java | 116 + .../automl/v1beta1/stub/GrpcAutoMlStub.java | 539 ++ .../GrpcPredictionServiceCallableFactory.java | 116 + .../stub/GrpcPredictionServiceStub.java | 141 + .../v1beta1/stub/PredictionServiceStub.java | 41 + .../stub/PredictionServiceStubSettings.java | 264 + .../automl/v1beta1/AutoMlClientTest.java | 744 ++ .../cloud/automl/v1beta1/MockAutoMl.java | 57 + .../cloud/automl/v1beta1/MockAutoMlImpl.java | 263 + .../automl/v1beta1/MockPredictionService.java | 57 + .../v1beta1/MockPredictionServiceImpl.java | 72 + .../v1beta1/PredictionServiceClientTest.java | 123 + .../google-cloud-vision/pom.xml | 8 +- .../v1p3beta1/ImageAnnotatorClient.java | 383 + .../v1p3beta1/ImageAnnotatorSettings.java | 209 + .../vision/v1p3beta1/ProductSearchClient.java | 2999 +++++++ .../v1p3beta1/ProductSearchSettings.java | 399 + .../cloud/vision/v1p3beta1/package-info.java | 70 + .../GrpcImageAnnotatorCallableFactory.java | 116 + .../stub/GrpcImageAnnotatorStub.java | 205 + .../GrpcProductSearchCallableFactory.java | 116 + .../v1p3beta1/stub/GrpcProductSearchStub.java | 633 ++ .../v1p3beta1/stub/ImageAnnotatorStub.java | 66 + .../stub/ImageAnnotatorStubSettings.java | 359 + .../v1p3beta1/stub/ProductSearchStub.java | 180 + .../stub/ProductSearchStubSettings.java | 1047 +++ .../v1p3beta1/ImageAnnotatorClientTest.java | 169 + .../v1p3beta1/ImageAnnotatorSmokeTest.java | 73 + .../vision/v1p3beta1/MockImageAnnotator.java | 57 + .../v1p3beta1/MockImageAnnotatorImpl.java | 90 + .../vision/v1p3beta1/MockProductSearch.java | 57 + .../v1p3beta1/MockProductSearchImpl.java | 330 + .../v1p3beta1/ProductSearchClientTest.java | 904 +++ versions.txt | 8 +- 334 files changed, 170929 insertions(+), 27 deletions(-) create mode 100644 google-api-grpc/grpc-google-cloud-automl-v1beta1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlGrpc.java create mode 100644 google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceGrpc.java create mode 100644 google-api-grpc/grpc-google-cloud-vision-v1p3beta1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorGrpc.java create mode 100644 google-api-grpc/grpc-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchGrpc.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayload.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayloadOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayloadOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlProto.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ClassificationProto.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateDatasetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateDatasetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelOperationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelOperationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DataItems.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Dataset.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetName.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteDatasetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteDatasetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteModelRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteModelRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeployModelRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeployModelRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExamplePayload.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExamplePayloadOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportDataRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportDataRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsDestination.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsDestinationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsSource.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsSourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetDatasetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetDatasetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelEvaluationRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelEvaluationRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Image.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationDatasetMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationDatasetMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageProto.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImportDataRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImportDataRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Io.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/LocationName.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Model.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluation.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationName.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelName.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OperationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OperationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Operations.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OutputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OutputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponse.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceProto.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationDatasetMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationDatasetMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextProto.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippet.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationDatasetMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationDatasetMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationEvaluationMetrics.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationEvaluationMetricsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationModelMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationModelMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationProto.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/UndeployModelRequest.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/UndeployModelRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/annotation_payload.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/classification.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/dataset.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/image.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/model.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/model_evaluation.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/operations.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/prediction_service.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/service.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/text.proto create mode 100644 google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/translation.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AddProductToProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AddProductToProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateFileResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateFileResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchOperationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchOperationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Block.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BlockOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BoundingPoly.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BoundingPolyOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ColorInfo.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ColorInfoOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHint.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsParams.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsParamsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DominantColorsAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DominantColorsAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/EntityAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/EntityAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FaceAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FaceAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Feature.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FeatureOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsDestination.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsDestinationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsSource.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsSourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GeometryProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Image.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotationContext.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotationContextOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageContext.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageContextOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageProperties.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImagePropertiesOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageSource.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageSourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsGcsSource.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsGcsSourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsInputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsInputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/InputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/InputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LatLongRect.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LatLongRectOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Likelihood.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocalizedObjectAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocalizedObjectAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationInfo.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationInfoOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedBoundingPoly.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedBoundingPolyOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedVertex.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedVertexOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OperationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OperationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OutputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OutputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Page.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PageOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Paragraph.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ParagraphOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Position.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PositionOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Product.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchCategory.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchParams.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchParamsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResults.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResultsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResultsView.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchServiceProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSet.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSetName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Property.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PropertyOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImage.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImageName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImageOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/RemoveProductFromProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/RemoveProductFromProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SafeSearchAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SafeSearchAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Symbol.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SymbolOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotationProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Vertex.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/VertexOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetection.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionParams.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionParamsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Word.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WordOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/geometry.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/image_annotator.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/product_search.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/product_search_service.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/text_annotation.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/web_detection.proto create mode 100644 google-cloud-clients/google-cloud-automl/README.md create mode 100644 google-cloud-clients/google-cloud-automl/pom.xml create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceClient.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceSettings.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/package-info.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStubSettings.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlStub.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcPredictionServiceCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcPredictionServiceStub.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStub.java create mode 100644 google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStubSettings.java create mode 100644 google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/AutoMlClientTest.java create mode 100644 google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockAutoMl.java create mode 100644 google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockAutoMlImpl.java create mode 100644 google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockPredictionService.java create mode 100644 google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockPredictionServiceImpl.java create mode 100644 google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/PredictionServiceClientTest.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorClient.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/package-info.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcImageAnnotatorCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcImageAnnotatorStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStubSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStubSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorClientTest.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorSmokeTest.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockImageAnnotator.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockImageAnnotatorImpl.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockProductSearch.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockProductSearchImpl.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ProductSearchClientTest.java diff --git a/google-api-grpc/grpc-google-cloud-automl-v1beta1/pom.xml b/google-api-grpc/grpc-google-cloud-automl-v1beta1/pom.xml new file mode 100644 index 000000000000..5788569f7cef --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-automl-v1beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-automl-v1beta1 + 0.19.1-SNAPSHOT + grpc-google-cloud-automl-v1beta1 + GRPC library for grpc-google-cloud-automl-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.19.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-automl-v1beta1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlGrpc.java b/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlGrpc.java new file mode 100644 index 000000000000..83b2118bd310 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlGrpc.java @@ -0,0 +1,1631 @@ +package com.google.cloud.automl.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +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}`.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/automl/v1beta1/service.proto") +public final class AutoMlGrpc { + + private AutoMlGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.automl.v1beta1.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 METHOD_CREATE_DATASET = getCreateDatasetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateDatasetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateDatasetMethod() { + return getCreateDatasetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateDatasetMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "CreateDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.CreateDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.Dataset.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 METHOD_GET_DATASET = getGetDatasetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetDatasetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetDatasetMethod() { + return getGetDatasetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetDatasetMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "GetDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.GetDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 METHOD_LIST_DATASETS = getListDatasetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListDatasetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListDatasetsMethod() { + return getListDatasetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListDatasetsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "ListDatasets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.ListDatasetsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 #getDeleteDatasetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_DATASET = getDeleteDatasetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteDatasetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteDatasetMethod() { + return getDeleteDatasetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteDatasetMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "DeleteDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 METHOD_IMPORT_DATA = getImportDataMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getImportDataMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getImportDataMethod() { + return getImportDataMethodHelper(); + } + + private static io.grpc.MethodDescriptor getImportDataMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "ImportData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 METHOD_EXPORT_DATA = getExportDataMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getExportDataMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getExportDataMethod() { + return getExportDataMethodHelper(); + } + + private static io.grpc.MethodDescriptor getExportDataMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "ExportData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 METHOD_CREATE_MODEL = getCreateModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateModelMethod() { + return getCreateModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateModelMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "CreateModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 METHOD_GET_MODEL = getGetModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetModelMethod() { + return getGetModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetModelMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "GetModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.GetModelRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 METHOD_LIST_MODELS = getListModelsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListModelsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListModelsMethod() { + return getListModelsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListModelsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "ListModels")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.ListModelsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 METHOD_DELETE_MODEL = getDeleteModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteModelMethod() { + return getDeleteModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteModelMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "DeleteModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 #getDeployModelMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DEPLOY_MODEL = getDeployModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeployModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeployModelMethod() { + return getDeployModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeployModelMethodHelper() { + io.grpc.MethodDescriptor getDeployModelMethod; + if ((getDeployModelMethod = AutoMlGrpc.getDeployModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getDeployModelMethod = AutoMlGrpc.getDeployModelMethod) == null) { + AutoMlGrpc.getDeployModelMethod = getDeployModelMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.automl.v1beta1.AutoMl", "DeployModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.DeployModelRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("DeployModel")) + .build(); + } + } + } + return getDeployModelMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUndeployModelMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UNDEPLOY_MODEL = getUndeployModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUndeployModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUndeployModelMethod() { + return getUndeployModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUndeployModelMethodHelper() { + io.grpc.MethodDescriptor getUndeployModelMethod; + if ((getUndeployModelMethod = AutoMlGrpc.getUndeployModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getUndeployModelMethod = AutoMlGrpc.getUndeployModelMethod) == null) { + AutoMlGrpc.getUndeployModelMethod = getUndeployModelMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.automl.v1beta1.AutoMl", "UndeployModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.UndeployModelRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("UndeployModel")) + .build(); + } + } + } + return getUndeployModelMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetModelEvaluationMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_MODEL_EVALUATION = getGetModelEvaluationMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetModelEvaluationMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetModelEvaluationMethod() { + return getGetModelEvaluationMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetModelEvaluationMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "GetModelEvaluation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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 METHOD_LIST_MODEL_EVALUATIONS = getListModelEvaluationsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListModelEvaluationsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListModelEvaluationsMethod() { + return getListModelEvaluationsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListModelEvaluationsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.AutoMl", "ListModelEvaluations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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}`.
+   * 
+ */ + public static abstract class AutoMlImplBase implements io.grpc.BindableService { + + /** + *
+     * Creates a dataset.
+     * 
+ */ + public void createDataset(com.google.cloud.automl.v1beta1.CreateDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateDatasetMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a dataset.
+     * 
+ */ + public void getDataset(com.google.cloud.automl.v1beta1.GetDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetDatasetMethodHelper(), responseObserver); + } + + /** + *
+     * Lists datasets in a project.
+     * 
+ */ + public void listDatasets(com.google.cloud.automl.v1beta1.ListDatasetsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListDatasetsMethodHelper(), 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.v1beta1.DeleteDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteDatasetMethodHelper(), responseObserver); + } + + /** + *
+     * Imports data into a dataset.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void importData(com.google.cloud.automl.v1beta1.ImportDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getImportDataMethodHelper(), responseObserver); + } + + /** + *
+     * Exports dataset's data to a Google Cloud Storage bucket.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void exportData(com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateModelMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a model.
+     * 
+ */ + public void getModel(com.google.cloud.automl.v1beta1.GetModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetModelMethodHelper(), responseObserver); + } + + /** + *
+     * Lists models.
+     * 
+ */ + public void listModels(com.google.cloud.automl.v1beta1.ListModelsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListModelsMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes a model.
+     * If a model is already deployed, this only deletes the model in AutoML BE,
+     * and does not change the status of the deployed model in the production
+     * environment.
+     * 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.v1beta1.DeleteModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteModelMethodHelper(), responseObserver); + } + + /** + *
+     * Deploys model.
+     * Returns a [DeployModelResponse][] in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void deployModel(com.google.cloud.automl.v1beta1.DeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeployModelMethodHelper(), responseObserver); + } + + /** + *
+     * Undeploys model.
+     * Returns an `UndeployModelResponse` in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void undeployModel(com.google.cloud.automl.v1beta1.UndeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUndeployModelMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a model evaluation.
+     * 
+ */ + public void getModelEvaluation(com.google.cloud.automl.v1beta1.GetModelEvaluationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetModelEvaluationMethodHelper(), responseObserver); + } + + /** + *
+     * Lists model evaluations.
+     * 
+ */ + public void listModelEvaluations(com.google.cloud.automl.v1beta1.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.v1beta1.CreateDatasetRequest, + com.google.cloud.automl.v1beta1.Dataset>( + this, METHODID_CREATE_DATASET))) + .addMethod( + getGetDatasetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.GetDatasetRequest, + com.google.cloud.automl.v1beta1.Dataset>( + this, METHODID_GET_DATASET))) + .addMethod( + getListDatasetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.ListDatasetsRequest, + com.google.cloud.automl.v1beta1.ListDatasetsResponse>( + this, METHODID_LIST_DATASETS))) + .addMethod( + getDeleteDatasetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.DeleteDatasetRequest, + com.google.longrunning.Operation>( + this, METHODID_DELETE_DATASET))) + .addMethod( + getImportDataMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.ImportDataRequest, + com.google.longrunning.Operation>( + this, METHODID_IMPORT_DATA))) + .addMethod( + getExportDataMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.ExportDataRequest, + com.google.longrunning.Operation>( + this, METHODID_EXPORT_DATA))) + .addMethod( + getCreateModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.CreateModelRequest, + com.google.longrunning.Operation>( + this, METHODID_CREATE_MODEL))) + .addMethod( + getGetModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.GetModelRequest, + com.google.cloud.automl.v1beta1.Model>( + this, METHODID_GET_MODEL))) + .addMethod( + getListModelsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.ListModelsRequest, + com.google.cloud.automl.v1beta1.ListModelsResponse>( + this, METHODID_LIST_MODELS))) + .addMethod( + getDeleteModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.DeleteModelRequest, + com.google.longrunning.Operation>( + this, METHODID_DELETE_MODEL))) + .addMethod( + getDeployModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.DeployModelRequest, + com.google.longrunning.Operation>( + this, METHODID_DEPLOY_MODEL))) + .addMethod( + getUndeployModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.UndeployModelRequest, + com.google.longrunning.Operation>( + this, METHODID_UNDEPLOY_MODEL))) + .addMethod( + getGetModelEvaluationMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest, + com.google.cloud.automl.v1beta1.ModelEvaluation>( + this, METHODID_GET_MODEL_EVALUATION))) + .addMethod( + getListModelEvaluationsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest, + com.google.cloud.automl.v1beta1.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}`.
+   * 
+ */ + 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.v1beta1.CreateDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateDatasetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a dataset.
+     * 
+ */ + public void getDataset(com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListDatasetsMethodHelper(), 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.v1beta1.DeleteDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteDatasetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Imports data into a dataset.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void importData(com.google.cloud.automl.v1beta1.ImportDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getImportDataMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Exports dataset's data to a Google Cloud Storage bucket.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void exportData(com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateModelMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a model.
+     * 
+ */ + public void getModel(com.google.cloud.automl.v1beta1.GetModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetModelMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists models.
+     * 
+ */ + public void listModels(com.google.cloud.automl.v1beta1.ListModelsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListModelsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes a model.
+     * If a model is already deployed, this only deletes the model in AutoML BE,
+     * and does not change the status of the deployed model in the production
+     * environment.
+     * 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.v1beta1.DeleteModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteModelMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deploys model.
+     * Returns a [DeployModelResponse][] in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void deployModel(com.google.cloud.automl.v1beta1.DeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeployModelMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Undeploys model.
+     * Returns an `UndeployModelResponse` in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void undeployModel(com.google.cloud.automl.v1beta1.UndeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUndeployModelMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a model evaluation.
+     * 
+ */ + public void getModelEvaluation(com.google.cloud.automl.v1beta1.GetModelEvaluationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetModelEvaluationMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists model evaluations.
+     * 
+ */ + public void listModelEvaluations(com.google.cloud.automl.v1beta1.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}`.
+   * 
+ */ + 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.cloud.automl.v1beta1.Dataset createDataset(com.google.cloud.automl.v1beta1.CreateDatasetRequest request) { + return blockingUnaryCall( + getChannel(), getCreateDatasetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a dataset.
+     * 
+ */ + public com.google.cloud.automl.v1beta1.Dataset getDataset(com.google.cloud.automl.v1beta1.GetDatasetRequest request) { + return blockingUnaryCall( + getChannel(), getGetDatasetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists datasets in a project.
+     * 
+ */ + public com.google.cloud.automl.v1beta1.ListDatasetsResponse listDatasets(com.google.cloud.automl.v1beta1.ListDatasetsRequest request) { + return blockingUnaryCall( + getChannel(), getListDatasetsMethodHelper(), 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.v1beta1.DeleteDatasetRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteDatasetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Imports data into a dataset.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.longrunning.Operation importData(com.google.cloud.automl.v1beta1.ImportDataRequest request) { + return blockingUnaryCall( + getChannel(), getImportDataMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Exports dataset's data to a Google Cloud Storage bucket.
+     * 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.v1beta1.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.v1beta1.CreateModelRequest request) { + return blockingUnaryCall( + getChannel(), getCreateModelMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a model.
+     * 
+ */ + public com.google.cloud.automl.v1beta1.Model getModel(com.google.cloud.automl.v1beta1.GetModelRequest request) { + return blockingUnaryCall( + getChannel(), getGetModelMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists models.
+     * 
+ */ + public com.google.cloud.automl.v1beta1.ListModelsResponse listModels(com.google.cloud.automl.v1beta1.ListModelsRequest request) { + return blockingUnaryCall( + getChannel(), getListModelsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes a model.
+     * If a model is already deployed, this only deletes the model in AutoML BE,
+     * and does not change the status of the deployed model in the production
+     * environment.
+     * 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.v1beta1.DeleteModelRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteModelMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deploys model.
+     * Returns a [DeployModelResponse][] in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.longrunning.Operation deployModel(com.google.cloud.automl.v1beta1.DeployModelRequest request) { + return blockingUnaryCall( + getChannel(), getDeployModelMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Undeploys model.
+     * Returns an `UndeployModelResponse` in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.longrunning.Operation undeployModel(com.google.cloud.automl.v1beta1.UndeployModelRequest request) { + return blockingUnaryCall( + getChannel(), getUndeployModelMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a model evaluation.
+     * 
+ */ + public com.google.cloud.automl.v1beta1.ModelEvaluation getModelEvaluation(com.google.cloud.automl.v1beta1.GetModelEvaluationRequest request) { + return blockingUnaryCall( + getChannel(), getGetModelEvaluationMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists model evaluations.
+     * 
+ */ + public com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse listModelEvaluations(com.google.cloud.automl.v1beta1.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}`.
+   * 
+ */ + 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.v1beta1.CreateDatasetRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateDatasetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getDataset( + com.google.cloud.automl.v1beta1.GetDatasetRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetDatasetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists datasets in a project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listDatasets( + com.google.cloud.automl.v1beta1.ListDatasetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListDatasetsMethodHelper(), 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.v1beta1.DeleteDatasetRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteDatasetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Imports data into a dataset.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture importData( + com.google.cloud.automl.v1beta1.ImportDataRequest request) { + return futureUnaryCall( + getChannel().newCall(getImportDataMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Exports dataset's data to a Google Cloud Storage bucket.
+     * 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.v1beta1.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.v1beta1.CreateModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateModelMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a model.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getModel( + com.google.cloud.automl.v1beta1.GetModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetModelMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists models.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listModels( + com.google.cloud.automl.v1beta1.ListModelsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListModelsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes a model.
+     * If a model is already deployed, this only deletes the model in AutoML BE,
+     * and does not change the status of the deployed model in the production
+     * environment.
+     * 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.v1beta1.DeleteModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteModelMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deploys model.
+     * Returns a [DeployModelResponse][] in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deployModel( + com.google.cloud.automl.v1beta1.DeployModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeployModelMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Undeploys model.
+     * Returns an `UndeployModelResponse` in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture undeployModel( + com.google.cloud.automl.v1beta1.UndeployModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getUndeployModelMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a model evaluation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getModelEvaluation( + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetModelEvaluationMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists model evaluations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listModelEvaluations( + com.google.cloud.automl.v1beta1.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_DELETE_DATASET = 3; + private static final int METHODID_IMPORT_DATA = 4; + private static final int METHODID_EXPORT_DATA = 5; + private static final int METHODID_CREATE_MODEL = 6; + private static final int METHODID_GET_MODEL = 7; + private static final int METHODID_LIST_MODELS = 8; + private static final int METHODID_DELETE_MODEL = 9; + private static final int METHODID_DEPLOY_MODEL = 10; + private static final int METHODID_UNDEPLOY_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.v1beta1.CreateDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DATASET: + serviceImpl.getDataset((com.google.cloud.automl.v1beta1.GetDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_DATASETS: + serviceImpl.listDatasets((com.google.cloud.automl.v1beta1.ListDatasetsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_DATASET: + serviceImpl.deleteDataset((com.google.cloud.automl.v1beta1.DeleteDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_DATA: + serviceImpl.importData((com.google.cloud.automl.v1beta1.ImportDataRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EXPORT_DATA: + serviceImpl.exportData((com.google.cloud.automl.v1beta1.ExportDataRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_MODEL: + serviceImpl.createModel((com.google.cloud.automl.v1beta1.CreateModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_MODEL: + serviceImpl.getModel((com.google.cloud.automl.v1beta1.GetModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_MODELS: + serviceImpl.listModels((com.google.cloud.automl.v1beta1.ListModelsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_MODEL: + serviceImpl.deleteModel((com.google.cloud.automl.v1beta1.DeleteModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEPLOY_MODEL: + serviceImpl.deployModel((com.google.cloud.automl.v1beta1.DeployModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDEPLOY_MODEL: + serviceImpl.undeployModel((com.google.cloud.automl.v1beta1.UndeployModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_MODEL_EVALUATION: + serviceImpl.getModelEvaluation((com.google.cloud.automl.v1beta1.GetModelEvaluationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_MODEL_EVALUATIONS: + serviceImpl.listModelEvaluations((com.google.cloud.automl.v1beta1.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 static abstract 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.v1beta1.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(getDeleteDatasetMethodHelper()) + .addMethod(getImportDataMethodHelper()) + .addMethod(getExportDataMethodHelper()) + .addMethod(getCreateModelMethodHelper()) + .addMethod(getGetModelMethodHelper()) + .addMethod(getListModelsMethodHelper()) + .addMethod(getDeleteModelMethodHelper()) + .addMethod(getDeployModelMethodHelper()) + .addMethod(getUndeployModelMethodHelper()) + .addMethod(getGetModelEvaluationMethodHelper()) + .addMethod(getListModelEvaluationsMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceGrpc.java b/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceGrpc.java new file mode 100644 index 000000000000..34a1d933a630 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceGrpc.java @@ -0,0 +1,313 @@ +package com.google.cloud.automl.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * AutoML Prediction API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/automl/v1beta1/prediction_service.proto") +public final class PredictionServiceGrpc { + + private PredictionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.automl.v1beta1.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 METHOD_PREDICT = getPredictMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getPredictMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getPredictMethod() { + return getPredictMethodHelper(); + } + + private static io.grpc.MethodDescriptor getPredictMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.PredictionService", "Predict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.PredictRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1beta1.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.
+   * 
+ */ + public static abstract class PredictionServiceImplBase implements io.grpc.BindableService { + + /** + *
+     * Perform a prediction.
+     * 
+ */ + public void predict(com.google.cloud.automl.v1beta1.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.v1beta1.PredictRequest, + com.google.cloud.automl.v1beta1.PredictResponse>( + this, METHODID_PREDICT))) + .build(); + } + } + + /** + *
+   * AutoML Prediction API.
+   * 
+ */ + 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 a prediction.
+     * 
+ */ + public void predict(com.google.cloud.automl.v1beta1.PredictRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getPredictMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * AutoML Prediction API.
+   * 
+ */ + 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 a prediction.
+     * 
+ */ + public com.google.cloud.automl.v1beta1.PredictResponse predict(com.google.cloud.automl.v1beta1.PredictRequest request) { + return blockingUnaryCall( + getChannel(), getPredictMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * AutoML Prediction API.
+   * 
+ */ + 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 a prediction.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture predict( + com.google.cloud.automl.v1beta1.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.v1beta1.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 static abstract 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.v1beta1.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/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/pom.xml b/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/pom.xml new file mode 100644 index 000000000000..2cce7a10d4f5 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-vision-v1p3beta1 + 0.19.1-SNAPSHOT + grpc-google-cloud-vision-v1p3beta1 + GRPC library for grpc-google-cloud-vision-v1p3beta1 + + com.google.api.grpc + google-api-grpc + 0.19.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-vision-v1p3beta1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorGrpc.java b/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorGrpc.java new file mode 100644 index 000000000000..4e6e0371bf82 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorGrpc.java @@ -0,0 +1,435 @@ +package com.google.cloud.vision.v1p3beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * Service that performs Google Cloud Vision API detection tasks over client
+ * images, such as face, landmark, logo, label, and text detection. The
+ * ImageAnnotator service returns detected entities from the images.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/vision/v1p3beta1/image_annotator.proto") +public final class ImageAnnotatorGrpc { + + private ImageAnnotatorGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.vision.v1p3beta1.ImageAnnotator"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getBatchAnnotateImagesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_BATCH_ANNOTATE_IMAGES = getBatchAnnotateImagesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getBatchAnnotateImagesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getBatchAnnotateImagesMethod() { + return getBatchAnnotateImagesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getBatchAnnotateImagesMethodHelper() { + io.grpc.MethodDescriptor getBatchAnnotateImagesMethod; + if ((getBatchAnnotateImagesMethod = ImageAnnotatorGrpc.getBatchAnnotateImagesMethod) == null) { + synchronized (ImageAnnotatorGrpc.class) { + if ((getBatchAnnotateImagesMethod = ImageAnnotatorGrpc.getBatchAnnotateImagesMethod) == null) { + ImageAnnotatorGrpc.getBatchAnnotateImagesMethod = getBatchAnnotateImagesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ImageAnnotator", "BatchAnnotateImages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.getDefaultInstance())) + .setSchemaDescriptor(new ImageAnnotatorMethodDescriptorSupplier("BatchAnnotateImages")) + .build(); + } + } + } + return getBatchAnnotateImagesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAsyncBatchAnnotateFilesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_ASYNC_BATCH_ANNOTATE_FILES = getAsyncBatchAnnotateFilesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getAsyncBatchAnnotateFilesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getAsyncBatchAnnotateFilesMethod() { + return getAsyncBatchAnnotateFilesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getAsyncBatchAnnotateFilesMethodHelper() { + io.grpc.MethodDescriptor getAsyncBatchAnnotateFilesMethod; + if ((getAsyncBatchAnnotateFilesMethod = ImageAnnotatorGrpc.getAsyncBatchAnnotateFilesMethod) == null) { + synchronized (ImageAnnotatorGrpc.class) { + if ((getAsyncBatchAnnotateFilesMethod = ImageAnnotatorGrpc.getAsyncBatchAnnotateFilesMethod) == null) { + ImageAnnotatorGrpc.getAsyncBatchAnnotateFilesMethod = getAsyncBatchAnnotateFilesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ImageAnnotator", "AsyncBatchAnnotateFiles")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ImageAnnotatorMethodDescriptorSupplier("AsyncBatchAnnotateFiles")) + .build(); + } + } + } + return getAsyncBatchAnnotateFilesMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ImageAnnotatorStub newStub(io.grpc.Channel channel) { + return new ImageAnnotatorStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ImageAnnotatorBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new ImageAnnotatorBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ImageAnnotatorFutureStub newFutureStub( + io.grpc.Channel channel) { + return new ImageAnnotatorFutureStub(channel); + } + + /** + *
+   * Service that performs Google Cloud Vision API detection tasks over client
+   * images, such as face, landmark, logo, label, and text detection. The
+   * ImageAnnotator service returns detected entities from the images.
+   * 
+ */ + public static abstract class ImageAnnotatorImplBase implements io.grpc.BindableService { + + /** + *
+     * Run image detection and annotation for a batch of images.
+     * 
+ */ + public void batchAnnotateImages(com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getBatchAnnotateImagesMethodHelper(), responseObserver); + } + + /** + *
+     * Run asynchronous image detection and annotation for a list of generic
+     * files, such as PDF files, which may contain multiple pages and multiple
+     * images per page. Progress and results can be retrieved through the
+     * `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `OperationMetadata` (metadata).
+     * `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
+     * 
+ */ + public void asyncBatchAnnotateFiles(com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getAsyncBatchAnnotateFilesMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getBatchAnnotateImagesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest, + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse>( + this, METHODID_BATCH_ANNOTATE_IMAGES))) + .addMethod( + getAsyncBatchAnnotateFilesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest, + com.google.longrunning.Operation>( + this, METHODID_ASYNC_BATCH_ANNOTATE_FILES))) + .build(); + } + } + + /** + *
+   * Service that performs Google Cloud Vision API detection tasks over client
+   * images, such as face, landmark, logo, label, and text detection. The
+   * ImageAnnotator service returns detected entities from the images.
+   * 
+ */ + public static final class ImageAnnotatorStub extends io.grpc.stub.AbstractStub { + private ImageAnnotatorStub(io.grpc.Channel channel) { + super(channel); + } + + private ImageAnnotatorStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ImageAnnotatorStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ImageAnnotatorStub(channel, callOptions); + } + + /** + *
+     * Run image detection and annotation for a batch of images.
+     * 
+ */ + public void batchAnnotateImages(com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBatchAnnotateImagesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Run asynchronous image detection and annotation for a list of generic
+     * files, such as PDF files, which may contain multiple pages and multiple
+     * images per page. Progress and results can be retrieved through the
+     * `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `OperationMetadata` (metadata).
+     * `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
+     * 
+ */ + public void asyncBatchAnnotateFiles(com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getAsyncBatchAnnotateFilesMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Service that performs Google Cloud Vision API detection tasks over client
+   * images, such as face, landmark, logo, label, and text detection. The
+   * ImageAnnotator service returns detected entities from the images.
+   * 
+ */ + public static final class ImageAnnotatorBlockingStub extends io.grpc.stub.AbstractStub { + private ImageAnnotatorBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private ImageAnnotatorBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ImageAnnotatorBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ImageAnnotatorBlockingStub(channel, callOptions); + } + + /** + *
+     * Run image detection and annotation for a batch of images.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse batchAnnotateImages(com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest request) { + return blockingUnaryCall( + getChannel(), getBatchAnnotateImagesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Run asynchronous image detection and annotation for a list of generic
+     * files, such as PDF files, which may contain multiple pages and multiple
+     * images per page. Progress and results can be retrieved through the
+     * `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `OperationMetadata` (metadata).
+     * `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
+     * 
+ */ + public com.google.longrunning.Operation asyncBatchAnnotateFiles(com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest request) { + return blockingUnaryCall( + getChannel(), getAsyncBatchAnnotateFilesMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * Service that performs Google Cloud Vision API detection tasks over client
+   * images, such as face, landmark, logo, label, and text detection. The
+   * ImageAnnotator service returns detected entities from the images.
+   * 
+ */ + public static final class ImageAnnotatorFutureStub extends io.grpc.stub.AbstractStub { + private ImageAnnotatorFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private ImageAnnotatorFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ImageAnnotatorFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ImageAnnotatorFutureStub(channel, callOptions); + } + + /** + *
+     * Run image detection and annotation for a batch of images.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture batchAnnotateImages( + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest request) { + return futureUnaryCall( + getChannel().newCall(getBatchAnnotateImagesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Run asynchronous image detection and annotation for a list of generic
+     * files, such as PDF files, which may contain multiple pages and multiple
+     * images per page. Progress and results can be retrieved through the
+     * `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `OperationMetadata` (metadata).
+     * `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture asyncBatchAnnotateFiles( + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest request) { + return futureUnaryCall( + getChannel().newCall(getAsyncBatchAnnotateFilesMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_BATCH_ANNOTATE_IMAGES = 0; + private static final int METHODID_ASYNC_BATCH_ANNOTATE_FILES = 1; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ImageAnnotatorImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ImageAnnotatorImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_BATCH_ANNOTATE_IMAGES: + serviceImpl.batchAnnotateImages((com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ASYNC_BATCH_ANNOTATE_FILES: + serviceImpl.asyncBatchAnnotateFiles((com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) 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 static abstract class ImageAnnotatorBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ImageAnnotatorBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ImageAnnotator"); + } + } + + private static final class ImageAnnotatorFileDescriptorSupplier + extends ImageAnnotatorBaseDescriptorSupplier { + ImageAnnotatorFileDescriptorSupplier() {} + } + + private static final class ImageAnnotatorMethodDescriptorSupplier + extends ImageAnnotatorBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ImageAnnotatorMethodDescriptorSupplier(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 (ImageAnnotatorGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ImageAnnotatorFileDescriptorSupplier()) + .addMethod(getBatchAnnotateImagesMethodHelper()) + .addMethod(getAsyncBatchAnnotateFilesMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchGrpc.java b/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchGrpc.java new file mode 100644 index 000000000000..cab928c0e55b --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchGrpc.java @@ -0,0 +1,2262 @@ +package com.google.cloud.vision.v1p3beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * Manages Products and ProductSets of reference images for use in product
+ * search. It uses the following resource model:
+ * - The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, named
+ * `projects/*/locations/*/productSets/*`, which acts as a way to put different
+ * products into groups to limit identification.
+ * In parallel,
+ * - The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, named
+ *   `projects/*/locations/*/products/*`
+ * - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named
+ *   `projects/*/locations/*/products/*/referenceImages/*`
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/vision/v1p3beta1/product_search_service.proto") +public final class ProductSearchGrpc { + + private ProductSearchGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.vision.v1p3beta1.ProductSearch"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_PRODUCT_SET = getCreateProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateProductSetMethod() { + return getCreateProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateProductSetMethodHelper() { + io.grpc.MethodDescriptor getCreateProductSetMethod; + if ((getCreateProductSetMethod = ProductSearchGrpc.getCreateProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getCreateProductSetMethod = ProductSearchGrpc.getCreateProductSetMethod) == null) { + ProductSearchGrpc.getCreateProductSetMethod = getCreateProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "CreateProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("CreateProductSet")) + .build(); + } + } + } + return getCreateProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListProductSetsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_PRODUCT_SETS = getListProductSetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListProductSetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListProductSetsMethod() { + return getListProductSetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListProductSetsMethodHelper() { + io.grpc.MethodDescriptor getListProductSetsMethod; + if ((getListProductSetsMethod = ProductSearchGrpc.getListProductSetsMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getListProductSetsMethod = ProductSearchGrpc.getListProductSetsMethod) == null) { + ProductSearchGrpc.getListProductSetsMethod = getListProductSetsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "ListProductSets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ListProductSetsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ListProductSets")) + .build(); + } + } + } + return getListProductSetsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_PRODUCT_SET = getGetProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetProductSetMethod() { + return getGetProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetProductSetMethodHelper() { + io.grpc.MethodDescriptor getGetProductSetMethod; + if ((getGetProductSetMethod = ProductSearchGrpc.getGetProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getGetProductSetMethod = ProductSearchGrpc.getGetProductSetMethod) == null) { + ProductSearchGrpc.getGetProductSetMethod = getGetProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "GetProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.GetProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("GetProductSet")) + .build(); + } + } + } + return getGetProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_PRODUCT_SET = getUpdateProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateProductSetMethod() { + return getUpdateProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateProductSetMethodHelper() { + io.grpc.MethodDescriptor getUpdateProductSetMethod; + if ((getUpdateProductSetMethod = ProductSearchGrpc.getUpdateProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getUpdateProductSetMethod = ProductSearchGrpc.getUpdateProductSetMethod) == null) { + ProductSearchGrpc.getUpdateProductSetMethod = getUpdateProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "UpdateProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("UpdateProductSet")) + .build(); + } + } + } + return getUpdateProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_PRODUCT_SET = getDeleteProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteProductSetMethod() { + return getDeleteProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteProductSetMethodHelper() { + io.grpc.MethodDescriptor getDeleteProductSetMethod; + if ((getDeleteProductSetMethod = ProductSearchGrpc.getDeleteProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getDeleteProductSetMethod = ProductSearchGrpc.getDeleteProductSetMethod) == null) { + ProductSearchGrpc.getDeleteProductSetMethod = getDeleteProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "DeleteProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("DeleteProductSet")) + .build(); + } + } + } + return getDeleteProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateProductMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_PRODUCT = getCreateProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateProductMethod() { + return getCreateProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateProductMethodHelper() { + io.grpc.MethodDescriptor getCreateProductMethod; + if ((getCreateProductMethod = ProductSearchGrpc.getCreateProductMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getCreateProductMethod = ProductSearchGrpc.getCreateProductMethod) == null) { + ProductSearchGrpc.getCreateProductMethod = getCreateProductMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "CreateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.CreateProductRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("CreateProduct")) + .build(); + } + } + } + return getCreateProductMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListProductsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_PRODUCTS = getListProductsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListProductsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListProductsMethod() { + return getListProductsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListProductsMethodHelper() { + io.grpc.MethodDescriptor getListProductsMethod; + if ((getListProductsMethod = ProductSearchGrpc.getListProductsMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getListProductsMethod = ProductSearchGrpc.getListProductsMethod) == null) { + ProductSearchGrpc.getListProductsMethod = getListProductsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "ListProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ListProductsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ListProductsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ListProducts")) + .build(); + } + } + } + return getListProductsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetProductMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_PRODUCT = getGetProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetProductMethod() { + return getGetProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetProductMethodHelper() { + io.grpc.MethodDescriptor getGetProductMethod; + if ((getGetProductMethod = ProductSearchGrpc.getGetProductMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getGetProductMethod = ProductSearchGrpc.getGetProductMethod) == null) { + ProductSearchGrpc.getGetProductMethod = getGetProductMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "GetProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.GetProductRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("GetProduct")) + .build(); + } + } + } + return getGetProductMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateProductMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_PRODUCT = getUpdateProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateProductMethod() { + return getUpdateProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateProductMethodHelper() { + io.grpc.MethodDescriptor getUpdateProductMethod; + if ((getUpdateProductMethod = ProductSearchGrpc.getUpdateProductMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getUpdateProductMethod = ProductSearchGrpc.getUpdateProductMethod) == null) { + ProductSearchGrpc.getUpdateProductMethod = getUpdateProductMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "UpdateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.UpdateProductRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("UpdateProduct")) + .build(); + } + } + } + return getUpdateProductMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteProductMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_PRODUCT = getDeleteProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteProductMethod() { + return getDeleteProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteProductMethodHelper() { + io.grpc.MethodDescriptor getDeleteProductMethod; + if ((getDeleteProductMethod = ProductSearchGrpc.getDeleteProductMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getDeleteProductMethod = ProductSearchGrpc.getDeleteProductMethod) == null) { + ProductSearchGrpc.getDeleteProductMethod = getDeleteProductMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "DeleteProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.DeleteProductRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("DeleteProduct")) + .build(); + } + } + } + return getDeleteProductMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateReferenceImageMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_REFERENCE_IMAGE = getCreateReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateReferenceImageMethod() { + return getCreateReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateReferenceImageMethodHelper() { + io.grpc.MethodDescriptor getCreateReferenceImageMethod; + if ((getCreateReferenceImageMethod = ProductSearchGrpc.getCreateReferenceImageMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getCreateReferenceImageMethod = ProductSearchGrpc.getCreateReferenceImageMethod) == null) { + ProductSearchGrpc.getCreateReferenceImageMethod = getCreateReferenceImageMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "CreateReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("CreateReferenceImage")) + .build(); + } + } + } + return getCreateReferenceImageMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteReferenceImageMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_REFERENCE_IMAGE = getDeleteReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteReferenceImageMethod() { + return getDeleteReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteReferenceImageMethodHelper() { + io.grpc.MethodDescriptor getDeleteReferenceImageMethod; + if ((getDeleteReferenceImageMethod = ProductSearchGrpc.getDeleteReferenceImageMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getDeleteReferenceImageMethod = ProductSearchGrpc.getDeleteReferenceImageMethod) == null) { + ProductSearchGrpc.getDeleteReferenceImageMethod = getDeleteReferenceImageMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "DeleteReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("DeleteReferenceImage")) + .build(); + } + } + } + return getDeleteReferenceImageMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListReferenceImagesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_REFERENCE_IMAGES = getListReferenceImagesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListReferenceImagesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListReferenceImagesMethod() { + return getListReferenceImagesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListReferenceImagesMethodHelper() { + io.grpc.MethodDescriptor getListReferenceImagesMethod; + if ((getListReferenceImagesMethod = ProductSearchGrpc.getListReferenceImagesMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getListReferenceImagesMethod = ProductSearchGrpc.getListReferenceImagesMethod) == null) { + ProductSearchGrpc.getListReferenceImagesMethod = getListReferenceImagesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "ListReferenceImages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ListReferenceImages")) + .build(); + } + } + } + return getListReferenceImagesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetReferenceImageMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_REFERENCE_IMAGE = getGetReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetReferenceImageMethod() { + return getGetReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetReferenceImageMethodHelper() { + io.grpc.MethodDescriptor getGetReferenceImageMethod; + if ((getGetReferenceImageMethod = ProductSearchGrpc.getGetReferenceImageMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getGetReferenceImageMethod = ProductSearchGrpc.getGetReferenceImageMethod) == null) { + ProductSearchGrpc.getGetReferenceImageMethod = getGetReferenceImageMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "GetReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("GetReferenceImage")) + .build(); + } + } + } + return getGetReferenceImageMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAddProductToProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_ADD_PRODUCT_TO_PRODUCT_SET = getAddProductToProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getAddProductToProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getAddProductToProductSetMethod() { + return getAddProductToProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getAddProductToProductSetMethodHelper() { + io.grpc.MethodDescriptor getAddProductToProductSetMethod; + if ((getAddProductToProductSetMethod = ProductSearchGrpc.getAddProductToProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getAddProductToProductSetMethod = ProductSearchGrpc.getAddProductToProductSetMethod) == null) { + ProductSearchGrpc.getAddProductToProductSetMethod = getAddProductToProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "AddProductToProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("AddProductToProductSet")) + .build(); + } + } + } + return getAddProductToProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRemoveProductFromProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_REMOVE_PRODUCT_FROM_PRODUCT_SET = getRemoveProductFromProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getRemoveProductFromProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getRemoveProductFromProductSetMethod() { + return getRemoveProductFromProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getRemoveProductFromProductSetMethodHelper() { + io.grpc.MethodDescriptor getRemoveProductFromProductSetMethod; + if ((getRemoveProductFromProductSetMethod = ProductSearchGrpc.getRemoveProductFromProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getRemoveProductFromProductSetMethod = ProductSearchGrpc.getRemoveProductFromProductSetMethod) == null) { + ProductSearchGrpc.getRemoveProductFromProductSetMethod = getRemoveProductFromProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "RemoveProductFromProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("RemoveProductFromProductSet")) + .build(); + } + } + } + return getRemoveProductFromProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListProductsInProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_PRODUCTS_IN_PRODUCT_SET = getListProductsInProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListProductsInProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListProductsInProductSetMethod() { + return getListProductsInProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListProductsInProductSetMethodHelper() { + io.grpc.MethodDescriptor getListProductsInProductSetMethod; + if ((getListProductsInProductSetMethod = ProductSearchGrpc.getListProductsInProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getListProductsInProductSetMethod = ProductSearchGrpc.getListProductsInProductSetMethod) == null) { + ProductSearchGrpc.getListProductsInProductSetMethod = getListProductsInProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "ListProductsInProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ListProductsInProductSet")) + .build(); + } + } + } + return getListProductsInProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getImportProductSetsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_IMPORT_PRODUCT_SETS = getImportProductSetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getImportProductSetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getImportProductSetsMethod() { + return getImportProductSetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getImportProductSetsMethodHelper() { + io.grpc.MethodDescriptor getImportProductSetsMethod; + if ((getImportProductSetsMethod = ProductSearchGrpc.getImportProductSetsMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getImportProductSetsMethod = ProductSearchGrpc.getImportProductSetsMethod) == null) { + ProductSearchGrpc.getImportProductSetsMethod = getImportProductSetsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch", "ImportProductSets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ImportProductSets")) + .build(); + } + } + } + return getImportProductSetsMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ProductSearchStub newStub(io.grpc.Channel channel) { + return new ProductSearchStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ProductSearchBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new ProductSearchBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ProductSearchFutureStub newFutureStub( + io.grpc.Channel channel) { + return new ProductSearchFutureStub(channel); + } + + /** + *
+   * Manages Products and ProductSets of reference images for use in product
+   * search. It uses the following resource model:
+   * - The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, named
+   * `projects/*/locations/*/productSets/*`, which acts as a way to put different
+   * products into groups to limit identification.
+   * In parallel,
+   * - The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named
+   *   `projects/*/locations/*/products/*/referenceImages/*`
+   * 
+ */ + public static abstract class ProductSearchImplBase implements io.grpc.BindableService { + + /** + *
+     * Creates and returns a new ProductSet resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
+     *   4096 characters.
+     * 
+ */ + public void createProductSet(com.google.cloud.vision.v1p3beta1.CreateProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Lists ProductSets in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public void listProductSets(com.google.cloud.vision.v1p3beta1.ListProductSetsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListProductSetsMethodHelper(), responseObserver); + } + + /** + *
+     * Gets information associated with a ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public void getProductSet(com.google.cloud.vision.v1p3beta1.GetProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Makes changes to a ProductSet resource.
+     * Only display_name can be updated currently.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but
+     *   missing from the request or longer than 4096 characters.
+     * 
+ */ + public void updateProductSet(com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Permanently deletes a ProductSet. All Products and ReferenceImages in the
+     * ProductSet will be deleted.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public void deleteProductSet(com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Creates and returns a new product resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is missing or invalid.
+     * 
+ */ + public void createProduct(com.google.cloud.vision.v1p3beta1.CreateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateProductMethodHelper(), responseObserver); + } + + /** + *
+     * Lists products in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public void listProducts(com.google.cloud.vision.v1p3beta1.ListProductsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListProductsMethodHelper(), responseObserver); + } + + /** + *
+     * Gets information associated with a Product.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * 
+ */ + public void getProduct(com.google.cloud.vision.v1p3beta1.GetProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetProductMethodHelper(), responseObserver); + } + + /** + *
+     * Makes changes to a Product resource.
+     * Only display_name, description and labels can be updated right now.
+     * If labels are updated, the change will not be reflected in queries until
+     * the next index time.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
+     *   missing from the request or longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if description is present in update_mask but is
+     *   longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is present in update_mask.
+     * 
+ */ + public void updateProduct(com.google.cloud.vision.v1p3beta1.UpdateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateProductMethodHelper(), responseObserver); + } + + /** + *
+     * Permanently deletes a product and its reference images.
+     * Metadata of the product and all its images will be deleted right away, but
+     * search queries against ProductSets containing the product may still work
+     * until all related caches are refreshed.
+     * Possible errors:
+     * * Returns NOT_FOUND if the product does not exist.
+     * 
+ */ + public void deleteProduct(com.google.cloud.vision.v1p3beta1.DeleteProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteProductMethodHelper(), responseObserver); + } + + /** + *
+     * Creates and returns a new ReferenceImage resource.
+     * The `bounding_poly` field is optional. If `bounding_poly` is not specified,
+     * the system will try to detect regions of interest in the image that are
+     * compatible with the product_category on the parent product. If it is
+     * specified, detection is ALWAYS skipped. The system converts polygons into
+     * non-rotated rectangles.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 50MP).
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if the product does not exist.
+     * * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
+     *   compatible with the parent product's product_category is detected.
+     * * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
+     * 
+ */ + public void createReferenceImage(com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateReferenceImageMethodHelper(), responseObserver); + } + + /** + *
+     * Permanently deletes a reference image.
+     * The image metadata will be deleted right away, but search queries
+     * against ProductSets containing the image may still work until all related
+     * caches are refreshed.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the reference image does not exist.
+     * 
+ */ + public void deleteReferenceImage(com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteReferenceImageMethodHelper(), responseObserver); + } + + /** + *
+     * Lists reference images.
+     * Possible errors:
+     * * Returns NOT_FOUND if the parent product does not exist.
+     * * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public void listReferenceImages(com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListReferenceImagesMethodHelper(), responseObserver); + } + + /** + *
+     * Gets information associated with a ReferenceImage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the specified image does not exist.
+     * 
+ */ + public void getReferenceImage(com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetReferenceImageMethodHelper(), responseObserver); + } + + /** + *
+     * Adds a Product to the specified ProductSet. If the Product is already
+     * present, no change is made.
+     * One Product can be added to at most 100 ProductSets.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
+     * 
+ */ + public void addProductToProductSet(com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getAddProductToProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Removes a Product from the specified ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND If the Product is not found under the ProductSet.
+     * 
+ */ + public void removeProductFromProductSet(com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRemoveProductFromProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Lists the Products in a ProductSet, in an unspecified order. If the
+     * ProductSet does not exist, the products field of the response will be
+     * empty.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public void listProductsInProductSet(com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListProductsInProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Asynchronous API that imports a list of reference images to specified
+     * product sets based on a list of image information.
+     * The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
+     * progress and results of the request.
+     * `Operation.metadata` contains `BatchOperationMetadata`. (progress)
+     * `Operation.response` contains `ImportProductSetsResponse`. (results)
+     * The input source of this method is a csv file on Google Cloud Storage.
+     * For the format of the csv file please see
+     * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public void importProductSets(com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getImportProductSetsMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest, + com.google.cloud.vision.v1p3beta1.ProductSet>( + this, METHODID_CREATE_PRODUCT_SET))) + .addMethod( + getListProductSetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest, + com.google.cloud.vision.v1p3beta1.ListProductSetsResponse>( + this, METHODID_LIST_PRODUCT_SETS))) + .addMethod( + getGetProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.GetProductSetRequest, + com.google.cloud.vision.v1p3beta1.ProductSet>( + this, METHODID_GET_PRODUCT_SET))) + .addMethod( + getUpdateProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest, + com.google.cloud.vision.v1p3beta1.ProductSet>( + this, METHODID_UPDATE_PRODUCT_SET))) + .addMethod( + getDeleteProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_PRODUCT_SET))) + .addMethod( + getCreateProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.CreateProductRequest, + com.google.cloud.vision.v1p3beta1.Product>( + this, METHODID_CREATE_PRODUCT))) + .addMethod( + getListProductsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.ListProductsRequest, + com.google.cloud.vision.v1p3beta1.ListProductsResponse>( + this, METHODID_LIST_PRODUCTS))) + .addMethod( + getGetProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.GetProductRequest, + com.google.cloud.vision.v1p3beta1.Product>( + this, METHODID_GET_PRODUCT))) + .addMethod( + getUpdateProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.UpdateProductRequest, + com.google.cloud.vision.v1p3beta1.Product>( + this, METHODID_UPDATE_PRODUCT))) + .addMethod( + getDeleteProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.DeleteProductRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_PRODUCT))) + .addMethod( + getCreateReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest, + com.google.cloud.vision.v1p3beta1.ReferenceImage>( + this, METHODID_CREATE_REFERENCE_IMAGE))) + .addMethod( + getDeleteReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_REFERENCE_IMAGE))) + .addMethod( + getListReferenceImagesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest, + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse>( + this, METHODID_LIST_REFERENCE_IMAGES))) + .addMethod( + getGetReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest, + com.google.cloud.vision.v1p3beta1.ReferenceImage>( + this, METHODID_GET_REFERENCE_IMAGE))) + .addMethod( + getAddProductToProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest, + com.google.protobuf.Empty>( + this, METHODID_ADD_PRODUCT_TO_PRODUCT_SET))) + .addMethod( + getRemoveProductFromProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest, + com.google.protobuf.Empty>( + this, METHODID_REMOVE_PRODUCT_FROM_PRODUCT_SET))) + .addMethod( + getListProductsInProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest, + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse>( + this, METHODID_LIST_PRODUCTS_IN_PRODUCT_SET))) + .addMethod( + getImportProductSetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest, + com.google.longrunning.Operation>( + this, METHODID_IMPORT_PRODUCT_SETS))) + .build(); + } + } + + /** + *
+   * Manages Products and ProductSets of reference images for use in product
+   * search. It uses the following resource model:
+   * - The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, named
+   * `projects/*/locations/*/productSets/*`, which acts as a way to put different
+   * products into groups to limit identification.
+   * In parallel,
+   * - The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named
+   *   `projects/*/locations/*/products/*/referenceImages/*`
+   * 
+ */ + public static final class ProductSearchStub extends io.grpc.stub.AbstractStub { + private ProductSearchStub(io.grpc.Channel channel) { + super(channel); + } + + private ProductSearchStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductSearchStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ProductSearchStub(channel, callOptions); + } + + /** + *
+     * Creates and returns a new ProductSet resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
+     *   4096 characters.
+     * 
+ */ + public void createProductSet(com.google.cloud.vision.v1p3beta1.CreateProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists ProductSets in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public void listProductSets(com.google.cloud.vision.v1p3beta1.ListProductSetsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListProductSetsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets information associated with a ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public void getProductSet(com.google.cloud.vision.v1p3beta1.GetProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Makes changes to a ProductSet resource.
+     * Only display_name can be updated currently.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but
+     *   missing from the request or longer than 4096 characters.
+     * 
+ */ + public void updateProductSet(com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Permanently deletes a ProductSet. All Products and ReferenceImages in the
+     * ProductSet will be deleted.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public void deleteProductSet(com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates and returns a new product resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is missing or invalid.
+     * 
+ */ + public void createProduct(com.google.cloud.vision.v1p3beta1.CreateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateProductMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists products in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public void listProducts(com.google.cloud.vision.v1p3beta1.ListProductsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListProductsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets information associated with a Product.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * 
+ */ + public void getProduct(com.google.cloud.vision.v1p3beta1.GetProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetProductMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Makes changes to a Product resource.
+     * Only display_name, description and labels can be updated right now.
+     * If labels are updated, the change will not be reflected in queries until
+     * the next index time.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
+     *   missing from the request or longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if description is present in update_mask but is
+     *   longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is present in update_mask.
+     * 
+ */ + public void updateProduct(com.google.cloud.vision.v1p3beta1.UpdateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateProductMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Permanently deletes a product and its reference images.
+     * Metadata of the product and all its images will be deleted right away, but
+     * search queries against ProductSets containing the product may still work
+     * until all related caches are refreshed.
+     * Possible errors:
+     * * Returns NOT_FOUND if the product does not exist.
+     * 
+ */ + public void deleteProduct(com.google.cloud.vision.v1p3beta1.DeleteProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteProductMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates and returns a new ReferenceImage resource.
+     * The `bounding_poly` field is optional. If `bounding_poly` is not specified,
+     * the system will try to detect regions of interest in the image that are
+     * compatible with the product_category on the parent product. If it is
+     * specified, detection is ALWAYS skipped. The system converts polygons into
+     * non-rotated rectangles.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 50MP).
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if the product does not exist.
+     * * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
+     *   compatible with the parent product's product_category is detected.
+     * * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
+     * 
+ */ + public void createReferenceImage(com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateReferenceImageMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Permanently deletes a reference image.
+     * The image metadata will be deleted right away, but search queries
+     * against ProductSets containing the image may still work until all related
+     * caches are refreshed.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the reference image does not exist.
+     * 
+ */ + public void deleteReferenceImage(com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteReferenceImageMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists reference images.
+     * Possible errors:
+     * * Returns NOT_FOUND if the parent product does not exist.
+     * * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public void listReferenceImages(com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListReferenceImagesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets information associated with a ReferenceImage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the specified image does not exist.
+     * 
+ */ + public void getReferenceImage(com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetReferenceImageMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Adds a Product to the specified ProductSet. If the Product is already
+     * present, no change is made.
+     * One Product can be added to at most 100 ProductSets.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
+     * 
+ */ + public void addProductToProductSet(com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getAddProductToProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Removes a Product from the specified ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND If the Product is not found under the ProductSet.
+     * 
+ */ + public void removeProductFromProductSet(com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getRemoveProductFromProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists the Products in a ProductSet, in an unspecified order. If the
+     * ProductSet does not exist, the products field of the response will be
+     * empty.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public void listProductsInProductSet(com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListProductsInProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Asynchronous API that imports a list of reference images to specified
+     * product sets based on a list of image information.
+     * The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
+     * progress and results of the request.
+     * `Operation.metadata` contains `BatchOperationMetadata`. (progress)
+     * `Operation.response` contains `ImportProductSetsResponse`. (results)
+     * The input source of this method is a csv file on Google Cloud Storage.
+     * For the format of the csv file please see
+     * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public void importProductSets(com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getImportProductSetsMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Manages Products and ProductSets of reference images for use in product
+   * search. It uses the following resource model:
+   * - The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, named
+   * `projects/*/locations/*/productSets/*`, which acts as a way to put different
+   * products into groups to limit identification.
+   * In parallel,
+   * - The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named
+   *   `projects/*/locations/*/products/*/referenceImages/*`
+   * 
+ */ + public static final class ProductSearchBlockingStub extends io.grpc.stub.AbstractStub { + private ProductSearchBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private ProductSearchBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductSearchBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ProductSearchBlockingStub(channel, callOptions); + } + + /** + *
+     * Creates and returns a new ProductSet resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
+     *   4096 characters.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ProductSet createProductSet(com.google.cloud.vision.v1p3beta1.CreateProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getCreateProductSetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists ProductSets in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ListProductSetsResponse listProductSets(com.google.cloud.vision.v1p3beta1.ListProductSetsRequest request) { + return blockingUnaryCall( + getChannel(), getListProductSetsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets information associated with a ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ProductSet getProductSet(com.google.cloud.vision.v1p3beta1.GetProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getGetProductSetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Makes changes to a ProductSet resource.
+     * Only display_name can be updated currently.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but
+     *   missing from the request or longer than 4096 characters.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ProductSet updateProductSet(com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateProductSetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Permanently deletes a ProductSet. All Products and ReferenceImages in the
+     * ProductSet will be deleted.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public com.google.protobuf.Empty deleteProductSet(com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteProductSetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates and returns a new product resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is missing or invalid.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.Product createProduct(com.google.cloud.vision.v1p3beta1.CreateProductRequest request) { + return blockingUnaryCall( + getChannel(), getCreateProductMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists products in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ListProductsResponse listProducts(com.google.cloud.vision.v1p3beta1.ListProductsRequest request) { + return blockingUnaryCall( + getChannel(), getListProductsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets information associated with a Product.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.Product getProduct(com.google.cloud.vision.v1p3beta1.GetProductRequest request) { + return blockingUnaryCall( + getChannel(), getGetProductMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Makes changes to a Product resource.
+     * Only display_name, description and labels can be updated right now.
+     * If labels are updated, the change will not be reflected in queries until
+     * the next index time.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
+     *   missing from the request or longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if description is present in update_mask but is
+     *   longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is present in update_mask.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.Product updateProduct(com.google.cloud.vision.v1p3beta1.UpdateProductRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateProductMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Permanently deletes a product and its reference images.
+     * Metadata of the product and all its images will be deleted right away, but
+     * search queries against ProductSets containing the product may still work
+     * until all related caches are refreshed.
+     * Possible errors:
+     * * Returns NOT_FOUND if the product does not exist.
+     * 
+ */ + public com.google.protobuf.Empty deleteProduct(com.google.cloud.vision.v1p3beta1.DeleteProductRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteProductMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates and returns a new ReferenceImage resource.
+     * The `bounding_poly` field is optional. If `bounding_poly` is not specified,
+     * the system will try to detect regions of interest in the image that are
+     * compatible with the product_category on the parent product. If it is
+     * specified, detection is ALWAYS skipped. The system converts polygons into
+     * non-rotated rectangles.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 50MP).
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if the product does not exist.
+     * * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
+     *   compatible with the parent product's product_category is detected.
+     * * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage createReferenceImage(com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest request) { + return blockingUnaryCall( + getChannel(), getCreateReferenceImageMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Permanently deletes a reference image.
+     * The image metadata will be deleted right away, but search queries
+     * against ProductSets containing the image may still work until all related
+     * caches are refreshed.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the reference image does not exist.
+     * 
+ */ + public com.google.protobuf.Empty deleteReferenceImage(com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteReferenceImageMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists reference images.
+     * Possible errors:
+     * * Returns NOT_FOUND if the parent product does not exist.
+     * * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse listReferenceImages(com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest request) { + return blockingUnaryCall( + getChannel(), getListReferenceImagesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets information associated with a ReferenceImage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the specified image does not exist.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImage(com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest request) { + return blockingUnaryCall( + getChannel(), getGetReferenceImageMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Adds a Product to the specified ProductSet. If the Product is already
+     * present, no change is made.
+     * One Product can be added to at most 100 ProductSets.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
+     * 
+ */ + public com.google.protobuf.Empty addProductToProductSet(com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getAddProductToProductSetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Removes a Product from the specified ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND If the Product is not found under the ProductSet.
+     * 
+ */ + public com.google.protobuf.Empty removeProductFromProductSet(com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getRemoveProductFromProductSetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists the Products in a ProductSet, in an unspecified order. If the
+     * ProductSet does not exist, the products field of the response will be
+     * empty.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse listProductsInProductSet(com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getListProductsInProductSetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Asynchronous API that imports a list of reference images to specified
+     * product sets based on a list of image information.
+     * The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
+     * progress and results of the request.
+     * `Operation.metadata` contains `BatchOperationMetadata`. (progress)
+     * `Operation.response` contains `ImportProductSetsResponse`. (results)
+     * The input source of this method is a csv file on Google Cloud Storage.
+     * For the format of the csv file please see
+     * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public com.google.longrunning.Operation importProductSets(com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest request) { + return blockingUnaryCall( + getChannel(), getImportProductSetsMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * Manages Products and ProductSets of reference images for use in product
+   * search. It uses the following resource model:
+   * - The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, named
+   * `projects/*/locations/*/productSets/*`, which acts as a way to put different
+   * products into groups to limit identification.
+   * In parallel,
+   * - The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named
+   *   `projects/*/locations/*/products/*/referenceImages/*`
+   * 
+ */ + public static final class ProductSearchFutureStub extends io.grpc.stub.AbstractStub { + private ProductSearchFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private ProductSearchFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductSearchFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ProductSearchFutureStub(channel, callOptions); + } + + /** + *
+     * Creates and returns a new ProductSet resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
+     *   4096 characters.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createProductSet( + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists ProductSets in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listProductSets( + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListProductSetsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets information associated with a ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getProductSet( + com.google.cloud.vision.v1p3beta1.GetProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Makes changes to a ProductSet resource.
+     * Only display_name can be updated currently.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but
+     *   missing from the request or longer than 4096 characters.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateProductSet( + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Permanently deletes a ProductSet. All Products and ReferenceImages in the
+     * ProductSet will be deleted.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteProductSet( + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates and returns a new product resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is missing or invalid.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createProduct( + com.google.cloud.vision.v1p3beta1.CreateProductRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateProductMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists products in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listProducts( + com.google.cloud.vision.v1p3beta1.ListProductsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListProductsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets information associated with a Product.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getProduct( + com.google.cloud.vision.v1p3beta1.GetProductRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetProductMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Makes changes to a Product resource.
+     * Only display_name, description and labels can be updated right now.
+     * If labels are updated, the change will not be reflected in queries until
+     * the next index time.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
+     *   missing from the request or longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if description is present in update_mask but is
+     *   longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is present in update_mask.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateProduct( + com.google.cloud.vision.v1p3beta1.UpdateProductRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateProductMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Permanently deletes a product and its reference images.
+     * Metadata of the product and all its images will be deleted right away, but
+     * search queries against ProductSets containing the product may still work
+     * until all related caches are refreshed.
+     * Possible errors:
+     * * Returns NOT_FOUND if the product does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteProduct( + com.google.cloud.vision.v1p3beta1.DeleteProductRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteProductMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates and returns a new ReferenceImage resource.
+     * The `bounding_poly` field is optional. If `bounding_poly` is not specified,
+     * the system will try to detect regions of interest in the image that are
+     * compatible with the product_category on the parent product. If it is
+     * specified, detection is ALWAYS skipped. The system converts polygons into
+     * non-rotated rectangles.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 50MP).
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if the product does not exist.
+     * * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
+     *   compatible with the parent product's product_category is detected.
+     * * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createReferenceImage( + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateReferenceImageMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Permanently deletes a reference image.
+     * The image metadata will be deleted right away, but search queries
+     * against ProductSets containing the image may still work until all related
+     * caches are refreshed.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the reference image does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteReferenceImage( + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteReferenceImageMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists reference images.
+     * Possible errors:
+     * * Returns NOT_FOUND if the parent product does not exist.
+     * * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listReferenceImages( + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListReferenceImagesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets information associated with a ReferenceImage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the specified image does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getReferenceImage( + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetReferenceImageMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Adds a Product to the specified ProductSet. If the Product is already
+     * present, no change is made.
+     * One Product can be added to at most 100 ProductSets.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture addProductToProductSet( + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getAddProductToProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Removes a Product from the specified ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND If the Product is not found under the ProductSet.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture removeProductFromProductSet( + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getRemoveProductFromProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists the Products in a ProductSet, in an unspecified order. If the
+     * ProductSet does not exist, the products field of the response will be
+     * empty.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listProductsInProductSet( + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getListProductsInProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Asynchronous API that imports a list of reference images to specified
+     * product sets based on a list of image information.
+     * The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
+     * progress and results of the request.
+     * `Operation.metadata` contains `BatchOperationMetadata`. (progress)
+     * `Operation.response` contains `ImportProductSetsResponse`. (results)
+     * The input source of this method is a csv file on Google Cloud Storage.
+     * For the format of the csv file please see
+     * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture importProductSets( + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getImportProductSetsMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_PRODUCT_SET = 0; + private static final int METHODID_LIST_PRODUCT_SETS = 1; + private static final int METHODID_GET_PRODUCT_SET = 2; + private static final int METHODID_UPDATE_PRODUCT_SET = 3; + private static final int METHODID_DELETE_PRODUCT_SET = 4; + private static final int METHODID_CREATE_PRODUCT = 5; + private static final int METHODID_LIST_PRODUCTS = 6; + private static final int METHODID_GET_PRODUCT = 7; + private static final int METHODID_UPDATE_PRODUCT = 8; + private static final int METHODID_DELETE_PRODUCT = 9; + private static final int METHODID_CREATE_REFERENCE_IMAGE = 10; + private static final int METHODID_DELETE_REFERENCE_IMAGE = 11; + private static final int METHODID_LIST_REFERENCE_IMAGES = 12; + private static final int METHODID_GET_REFERENCE_IMAGE = 13; + private static final int METHODID_ADD_PRODUCT_TO_PRODUCT_SET = 14; + private static final int METHODID_REMOVE_PRODUCT_FROM_PRODUCT_SET = 15; + private static final int METHODID_LIST_PRODUCTS_IN_PRODUCT_SET = 16; + private static final int METHODID_IMPORT_PRODUCT_SETS = 17; + + 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 ProductSearchImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ProductSearchImplBase 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_PRODUCT_SET: + serviceImpl.createProductSet((com.google.cloud.vision.v1p3beta1.CreateProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRODUCT_SETS: + serviceImpl.listProductSets((com.google.cloud.vision.v1p3beta1.ListProductSetsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PRODUCT_SET: + serviceImpl.getProductSet((com.google.cloud.vision.v1p3beta1.GetProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_PRODUCT_SET: + serviceImpl.updateProductSet((com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PRODUCT_SET: + serviceImpl.deleteProductSet((com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_PRODUCT: + serviceImpl.createProduct((com.google.cloud.vision.v1p3beta1.CreateProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRODUCTS: + serviceImpl.listProducts((com.google.cloud.vision.v1p3beta1.ListProductsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PRODUCT: + serviceImpl.getProduct((com.google.cloud.vision.v1p3beta1.GetProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_PRODUCT: + serviceImpl.updateProduct((com.google.cloud.vision.v1p3beta1.UpdateProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PRODUCT: + serviceImpl.deleteProduct((com.google.cloud.vision.v1p3beta1.DeleteProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_REFERENCE_IMAGE: + serviceImpl.createReferenceImage((com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_REFERENCE_IMAGE: + serviceImpl.deleteReferenceImage((com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_REFERENCE_IMAGES: + serviceImpl.listReferenceImages((com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_REFERENCE_IMAGE: + serviceImpl.getReferenceImage((com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_PRODUCT_TO_PRODUCT_SET: + serviceImpl.addProductToProductSet((com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_PRODUCT_FROM_PRODUCT_SET: + serviceImpl.removeProductFromProductSet((com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRODUCTS_IN_PRODUCT_SET: + serviceImpl.listProductsInProductSet((com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_PRODUCT_SETS: + serviceImpl.importProductSets((com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest) 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 static abstract class ProductSearchBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ProductSearchBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ProductSearch"); + } + } + + private static final class ProductSearchFileDescriptorSupplier + extends ProductSearchBaseDescriptorSupplier { + ProductSearchFileDescriptorSupplier() {} + } + + private static final class ProductSearchMethodDescriptorSupplier + extends ProductSearchBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ProductSearchMethodDescriptorSupplier(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 (ProductSearchGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ProductSearchFileDescriptorSupplier()) + .addMethod(getCreateProductSetMethodHelper()) + .addMethod(getListProductSetsMethodHelper()) + .addMethod(getGetProductSetMethodHelper()) + .addMethod(getUpdateProductSetMethodHelper()) + .addMethod(getDeleteProductSetMethodHelper()) + .addMethod(getCreateProductMethodHelper()) + .addMethod(getListProductsMethodHelper()) + .addMethod(getGetProductMethodHelper()) + .addMethod(getUpdateProductMethodHelper()) + .addMethod(getDeleteProductMethodHelper()) + .addMethod(getCreateReferenceImageMethodHelper()) + .addMethod(getDeleteReferenceImageMethodHelper()) + .addMethod(getListReferenceImagesMethodHelper()) + .addMethod(getGetReferenceImageMethodHelper()) + .addMethod(getAddProductToProductSetMethodHelper()) + .addMethod(getRemoveProductFromProductSetMethodHelper()) + .addMethod(getListProductsInProductSetMethodHelper()) + .addMethod(getImportProductSetsMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index d9516a6756d5..9e8d203a3740 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -131,16 +131,16 @@ - com.google.api.grpc grpc-google-cloud-automl-v1beta1 - 0.19.1-SNAPSHOT - --> + 0.19.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-bigtable-v2 @@ -456,16 +456,16 @@ grpc-google-cloud-vision-v1p2beta1 1.18.1-SNAPSHOT - com.google.api.grpc grpc-google-cloud-vision-v1p3beta1 - 0.19.1-SNAPSHOT - --> + 0.19.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-video-intelligence-v1beta1 @@ -540,7 +540,7 @@ - + grpc-google-cloud-automl-v1beta1 grpc-google-cloud-bigquerydatatransfer-v1 grpc-google-cloud-bigtable-admin-v2 grpc-google-cloud-bigtable-v2 @@ -576,12 +576,12 @@ grpc-google-cloud-vision-v1 grpc-google-cloud-vision-v1p1beta1 grpc-google-cloud-vision-v1p2beta1 - + grpc-google-cloud-vision-v1p3beta1 grpc-google-cloud-iot-v1 grpc-google-cloud-redis-v1beta1 grpc-google-cloud-websecurityscanner-v1alpha - + proto-google-cloud-automl-v1beta1 proto-google-cloud-bigquerydatatransfer-v1 proto-google-cloud-bigtable-admin-v2 proto-google-cloud-bigtable-v2 @@ -618,7 +618,7 @@ proto-google-cloud-vision-v1 proto-google-cloud-vision-v1p1beta1 proto-google-cloud-vision-v1p2beta1 - + proto-google-cloud-vision-v1p3beta1 proto-google-cloud-iot-v1 proto-google-cloud-redis-v1beta1 proto-google-cloud-websecurityscanner-v1alpha diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/pom.xml b/google-api-grpc/proto-google-cloud-automl-v1beta1/pom.xml new file mode 100644 index 000000000000..ab4ae0051241 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + proto-google-cloud-automl-v1beta1 + 0.19.1-SNAPSHOT + proto-google-cloud-automl-v1beta1 + PROTO library for proto-google-cloud-automl-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.19.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayload.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayload.java new file mode 100644 index 000000000000..8b472512bc77 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayload.java @@ -0,0 +1,1321 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/annotation_payload.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Contains annotation information that is relevant to AutoML.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.AnnotationPayload} + */ +public final class AnnotationPayload extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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() { + annotationSpecId_ = ""; + displayName_ = ""; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + annotationSpecId_ = s; + break; + } + case 18: { + com.google.cloud.automl.v1beta1.TranslationAnnotation.Builder subBuilder = null; + if (detailCase_ == 2) { + subBuilder = ((com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_).toBuilder(); + } + detail_ = + input.readMessage(com.google.cloud.automl.v1beta1.TranslationAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_); + detail_ = subBuilder.buildPartial(); + } + detailCase_ = 2; + break; + } + case 26: { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.Builder subBuilder = null; + if (detailCase_ == 3) { + subBuilder = ((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_).toBuilder(); + } + detail_ = + input.readMessage(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_); + detail_ = subBuilder.buildPartial(); + } + detailCase_ = 3; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + 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.v1beta1.AnnotationPayloadOuterClass.internal_static_google_cloud_automl_v1beta1_AnnotationPayload_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.internal_static_google_cloud_automl_v1beta1_AnnotationPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.AnnotationPayload.class, com.google.cloud.automl.v1beta1.AnnotationPayload.Builder.class); + } + + private int detailCase_ = 0; + private java.lang.Object detail_; + public enum DetailCase + implements com.google.protobuf.Internal.EnumLite { + TRANSLATION(2), + CLASSIFICATION(3), + 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 3: return CLASSIFICATION; + 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.v1beta1.TranslationAnnotation translation = 2; + */ + public boolean hasTranslation() { + return detailCase_ == 2; + } + /** + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1beta1.TranslationAnnotation getTranslation() { + if (detailCase_ == 2) { + return (com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_; + } + return com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance(); + } + /** + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1beta1.TranslationAnnotationOrBuilder getTranslationOrBuilder() { + if (detailCase_ == 2) { + return (com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_; + } + return com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance(); + } + + public static final int CLASSIFICATION_FIELD_NUMBER = 3; + /** + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public boolean hasClassification() { + return detailCase_ == 3; + } + /** + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation getClassification() { + if (detailCase_ == 3) { + return (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_; + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance(); + } + /** + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotationOrBuilder getClassificationOrBuilder() { + if (detailCase_ == 3) { + return (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_; + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance(); + } + + public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object annotationSpecId_; + /** + *
+   * Output only . The resource ID of the annotation spec that
+   * this annotation pertains to. The annotation spec comes from either an
+   * ancestor dataset, or the dataset that was used to train the model in use.
+   * 
+ * + * string annotation_spec_id = 1; + */ + public java.lang.String getAnnotationSpecId() { + java.lang.Object ref = annotationSpecId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + annotationSpecId_ = s; + return s; + } + } + /** + *
+   * Output only . The resource ID of the annotation spec that
+   * this annotation pertains to. The annotation spec comes from either an
+   * ancestor dataset, or the dataset that was used to train the model in use.
+   * 
+ * + * string annotation_spec_id = 1; + */ + public com.google.protobuf.ByteString + getAnnotationSpecIdBytes() { + java.lang.Object ref = annotationSpecId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + annotationSpecId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + *
+   * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+   * was trained. Because this field returns a value at model training time,
+   * for different models trained using the same dataset, the returned value
+   * could be different as model owner could update the display_name between
+   * any two model training.
+   * 
+ * + * string display_name = 5; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + *
+   * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+   * was trained. Because this field returns a value at model training time,
+   * for different models trained using the same dataset, the returned value
+   * could be different as model owner could update the display_name between
+   * any two model training.
+   * 
+ * + * string display_name = 5; + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getAnnotationSpecIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, annotationSpecId_); + } + if (detailCase_ == 2) { + output.writeMessage(2, (com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_); + } + if (detailCase_ == 3) { + output.writeMessage(3, (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAnnotationSpecIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, annotationSpecId_); + } + if (detailCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_); + } + if (detailCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + 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.v1beta1.AnnotationPayload)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.AnnotationPayload other = (com.google.cloud.automl.v1beta1.AnnotationPayload) obj; + + boolean result = true; + result = result && getAnnotationSpecId() + .equals(other.getAnnotationSpecId()); + result = result && getDisplayName() + .equals(other.getDisplayName()); + result = result && getDetailCase().equals( + other.getDetailCase()); + if (!result) return false; + switch (detailCase_) { + case 2: + result = result && getTranslation() + .equals(other.getTranslation()); + break; + case 3: + result = result && getClassification() + .equals(other.getClassification()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationSpecId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + switch (detailCase_) { + case 2: + hash = (37 * hash) + TRANSLATION_FIELD_NUMBER; + hash = (53 * hash) + getTranslation().hashCode(); + break; + case 3: + hash = (37 * hash) + CLASSIFICATION_FIELD_NUMBER; + hash = (53 * hash) + getClassification().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.AnnotationPayload parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.AnnotationPayload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.AnnotationPayload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.AnnotationPayload parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.AnnotationPayload parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.AnnotationPayload prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AnnotationPayload} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.AnnotationPayload) + com.google.cloud.automl.v1beta1.AnnotationPayloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.internal_static_google_cloud_automl_v1beta1_AnnotationPayload_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.internal_static_google_cloud_automl_v1beta1_AnnotationPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.AnnotationPayload.class, com.google.cloud.automl.v1beta1.AnnotationPayload.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + annotationSpecId_ = ""; + + displayName_ = ""; + + detailCase_ = 0; + detail_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.internal_static_google_cloud_automl_v1beta1_AnnotationPayload_descriptor; + } + + public com.google.cloud.automl.v1beta1.AnnotationPayload getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.AnnotationPayload.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.AnnotationPayload build() { + com.google.cloud.automl.v1beta1.AnnotationPayload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.AnnotationPayload buildPartial() { + com.google.cloud.automl.v1beta1.AnnotationPayload result = new com.google.cloud.automl.v1beta1.AnnotationPayload(this); + if (detailCase_ == 2) { + if (translationBuilder_ == null) { + result.detail_ = detail_; + } else { + result.detail_ = translationBuilder_.build(); + } + } + if (detailCase_ == 3) { + if (classificationBuilder_ == null) { + result.detail_ = detail_; + } else { + result.detail_ = classificationBuilder_.build(); + } + } + result.annotationSpecId_ = annotationSpecId_; + result.displayName_ = displayName_; + result.detailCase_ = detailCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.AnnotationPayload) { + return mergeFrom((com.google.cloud.automl.v1beta1.AnnotationPayload)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.AnnotationPayload other) { + if (other == com.google.cloud.automl.v1beta1.AnnotationPayload.getDefaultInstance()) return this; + if (!other.getAnnotationSpecId().isEmpty()) { + annotationSpecId_ = other.annotationSpecId_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + switch (other.getDetailCase()) { + case TRANSLATION: { + mergeTranslation(other.getTranslation()); + break; + } + case CLASSIFICATION: { + mergeClassification(other.getClassification()); + break; + } + case DETAIL_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.AnnotationPayload parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.TranslationAnnotation, com.google.cloud.automl.v1beta1.TranslationAnnotation.Builder, com.google.cloud.automl.v1beta1.TranslationAnnotationOrBuilder> translationBuilder_; + /** + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + public boolean hasTranslation() { + return detailCase_ == 2; + } + /** + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1beta1.TranslationAnnotation getTranslation() { + if (translationBuilder_ == null) { + if (detailCase_ == 2) { + return (com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_; + } + return com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance(); + } else { + if (detailCase_ == 2) { + return translationBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance(); + } + } + /** + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + public Builder setTranslation(com.google.cloud.automl.v1beta1.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.v1beta1.TranslationAnnotation translation = 2; + */ + public Builder setTranslation( + com.google.cloud.automl.v1beta1.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.v1beta1.TranslationAnnotation translation = 2; + */ + public Builder mergeTranslation(com.google.cloud.automl.v1beta1.TranslationAnnotation value) { + if (translationBuilder_ == null) { + if (detailCase_ == 2 && + detail_ != com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance()) { + detail_ = com.google.cloud.automl.v1beta1.TranslationAnnotation.newBuilder((com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1beta1.TranslationAnnotation.Builder getTranslationBuilder() { + return getTranslationFieldBuilder().getBuilder(); + } + /** + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + public com.google.cloud.automl.v1beta1.TranslationAnnotationOrBuilder getTranslationOrBuilder() { + if ((detailCase_ == 2) && (translationBuilder_ != null)) { + return translationBuilder_.getMessageOrBuilder(); + } else { + if (detailCase_ == 2) { + return (com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_; + } + return com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance(); + } + } + /** + *
+     * Annotation details for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationAnnotation, com.google.cloud.automl.v1beta1.TranslationAnnotation.Builder, com.google.cloud.automl.v1beta1.TranslationAnnotationOrBuilder> + getTranslationFieldBuilder() { + if (translationBuilder_ == null) { + if (!(detailCase_ == 2)) { + detail_ = com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance(); + } + translationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationAnnotation, com.google.cloud.automl.v1beta1.TranslationAnnotation.Builder, com.google.cloud.automl.v1beta1.TranslationAnnotationOrBuilder>( + (com.google.cloud.automl.v1beta1.TranslationAnnotation) detail_, + getParentForChildren(), + isClean()); + detail_ = null; + } + detailCase_ = 2; + onChanged();; + return translationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotationOrBuilder> classificationBuilder_; + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public boolean hasClassification() { + return detailCase_ == 3; + } + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation getClassification() { + if (classificationBuilder_ == null) { + if (detailCase_ == 3) { + return (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_; + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance(); + } else { + if (detailCase_ == 3) { + return classificationBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance(); + } + } + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public Builder setClassification(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation value) { + if (classificationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + onChanged(); + } else { + classificationBuilder_.setMessage(value); + } + detailCase_ = 3; + return this; + } + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public Builder setClassification( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.Builder builderForValue) { + if (classificationBuilder_ == null) { + detail_ = builderForValue.build(); + onChanged(); + } else { + classificationBuilder_.setMessage(builderForValue.build()); + } + detailCase_ = 3; + return this; + } + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public Builder mergeClassification(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation value) { + if (classificationBuilder_ == null) { + if (detailCase_ == 3 && + detail_ != com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance()) { + detail_ = com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.newBuilder((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_) + .mergeFrom(value).buildPartial(); + } else { + detail_ = value; + } + onChanged(); + } else { + if (detailCase_ == 3) { + classificationBuilder_.mergeFrom(value); + } + classificationBuilder_.setMessage(value); + } + detailCase_ = 3; + return this; + } + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public Builder clearClassification() { + if (classificationBuilder_ == null) { + if (detailCase_ == 3) { + detailCase_ = 0; + detail_ = null; + onChanged(); + } + } else { + if (detailCase_ == 3) { + detailCase_ = 0; + detail_ = null; + } + classificationBuilder_.clear(); + } + return this; + } + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.Builder getClassificationBuilder() { + return getClassificationFieldBuilder().getBuilder(); + } + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotationOrBuilder getClassificationOrBuilder() { + if ((detailCase_ == 3) && (classificationBuilder_ != null)) { + return classificationBuilder_.getMessageOrBuilder(); + } else { + if (detailCase_ == 3) { + return (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_; + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance(); + } + } + /** + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotationOrBuilder> + getClassificationFieldBuilder() { + if (classificationBuilder_ == null) { + if (!(detailCase_ == 3)) { + detail_ = com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance(); + } + classificationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotationOrBuilder>( + (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) detail_, + getParentForChildren(), + isClean()); + detail_ = null; + } + detailCase_ = 3; + onChanged();; + return classificationBuilder_; + } + + private java.lang.Object annotationSpecId_ = ""; + /** + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public java.lang.String getAnnotationSpecId() { + java.lang.Object ref = annotationSpecId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + annotationSpecId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public com.google.protobuf.ByteString + getAnnotationSpecIdBytes() { + java.lang.Object ref = annotationSpecId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + annotationSpecId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public Builder setAnnotationSpecId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + annotationSpecId_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public Builder clearAnnotationSpecId() { + + annotationSpecId_ = getDefaultInstance().getAnnotationSpecId(); + onChanged(); + return this; + } + /** + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public Builder setAnnotationSpecIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + annotationSpecId_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + *
+     * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+     * was trained. Because this field returns a value at model training time,
+     * for different models trained using the same dataset, the returned value
+     * could be different as model owner could update the display_name between
+     * any two model training.
+     * 
+ * + * string display_name = 5; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+     * was trained. Because this field returns a value at model training time,
+     * for different models trained using the same dataset, the returned value
+     * could be different as model owner could update the display_name between
+     * any two model training.
+     * 
+ * + * string display_name = 5; + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+     * was trained. Because this field returns a value at model training time,
+     * for different models trained using the same dataset, the returned value
+     * could be different as model owner could update the display_name between
+     * any two model training.
+     * 
+ * + * string display_name = 5; + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+     * was trained. Because this field returns a value at model training time,
+     * for different models trained using the same dataset, the returned value
+     * could be different as model owner could update the display_name between
+     * any two model training.
+     * 
+ * + * string display_name = 5; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + *
+     * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+     * was trained. Because this field returns a value at model training time,
+     * for different models trained using the same dataset, the returned value
+     * could be different as model owner could update the display_name between
+     * any two model training.
+     * 
+ * + * string display_name = 5; + */ + public Builder setDisplayNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.AnnotationPayload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.AnnotationPayload) + private static final com.google.cloud.automl.v1beta1.AnnotationPayload DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.AnnotationPayload(); + } + + public static com.google.cloud.automl.v1beta1.AnnotationPayload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.AnnotationPayload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayloadOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayloadOrBuilder.java new file mode 100644 index 000000000000..bae2bdb25298 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayloadOrBuilder.java @@ -0,0 +1,109 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/annotation_payload.proto + +package com.google.cloud.automl.v1beta1; + +public interface AnnotationPayloadOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.AnnotationPayload) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + boolean hasTranslation(); + /** + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + com.google.cloud.automl.v1beta1.TranslationAnnotation getTranslation(); + /** + *
+   * Annotation details for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationAnnotation translation = 2; + */ + com.google.cloud.automl.v1beta1.TranslationAnnotationOrBuilder getTranslationOrBuilder(); + + /** + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + boolean hasClassification(); + /** + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation getClassification(); + /** + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationAnnotation classification = 3; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotationOrBuilder getClassificationOrBuilder(); + + /** + *
+   * Output only . The resource ID of the annotation spec that
+   * this annotation pertains to. The annotation spec comes from either an
+   * ancestor dataset, or the dataset that was used to train the model in use.
+   * 
+ * + * string annotation_spec_id = 1; + */ + java.lang.String getAnnotationSpecId(); + /** + *
+   * Output only . The resource ID of the annotation spec that
+   * this annotation pertains to. The annotation spec comes from either an
+   * ancestor dataset, or the dataset that was used to train the model in use.
+   * 
+ * + * string annotation_spec_id = 1; + */ + com.google.protobuf.ByteString + getAnnotationSpecIdBytes(); + + /** + *
+   * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+   * was trained. Because this field returns a value at model training time,
+   * for different models trained using the same dataset, the returned value
+   * could be different as model owner could update the display_name between
+   * any two model training.
+   * 
+ * + * string display_name = 5; + */ + java.lang.String getDisplayName(); + /** + *
+   * Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model
+   * was trained. Because this field returns a value at model training time,
+   * for different models trained using the same dataset, the returned value
+   * could be different as model owner could update the display_name between
+   * any two model training.
+   * 
+ * + * string display_name = 5; + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + public com.google.cloud.automl.v1beta1.AnnotationPayload.DetailCase getDetailCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayloadOuterClass.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayloadOuterClass.java new file mode 100644 index 000000000000..25a3487d2f9b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AnnotationPayloadOuterClass.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/annotation_payload.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_AnnotationPayload_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_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 = { + "\n4google/cloud/automl/v1beta1/annotation" + + "_payload.proto\022\033google.cloud.automl.v1be" + + "ta1\032\034google/api/annotations.proto\0320googl" + + "e/cloud/automl/v1beta1/classification.pr" + + "oto\032-google/cloud/automl/v1beta1/transla" + + "tion.proto\"\353\001\n\021AnnotationPayload\022I\n\013tran" + + "slation\030\002 \001(\01322.google.cloud.automl.v1be" + + "ta1.TranslationAnnotationH\000\022O\n\016classific" + + "ation\030\003 \001(\01325.google.cloud.automl.v1beta" + + "1.ClassificationAnnotationH\000\022\032\n\022annotati" + + "on_spec_id\030\001 \001(\t\022\024\n\014display_name\030\005 \001(\tB\010" + + "\n\006detailBf\n\037com.google.cloud.automl.v1be" + + "ta1P\001ZAgoogle.golang.org/genproto/google" + + "apis/cloud/automl/v1beta1;automlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(), + com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_AnnotationPayload_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_AnnotationPayload_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_AnnotationPayload_descriptor, + new java.lang.String[] { "Translation", "Classification", "AnnotationSpecId", "DisplayName", "Detail", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(); + com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlProto.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlProto.java new file mode 100644 index 000000000000..bcf6df796576 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlProto.java @@ -0,0 +1,358 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public final class AutoMlProto { + private AutoMlProto() {} + 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_v1beta1_CreateDatasetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ImportDataRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ImportDataRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ExportDataRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ExportDataRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_CreateModelRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_CreateModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_GetModelRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_GetModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ListModelsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ListModelsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ListModelsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ListModelsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_DeployModelRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_DeployModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_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/v1beta1/service.pr" + + "oto\022\033google.cloud.automl.v1beta1\032\034google" + + "/api/annotations.proto\0324google/cloud/aut" + + "oml/v1beta1/annotation_payload.proto\032)go" + + "ogle/cloud/automl/v1beta1/dataset.proto\032" + + "$google/cloud/automl/v1beta1/io.proto\032\'g" + + "oogle/cloud/automl/v1beta1/model.proto\0322" + + "google/cloud/automl/v1beta1/model_evalua" + + "tion.proto\032,google/cloud/automl/v1beta1/" + + "operations.proto\032#google/longrunning/ope" + + "rations.proto\032 google/protobuf/field_mas" + + "k.proto\"]\n\024CreateDatasetRequest\022\016\n\006paren" + + "t\030\001 \001(\t\0225\n\007dataset\030\002 \001(\0132$.google.cloud." + + "automl.v1beta1.Dataset\"!\n\021GetDatasetRequ" + + "est\022\014\n\004name\030\001 \001(\t\"\\\n\023ListDatasetsRequest" + + "\022\016\n\006parent\030\001 \001(\t\022\016\n\006filter\030\003 \001(\t\022\021\n\tpage" + + "_size\030\004 \001(\005\022\022\n\npage_token\030\006 \001(\t\"g\n\024ListD" + + "atasetsResponse\0226\n\010datasets\030\001 \003(\0132$.goog" + + "le.cloud.automl.v1beta1.Dataset\022\027\n\017next_" + + "page_token\030\002 \001(\t\"$\n\024DeleteDatasetRequest" + + "\022\014\n\004name\030\001 \001(\t\"a\n\021ImportDataRequest\022\014\n\004n" + + "ame\030\001 \001(\t\022>\n\014input_config\030\003 \001(\0132(.google" + + ".cloud.automl.v1beta1.InputConfig\"c\n\021Exp" + + "ortDataRequest\022\014\n\004name\030\001 \001(\t\022@\n\routput_c" + + "onfig\030\003 \001(\0132).google.cloud.automl.v1beta" + + "1.OutputConfig\"W\n\022CreateModelRequest\022\016\n\006" + + "parent\030\001 \001(\t\0221\n\005model\030\004 \001(\0132\".google.clo" + + "ud.automl.v1beta1.Model\"\037\n\017GetModelReque" + + "st\022\014\n\004name\030\001 \001(\t\"Z\n\021ListModelsRequest\022\016\n" + + "\006parent\030\001 \001(\t\022\016\n\006filter\030\003 \001(\t\022\021\n\tpage_si" + + "ze\030\004 \001(\005\022\022\n\npage_token\030\006 \001(\t\"`\n\022ListMode" + + "lsResponse\0221\n\005model\030\001 \003(\0132\".google.cloud" + + ".automl.v1beta1.Model\022\027\n\017next_page_token" + + "\030\002 \001(\t\"\"\n\022DeleteModelRequest\022\014\n\004name\030\001 \001" + + "(\t\"\"\n\022DeployModelRequest\022\014\n\004name\030\001 \001(\t\"$" + + "\n\024UndeployModelRequest\022\014\n\004name\030\001 \001(\t\")\n\031" + + "GetModelEvaluationRequest\022\014\n\004name\030\001 \001(\t\"" + + "d\n\033ListModelEvaluationsRequest\022\016\n\006parent" + + "\030\001 \001(\t\022\016\n\006filter\030\003 \001(\t\022\021\n\tpage_size\030\004 \001(" + + "\005\022\022\n\npage_token\030\006 \001(\t\"\177\n\034ListModelEvalua" + + "tionsResponse\022F\n\020model_evaluation\030\001 \003(\0132" + + ",.google.cloud.automl.v1beta1.ModelEvalu" + + "ation\022\027\n\017next_page_token\030\002 \001(\t2\336\022\n\006AutoM" + + "l\022\254\001\n\rCreateDataset\0221.google.cloud.autom" + + "l.v1beta1.CreateDatasetRequest\032$.google." + + "cloud.automl.v1beta1.Dataset\"B\202\323\344\223\002<\"1/v" + + "1beta1/{parent=projects/*/locations/*}/d" + + "atasets:\007dataset\022\235\001\n\nGetDataset\022..google" + + ".cloud.automl.v1beta1.GetDatasetRequest\032" + + "$.google.cloud.automl.v1beta1.Dataset\"9\202" + + "\323\344\223\0023\0221/v1beta1/{name=projects/*/locatio" + + "ns/*/datasets/*}\022\256\001\n\014ListDatasets\0220.goog" + + "le.cloud.automl.v1beta1.ListDatasetsRequ" + + "est\0321.google.cloud.automl.v1beta1.ListDa" + + "tasetsResponse\"9\202\323\344\223\0023\0221/v1beta1/{parent" + + "=projects/*/locations/*}/datasets\022\234\001\n\rDe" + + "leteDataset\0221.google.cloud.automl.v1beta" + + "1.DeleteDatasetRequest\032\035.google.longrunn" + + "ing.Operation\"9\202\323\344\223\0023*1/v1beta1/{name=pr" + + "ojects/*/locations/*/datasets/*}\022\244\001\n\nImp" + + "ortData\022..google.cloud.automl.v1beta1.Im" + + "portDataRequest\032\035.google.longrunning.Ope" + + "ration\"G\202\323\344\223\002A\"\202\323\344\223\0028\"//v1beta1" + + "/{parent=projects/*/locations/*}/models:" + + "\005model\022\225\001\n\010GetModel\022,.google.cloud.autom" + + "l.v1beta1.GetModelRequest\032\".google.cloud" + + ".automl.v1beta1.Model\"7\202\323\344\223\0021\022//v1beta1/" + + "{name=projects/*/locations/*/models/*}\022\246" + + "\001\n\nListModels\022..google.cloud.automl.v1be" + + "ta1.ListModelsRequest\032/.google.cloud.aut" + + "oml.v1beta1.ListModelsResponse\"7\202\323\344\223\0021\022/" + + "/v1beta1/{parent=projects/*/locations/*}" + + "/models\022\226\001\n\013DeleteModel\022/.google.cloud.a" + + "utoml.v1beta1.DeleteModelRequest\032\035.googl" + + "e.longrunning.Operation\"7\202\323\344\223\0021*//v1beta" + + "1/{name=projects/*/locations/*/models/*}" + + "\022\240\001\n\013DeployModel\022/.google.cloud.automl.v" + + "1beta1.DeployModelRequest\032\035.google.longr" + + "unning.Operation\"A\202\323\344\223\002;\"6/v1beta1/{name" + + "=projects/*/locations/*/models/*}:deploy" + + ":\001*\022\246\001\n\rUndeployModel\0221.google.cloud.aut" + + "oml.v1beta1.UndeployModelRequest\032\035.googl" + + "e.longrunning.Operation\"C\202\323\344\223\002=\"8/v1beta" + + "1/{name=projects/*/locations/*/models/*}" + + ":undeploy:\001*\022\306\001\n\022GetModelEvaluation\0226.go" + + "ogle.cloud.automl.v1beta1.GetModelEvalua" + + "tionRequest\032,.google.cloud.automl.v1beta" + + "1.ModelEvaluation\"J\202\323\344\223\002D\022B/v1beta1/{nam" + + "e=projects/*/locations/*/models/*/modelE" + + "valuations/*}\022\327\001\n\024ListModelEvaluations\0228" + + ".google.cloud.automl.v1beta1.ListModelEv" + + "aluationsRequest\0329.google.cloud.automl.v" + + "1beta1.ListModelEvaluationsResponse\"J\202\323\344" + + "\223\002D\022B/v1beta1/{parent=projects/*/locatio" + + "ns/*/models/*}/modelEvaluationsBs\n\037com.g" + + "oogle.cloud.automl.v1beta1B\013AutoMlProtoP" + + "\001ZAgoogle.golang.org/genproto/googleapis" + + "/cloud/automl/v1beta1;automlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.getDescriptor(), + com.google.cloud.automl.v1beta1.DatasetOuterClass.getDescriptor(), + com.google.cloud.automl.v1beta1.Io.getDescriptor(), + com.google.cloud.automl.v1beta1.ModelOuterClass.getDescriptor(), + com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.getDescriptor(), + com.google.cloud.automl.v1beta1.Operations.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_descriptor, + new java.lang.String[] { "Parent", "Dataset", }); + internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_descriptor, + new java.lang.String[] { "Parent", "Filter", "PageSize", "PageToken", }); + internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_descriptor, + new java.lang.String[] { "Datasets", "NextPageToken", }); + internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_automl_v1beta1_ImportDataRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_automl_v1beta1_ImportDataRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ImportDataRequest_descriptor, + new java.lang.String[] { "Name", "InputConfig", }); + internal_static_google_cloud_automl_v1beta1_ExportDataRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_automl_v1beta1_ExportDataRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ExportDataRequest_descriptor, + new java.lang.String[] { "Name", "OutputConfig", }); + internal_static_google_cloud_automl_v1beta1_CreateModelRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_automl_v1beta1_CreateModelRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_CreateModelRequest_descriptor, + new java.lang.String[] { "Parent", "Model", }); + internal_static_google_cloud_automl_v1beta1_GetModelRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_automl_v1beta1_GetModelRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_GetModelRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_automl_v1beta1_ListModelsRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_automl_v1beta1_ListModelsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ListModelsRequest_descriptor, + new java.lang.String[] { "Parent", "Filter", "PageSize", "PageToken", }); + internal_static_google_cloud_automl_v1beta1_ListModelsResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_automl_v1beta1_ListModelsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ListModelsResponse_descriptor, + new java.lang.String[] { "Model", "NextPageToken", }); + internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_automl_v1beta1_DeployModelRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_automl_v1beta1_DeployModelRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_DeployModelRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_descriptor, + new java.lang.String[] { "Parent", "Filter", "PageSize", "PageToken", }); + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_descriptor, + new java.lang.String[] { "ModelEvaluation", "NextPageToken", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.getDescriptor(); + com.google.cloud.automl.v1beta1.DatasetOuterClass.getDescriptor(); + com.google.cloud.automl.v1beta1.Io.getDescriptor(); + com.google.cloud.automl.v1beta1.ModelOuterClass.getDescriptor(); + com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.getDescriptor(); + com.google.cloud.automl.v1beta1.Operations.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ClassificationProto.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ClassificationProto.java new file mode 100644 index 000000000000..34866088414a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ClassificationProto.java @@ -0,0 +1,5313 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/classification.proto + +package com.google.cloud.automl.v1beta1; + +public final class ClassificationProto { + private ClassificationProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + *
+   * Type of the classification problem.
+   * 
+ * + * Protobuf enum {@code google.cloud.automl.v1beta1.ClassificationType} + */ + public enum ClassificationType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Should not be used, an un-set enum has this value by default.
+     * 
+ * + * CLASSIFICATION_TYPE_UNSPECIFIED = 0; + */ + CLASSIFICATION_TYPE_UNSPECIFIED(0), + /** + *
+     * At most one label is allowed per example.
+     * 
+ * + * MULTICLASS = 1; + */ + MULTICLASS(1), + /** + *
+     * Multiple labels are allowed for one example.
+     * 
+ * + * MULTILABEL = 2; + */ + MULTILABEL(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Should not be used, an un-set enum has this value by default.
+     * 
+ * + * CLASSIFICATION_TYPE_UNSPECIFIED = 0; + */ + public static final int CLASSIFICATION_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * At most one label is allowed per example.
+     * 
+ * + * MULTICLASS = 1; + */ + public static final int MULTICLASS_VALUE = 1; + /** + *
+     * Multiple labels are allowed for one example.
+     * 
+ * + * MULTILABEL = 2; + */ + public static final int MULTILABEL_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ClassificationType valueOf(int value) { + return forNumber(value); + } + + public static ClassificationType forNumber(int value) { + switch (value) { + case 0: return CLASSIFICATION_TYPE_UNSPECIFIED; + case 1: return MULTICLASS; + case 2: return MULTILABEL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ClassificationType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ClassificationType findValueByNumber(int number) { + return ClassificationType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ClassificationType[] VALUES = values(); + + public static ClassificationType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ClassificationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1beta1.ClassificationType) + } + + public interface ClassificationAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ClassificationAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+     * means greater confidence that the annotation is positive. If a user
+     * approves an annotation as negative or positive, the score value remains
+     * unchanged. If a user creates an annotation, the score is 0 for negative or
+     * 1 for positive.
+     * 
+ * + * float score = 1; + */ + float getScore(); + } + /** + *
+   * Contains annotation details specific to classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationAnnotation} + */ + public static final class ClassificationAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.ClassificationAnnotation) + ClassificationAnnotationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassificationAnnotation.newBuilder() to construct. + private ClassificationAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClassificationAnnotation() { + score_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClassificationAnnotation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 13: { + + score_ = input.readFloat(); + 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.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.Builder.class); + } + + public static final int SCORE_FIELD_NUMBER = 1; + private float score_; + /** + *
+     * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+     * means greater confidence that the annotation is positive. If a user
+     * approves an annotation as negative or positive, the score value remains
+     * unchanged. If a user creates an annotation, the score is 0 for negative or
+     * 1 for positive.
+     * 
+ * + * float score = 1; + */ + public float getScore() { + return score_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (score_ != 0F) { + output.writeFloat(1, score_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, score_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation other = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) obj; + + boolean result = true; + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Contains annotation details specific to classification.
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ClassificationAnnotation) + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + score_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_descriptor; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation build() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation buildPartial() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation result = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation(this); + result.score_ = score_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) { + return mergeFrom((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation other) { + if (other == com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation.getDefaultInstance()) return this; + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float score_ ; + /** + *
+       * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+       * means greater confidence that the annotation is positive. If a user
+       * approves an annotation as negative or positive, the score value remains
+       * unchanged. If a user creates an annotation, the score is 0 for negative or
+       * 1 for positive.
+       * 
+ * + * float score = 1; + */ + public float getScore() { + return score_; + } + /** + *
+       * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+       * means greater confidence that the annotation is positive. If a user
+       * approves an annotation as negative or positive, the score value remains
+       * unchanged. If a user creates an annotation, the score is 0 for negative or
+       * 1 for positive.
+       * 
+ * + * float score = 1; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+       * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+       * means greater confidence that the annotation is positive. If a user
+       * approves an annotation as negative or positive, the score value remains
+       * unchanged. If a user creates an annotation, the score is 0 for negative or
+       * 1 for positive.
+       * 
+ * + * float score = 1; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ClassificationAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationAnnotation) + private static final com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation(); + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ClassificationAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassificationAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ClassificationEvaluationMetricsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Output only. The Area under precision recall curve metric.
+     * 
+ * + * float au_prc = 1; + */ + float getAuPrc(); + + /** + *
+     * Output only. The Area under precision recall curve metric based on priors.
+     * 
+ * + * float base_au_prc = 2; + */ + float getBaseAuPrc(); + + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + java.util.List + getConfidenceMetricsEntryList(); + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry getConfidenceMetricsEntry(int index); + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + int getConfidenceMetricsEntryCount(); + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + java.util.List + getConfidenceMetricsEntryOrBuilderList(); + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder getConfidenceMetricsEntryOrBuilder( + int index); + + /** + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + boolean hasConfusionMatrix(); + /** + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix getConfusionMatrix(); + /** + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder getConfusionMatrixOrBuilder(); + + /** + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + java.util.List + getAnnotationSpecIdList(); + /** + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + int getAnnotationSpecIdCount(); + /** + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + java.lang.String getAnnotationSpecId(int index); + /** + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + com.google.protobuf.ByteString + getAnnotationSpecIdBytes(int index); + } + /** + *
+   * Model evaluation metrics for classification problems.
+   * Visible only to v1beta1
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} + */ + public static final class ClassificationEvaluationMetrics extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics) + ClassificationEvaluationMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassificationEvaluationMetrics.newBuilder() to construct. + private ClassificationEvaluationMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClassificationEvaluationMetrics() { + auPrc_ = 0F; + baseAuPrc_ = 0F; + confidenceMetricsEntry_ = java.util.Collections.emptyList(); + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClassificationEvaluationMetrics( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 13: { + + auPrc_ = input.readFloat(); + break; + } + case 21: { + + baseAuPrc_ = input.readFloat(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + confidenceMetricsEntry_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + confidenceMetricsEntry_.add( + input.readMessage(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.parser(), extensionRegistry)); + break; + } + case 34: { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Builder subBuilder = null; + if (confusionMatrix_ != null) { + subBuilder = confusionMatrix_.toBuilder(); + } + confusionMatrix_ = input.readMessage(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(confusionMatrix_); + confusionMatrix_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000010; + } + annotationSpecId_.add(s); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + confidenceMetricsEntry_ = java.util.Collections.unmodifiableList(confidenceMetricsEntry_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + annotationSpecId_ = annotationSpecId_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.Builder.class); + } + + public interface ConfidenceMetricsEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + com.google.protobuf.MessageOrBuilder { + + /** + *
+       * Output only. The confidence threshold value used to compute the metrics.
+       * 
+ * + * float confidence_threshold = 1; + */ + float getConfidenceThreshold(); + + /** + *
+       * Output only. Recall under the given confidence threshold.
+       * 
+ * + * float recall = 2; + */ + float getRecall(); + + /** + *
+       * Output only. Precision under the given confidence threshold.
+       * 
+ * + * float precision = 3; + */ + float getPrecision(); + + /** + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 4; + */ + float getF1Score(); + + /** + *
+       * Output only. The recall when only considering the label that has the
+       * highest prediction score and not below the confidence threshold for each
+       * example.
+       * 
+ * + * float recall_at1 = 5; + */ + float getRecallAt1(); + + /** + *
+       * Output only. The precision when only considering the label that has the
+       * highest predictionscore and not below the confidence threshold for each
+       * example.
+       * 
+ * + * float precision_at1 = 6; + */ + float getPrecisionAt1(); + + /** + *
+       * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+       * 
+ * + * float f1_score_at1 = 7; + */ + float getF1ScoreAt1(); + } + /** + *
+     * Metrics for a single confidence threshold.
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} + */ + public static final class ConfidenceMetricsEntry extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + ConfidenceMetricsEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfidenceMetricsEntry.newBuilder() to construct. + private ConfidenceMetricsEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfidenceMetricsEntry() { + confidenceThreshold_ = 0F; + recall_ = 0F; + precision_ = 0F; + f1Score_ = 0F; + recallAt1_ = 0F; + precisionAt1_ = 0F; + f1ScoreAt1_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfidenceMetricsEntry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 13: { + + confidenceThreshold_ = input.readFloat(); + break; + } + case 21: { + + recall_ = input.readFloat(); + break; + } + case 29: { + + precision_ = input.readFloat(); + break; + } + case 37: { + + f1Score_ = input.readFloat(); + break; + } + case 45: { + + recallAt1_ = input.readFloat(); + break; + } + case 53: { + + precisionAt1_ = input.readFloat(); + break; + } + case 61: { + + f1ScoreAt1_ = input.readFloat(); + break; + } + } + } + } 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.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder.class); + } + + public static final int CONFIDENCE_THRESHOLD_FIELD_NUMBER = 1; + private float confidenceThreshold_; + /** + *
+       * Output only. The confidence threshold value used to compute the metrics.
+       * 
+ * + * float confidence_threshold = 1; + */ + public float getConfidenceThreshold() { + return confidenceThreshold_; + } + + public static final int RECALL_FIELD_NUMBER = 2; + private float recall_; + /** + *
+       * Output only. Recall under the given confidence threshold.
+       * 
+ * + * float recall = 2; + */ + public float getRecall() { + return recall_; + } + + public static final int PRECISION_FIELD_NUMBER = 3; + private float precision_; + /** + *
+       * Output only. Precision under the given confidence threshold.
+       * 
+ * + * float precision = 3; + */ + public float getPrecision() { + return precision_; + } + + public static final int F1_SCORE_FIELD_NUMBER = 4; + private float f1Score_; + /** + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 4; + */ + public float getF1Score() { + return f1Score_; + } + + public static final int RECALL_AT1_FIELD_NUMBER = 5; + private float recallAt1_; + /** + *
+       * Output only. The recall when only considering the label that has the
+       * highest prediction score and not below the confidence threshold for each
+       * example.
+       * 
+ * + * float recall_at1 = 5; + */ + public float getRecallAt1() { + return recallAt1_; + } + + public static final int PRECISION_AT1_FIELD_NUMBER = 6; + private float precisionAt1_; + /** + *
+       * Output only. The precision when only considering the label that has the
+       * highest predictionscore and not below the confidence threshold for each
+       * example.
+       * 
+ * + * float precision_at1 = 6; + */ + public float getPrecisionAt1() { + return precisionAt1_; + } + + public static final int F1_SCORE_AT1_FIELD_NUMBER = 7; + private float f1ScoreAt1_; + /** + *
+       * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+       * 
+ * + * float f1_score_at1 = 7; + */ + public float getF1ScoreAt1() { + return f1ScoreAt1_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (confidenceThreshold_ != 0F) { + output.writeFloat(1, confidenceThreshold_); + } + if (recall_ != 0F) { + output.writeFloat(2, recall_); + } + if (precision_ != 0F) { + output.writeFloat(3, precision_); + } + if (f1Score_ != 0F) { + output.writeFloat(4, f1Score_); + } + if (recallAt1_ != 0F) { + output.writeFloat(5, recallAt1_); + } + if (precisionAt1_ != 0F) { + output.writeFloat(6, precisionAt1_); + } + if (f1ScoreAt1_ != 0F) { + output.writeFloat(7, f1ScoreAt1_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (confidenceThreshold_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, confidenceThreshold_); + } + if (recall_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, recall_); + } + if (precision_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, precision_); + } + if (f1Score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, f1Score_); + } + if (recallAt1_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(5, recallAt1_); + } + if (precisionAt1_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(6, precisionAt1_); + } + if (f1ScoreAt1_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(7, f1ScoreAt1_); + } + 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.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry other = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) obj; + + boolean result = true; + result = result && ( + java.lang.Float.floatToIntBits(getConfidenceThreshold()) + == java.lang.Float.floatToIntBits( + other.getConfidenceThreshold())); + result = result && ( + java.lang.Float.floatToIntBits(getRecall()) + == java.lang.Float.floatToIntBits( + other.getRecall())); + result = result && ( + java.lang.Float.floatToIntBits(getPrecision()) + == java.lang.Float.floatToIntBits( + other.getPrecision())); + result = result && ( + java.lang.Float.floatToIntBits(getF1Score()) + == java.lang.Float.floatToIntBits( + other.getF1Score())); + result = result && ( + java.lang.Float.floatToIntBits(getRecallAt1()) + == java.lang.Float.floatToIntBits( + other.getRecallAt1())); + result = result && ( + java.lang.Float.floatToIntBits(getPrecisionAt1()) + == java.lang.Float.floatToIntBits( + other.getPrecisionAt1())); + result = result && ( + java.lang.Float.floatToIntBits(getF1ScoreAt1()) + == java.lang.Float.floatToIntBits( + other.getF1ScoreAt1())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONFIDENCE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidenceThreshold()); + hash = (37 * hash) + RECALL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getRecall()); + hash = (37 * hash) + PRECISION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPrecision()); + hash = (37 * hash) + F1_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getF1Score()); + hash = (37 * hash) + RECALL_AT1_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getRecallAt1()); + hash = (37 * hash) + PRECISION_AT1_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPrecisionAt1()); + hash = (37 * hash) + F1_SCORE_AT1_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getF1ScoreAt1()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+       * Metrics for a single confidence threshold.
+       * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + confidenceThreshold_ = 0F; + + recall_ = 0F; + + precision_ = 0F; + + f1Score_ = 0F; + + recallAt1_ = 0F; + + precisionAt1_ = 0F; + + f1ScoreAt1_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry build() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry buildPartial() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry result = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(this); + result.confidenceThreshold_ = confidenceThreshold_; + result.recall_ = recall_; + result.precision_ = precision_; + result.f1Score_ = f1Score_; + result.recallAt1_ = recallAt1_; + result.precisionAt1_ = precisionAt1_; + result.f1ScoreAt1_ = f1ScoreAt1_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) { + return mergeFrom((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry other) { + if (other == com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.getDefaultInstance()) return this; + if (other.getConfidenceThreshold() != 0F) { + setConfidenceThreshold(other.getConfidenceThreshold()); + } + if (other.getRecall() != 0F) { + setRecall(other.getRecall()); + } + if (other.getPrecision() != 0F) { + setPrecision(other.getPrecision()); + } + if (other.getF1Score() != 0F) { + setF1Score(other.getF1Score()); + } + if (other.getRecallAt1() != 0F) { + setRecallAt1(other.getRecallAt1()); + } + if (other.getPrecisionAt1() != 0F) { + setPrecisionAt1(other.getPrecisionAt1()); + } + if (other.getF1ScoreAt1() != 0F) { + setF1ScoreAt1(other.getF1ScoreAt1()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float confidenceThreshold_ ; + /** + *
+         * Output only. The confidence threshold value used to compute the metrics.
+         * 
+ * + * float confidence_threshold = 1; + */ + public float getConfidenceThreshold() { + return confidenceThreshold_; + } + /** + *
+         * Output only. The confidence threshold value used to compute the metrics.
+         * 
+ * + * float confidence_threshold = 1; + */ + public Builder setConfidenceThreshold(float value) { + + confidenceThreshold_ = value; + onChanged(); + return this; + } + /** + *
+         * Output only. The confidence threshold value used to compute the metrics.
+         * 
+ * + * float confidence_threshold = 1; + */ + public Builder clearConfidenceThreshold() { + + confidenceThreshold_ = 0F; + onChanged(); + return this; + } + + private float recall_ ; + /** + *
+         * Output only. Recall under the given confidence threshold.
+         * 
+ * + * float recall = 2; + */ + public float getRecall() { + return recall_; + } + /** + *
+         * Output only. Recall under the given confidence threshold.
+         * 
+ * + * float recall = 2; + */ + public Builder setRecall(float value) { + + recall_ = value; + onChanged(); + return this; + } + /** + *
+         * Output only. Recall under the given confidence threshold.
+         * 
+ * + * float recall = 2; + */ + public Builder clearRecall() { + + recall_ = 0F; + onChanged(); + return this; + } + + private float precision_ ; + /** + *
+         * Output only. Precision under the given confidence threshold.
+         * 
+ * + * float precision = 3; + */ + public float getPrecision() { + return precision_; + } + /** + *
+         * Output only. Precision under the given confidence threshold.
+         * 
+ * + * float precision = 3; + */ + public Builder setPrecision(float value) { + + precision_ = value; + onChanged(); + return this; + } + /** + *
+         * Output only. Precision under the given confidence threshold.
+         * 
+ * + * float precision = 3; + */ + public Builder clearPrecision() { + + precision_ = 0F; + onChanged(); + return this; + } + + private float f1Score_ ; + /** + *
+         * Output only. The harmonic mean of recall and precision.
+         * 
+ * + * float f1_score = 4; + */ + public float getF1Score() { + return f1Score_; + } + /** + *
+         * Output only. The harmonic mean of recall and precision.
+         * 
+ * + * float f1_score = 4; + */ + public Builder setF1Score(float value) { + + f1Score_ = value; + onChanged(); + return this; + } + /** + *
+         * Output only. The harmonic mean of recall and precision.
+         * 
+ * + * float f1_score = 4; + */ + public Builder clearF1Score() { + + f1Score_ = 0F; + onChanged(); + return this; + } + + private float recallAt1_ ; + /** + *
+         * Output only. The recall when only considering the label that has the
+         * highest prediction score and not below the confidence threshold for each
+         * example.
+         * 
+ * + * float recall_at1 = 5; + */ + public float getRecallAt1() { + return recallAt1_; + } + /** + *
+         * Output only. The recall when only considering the label that has the
+         * highest prediction score and not below the confidence threshold for each
+         * example.
+         * 
+ * + * float recall_at1 = 5; + */ + public Builder setRecallAt1(float value) { + + recallAt1_ = value; + onChanged(); + return this; + } + /** + *
+         * Output only. The recall when only considering the label that has the
+         * highest prediction score and not below the confidence threshold for each
+         * example.
+         * 
+ * + * float recall_at1 = 5; + */ + public Builder clearRecallAt1() { + + recallAt1_ = 0F; + onChanged(); + return this; + } + + private float precisionAt1_ ; + /** + *
+         * Output only. The precision when only considering the label that has the
+         * highest predictionscore and not below the confidence threshold for each
+         * example.
+         * 
+ * + * float precision_at1 = 6; + */ + public float getPrecisionAt1() { + return precisionAt1_; + } + /** + *
+         * Output only. The precision when only considering the label that has the
+         * highest predictionscore and not below the confidence threshold for each
+         * example.
+         * 
+ * + * float precision_at1 = 6; + */ + public Builder setPrecisionAt1(float value) { + + precisionAt1_ = value; + onChanged(); + return this; + } + /** + *
+         * Output only. The precision when only considering the label that has the
+         * highest predictionscore and not below the confidence threshold for each
+         * example.
+         * 
+ * + * float precision_at1 = 6; + */ + public Builder clearPrecisionAt1() { + + precisionAt1_ = 0F; + onChanged(); + return this; + } + + private float f1ScoreAt1_ ; + /** + *
+         * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+         * 
+ * + * float f1_score_at1 = 7; + */ + public float getF1ScoreAt1() { + return f1ScoreAt1_; + } + /** + *
+         * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+         * 
+ * + * float f1_score_at1 = 7; + */ + public Builder setF1ScoreAt1(float value) { + + f1ScoreAt1_ = value; + onChanged(); + return this; + } + /** + *
+         * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+         * 
+ * + * float f1_score_at1 = 7; + */ + public Builder clearF1ScoreAt1() { + + f1ScoreAt1_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + private static final com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ConfidenceMetricsEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfidenceMetricsEntry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConfusionMatrixOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix) + com.google.protobuf.MessageOrBuilder { + + /** + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + java.util.List + getAnnotationSpecIdList(); + /** + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + int getAnnotationSpecIdCount(); + /** + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + java.lang.String getAnnotationSpecId(int index); + /** + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + com.google.protobuf.ByteString + getAnnotationSpecIdBytes(int index); + + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + java.util.List + getRowList(); + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow(int index); + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + int getRowCount(); + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + java.util.List + getRowOrBuilderList(); + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder getRowOrBuilder( + int index); + } + /** + *
+     * Confusion matrix of the model running the classification.
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} + */ + public static final class ConfusionMatrix extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix) + ConfusionMatrixOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfusionMatrix.newBuilder() to construct. + private ConfusionMatrix(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfusionMatrix() { + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + row_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfusionMatrix( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + annotationSpecId_.add(s); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + row_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + row_.add( + input.readMessage(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.parser(), extensionRegistry)); + 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) == 0x00000001)) { + annotationSpecId_ = annotationSpecId_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + row_ = java.util.Collections.unmodifiableList(row_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Builder.class); + } + + public interface RowOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + com.google.protobuf.MessageOrBuilder { + + /** + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row is equal to the size of
+         * annotatin_spec_id.
+         * 
+ * + * repeated int32 example_count = 1; + */ + java.util.List getExampleCountList(); + /** + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row is equal to the size of
+         * annotatin_spec_id.
+         * 
+ * + * repeated int32 example_count = 1; + */ + int getExampleCountCount(); + /** + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row is equal to the size of
+         * annotatin_spec_id.
+         * 
+ * + * repeated int32 example_count = 1; + */ + int getExampleCount(int index); + } + /** + *
+       * Output only. A row in the confusion matrix.
+       * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} + */ + public static final class Row extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + RowOrBuilder { + private static final long serialVersionUID = 0L; + // Use Row.newBuilder() to construct. + private Row(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Row() { + exampleCount_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Row( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + exampleCount_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + exampleCount_.add(input.readInt32()); + break; + } + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) { + exampleCount_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + exampleCount_.add(input.readInt32()); + } + input.popLimit(limit); + 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) == 0x00000001)) { + exampleCount_ = java.util.Collections.unmodifiableList(exampleCount_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder.class); + } + + public static final int EXAMPLE_COUNT_FIELD_NUMBER = 1; + private java.util.List exampleCount_; + /** + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row is equal to the size of
+         * annotatin_spec_id.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public java.util.List + getExampleCountList() { + return exampleCount_; + } + /** + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row is equal to the size of
+         * annotatin_spec_id.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public int getExampleCountCount() { + return exampleCount_.size(); + } + /** + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row is equal to the size of
+         * annotatin_spec_id.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public int getExampleCount(int index) { + return exampleCount_.get(index); + } + private int exampleCountMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getExampleCountList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(exampleCountMemoizedSerializedSize); + } + for (int i = 0; i < exampleCount_.size(); i++) { + output.writeInt32NoTag(exampleCount_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < exampleCount_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(exampleCount_.get(i)); + } + size += dataSize; + if (!getExampleCountList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + exampleCountMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row other = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row) obj; + + boolean result = true; + result = result && getExampleCountList() + .equals(other.getExampleCountList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExampleCountCount() > 0) { + hash = (37 * hash) + EXAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getExampleCountList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+         * Output only. A row in the confusion matrix.
+         * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + exampleCount_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row build() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row buildPartial() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row result = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + exampleCount_ = java.util.Collections.unmodifiableList(exampleCount_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.exampleCount_ = exampleCount_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row) { + return mergeFrom((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row other) { + if (other == com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.getDefaultInstance()) return this; + if (!other.exampleCount_.isEmpty()) { + if (exampleCount_.isEmpty()) { + exampleCount_ = other.exampleCount_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExampleCountIsMutable(); + exampleCount_.addAll(other.exampleCount_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List exampleCount_ = java.util.Collections.emptyList(); + private void ensureExampleCountIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + exampleCount_ = new java.util.ArrayList(exampleCount_); + bitField0_ |= 0x00000001; + } + } + /** + *
+           * Output only. Value of the specific cell in the confusion matrix.
+           * The number of values each row is equal to the size of
+           * annotatin_spec_id.
+           * 
+ * + * repeated int32 example_count = 1; + */ + public java.util.List + getExampleCountList() { + return java.util.Collections.unmodifiableList(exampleCount_); + } + /** + *
+           * Output only. Value of the specific cell in the confusion matrix.
+           * The number of values each row is equal to the size of
+           * annotatin_spec_id.
+           * 
+ * + * repeated int32 example_count = 1; + */ + public int getExampleCountCount() { + return exampleCount_.size(); + } + /** + *
+           * Output only. Value of the specific cell in the confusion matrix.
+           * The number of values each row is equal to the size of
+           * annotatin_spec_id.
+           * 
+ * + * repeated int32 example_count = 1; + */ + public int getExampleCount(int index) { + return exampleCount_.get(index); + } + /** + *
+           * Output only. Value of the specific cell in the confusion matrix.
+           * The number of values each row is equal to the size of
+           * annotatin_spec_id.
+           * 
+ * + * repeated int32 example_count = 1; + */ + public Builder setExampleCount( + int index, int value) { + ensureExampleCountIsMutable(); + exampleCount_.set(index, value); + onChanged(); + return this; + } + /** + *
+           * Output only. Value of the specific cell in the confusion matrix.
+           * The number of values each row is equal to the size of
+           * annotatin_spec_id.
+           * 
+ * + * repeated int32 example_count = 1; + */ + public Builder addExampleCount(int value) { + ensureExampleCountIsMutable(); + exampleCount_.add(value); + onChanged(); + return this; + } + /** + *
+           * Output only. Value of the specific cell in the confusion matrix.
+           * The number of values each row is equal to the size of
+           * annotatin_spec_id.
+           * 
+ * + * repeated int32 example_count = 1; + */ + public Builder addAllExampleCount( + java.lang.Iterable values) { + ensureExampleCountIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, exampleCount_); + onChanged(); + return this; + } + /** + *
+           * Output only. Value of the specific cell in the confusion matrix.
+           * The number of values each row is equal to the size of
+           * annotatin_spec_id.
+           * 
+ * + * repeated int32 example_count = 1; + */ + public Builder clearExampleCount() { + exampleCount_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + private static final com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Row parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Row(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList annotationSpecId_; + /** + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public com.google.protobuf.ProtocolStringList + getAnnotationSpecIdList() { + return annotationSpecId_; + } + /** + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public int getAnnotationSpecIdCount() { + return annotationSpecId_.size(); + } + /** + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public java.lang.String getAnnotationSpecId(int index) { + return annotationSpecId_.get(index); + } + /** + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public com.google.protobuf.ByteString + getAnnotationSpecIdBytes(int index) { + return annotationSpecId_.getByteString(index); + } + + public static final int ROW_FIELD_NUMBER = 2; + private java.util.List row_; + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public java.util.List getRowList() { + return row_; + } + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public java.util.List + getRowOrBuilderList() { + return row_; + } + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public int getRowCount() { + return row_.size(); + } + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow(int index) { + return row_.get(index); + } + /** + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].value[j]` is the number of examples that have ground truth of the
+       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+       * the model being evaluated.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder getRowOrBuilder( + int index) { + return row_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < annotationSpecId_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, annotationSpecId_.getRaw(i)); + } + for (int i = 0; i < row_.size(); i++) { + output.writeMessage(2, row_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < annotationSpecId_.size(); i++) { + dataSize += computeStringSizeNoTag(annotationSpecId_.getRaw(i)); + } + size += dataSize; + size += 1 * getAnnotationSpecIdList().size(); + } + for (int i = 0; i < row_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, row_.get(i)); + } + 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.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix other = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix) obj; + + boolean result = true; + result = result && getAnnotationSpecIdList() + .equals(other.getAnnotationSpecIdList()); + result = result && getRowList() + .equals(other.getRowList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAnnotationSpecIdCount() > 0) { + hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationSpecIdList().hashCode(); + } + if (getRowCount() > 0) { + hash = (37 * hash) + ROW_FIELD_NUMBER; + hash = (53 * hash) + getRowList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+       * Confusion matrix of the model running the classification.
+       * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix) + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getRowFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (rowBuilder_ == null) { + row_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + rowBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix build() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix buildPartial() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix result = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + annotationSpecId_ = annotationSpecId_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.annotationSpecId_ = annotationSpecId_; + if (rowBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + row_ = java.util.Collections.unmodifiableList(row_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.row_ = row_; + } else { + result.row_ = rowBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix) { + return mergeFrom((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix other) { + if (other == com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.getDefaultInstance()) return this; + if (!other.annotationSpecId_.isEmpty()) { + if (annotationSpecId_.isEmpty()) { + annotationSpecId_ = other.annotationSpecId_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.addAll(other.annotationSpecId_); + } + onChanged(); + } + if (rowBuilder_ == null) { + if (!other.row_.isEmpty()) { + if (row_.isEmpty()) { + row_ = other.row_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRowIsMutable(); + row_.addAll(other.row_); + } + onChanged(); + } + } else { + if (!other.row_.isEmpty()) { + if (rowBuilder_.isEmpty()) { + rowBuilder_.dispose(); + rowBuilder_ = null; + row_ = other.row_; + bitField0_ = (bitField0_ & ~0x00000002); + rowBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRowFieldBuilder() : null; + } else { + rowBuilder_.addAllMessages(other.row_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureAnnotationSpecIdIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(annotationSpecId_); + bitField0_ |= 0x00000001; + } + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public com.google.protobuf.ProtocolStringList + getAnnotationSpecIdList() { + return annotationSpecId_.getUnmodifiableView(); + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public int getAnnotationSpecIdCount() { + return annotationSpecId_.size(); + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public java.lang.String getAnnotationSpecId(int index) { + return annotationSpecId_.get(index); + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public com.google.protobuf.ByteString + getAnnotationSpecIdBytes(int index) { + return annotationSpecId_.getByteString(index); + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder setAnnotationSpecId( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.set(index, value); + onChanged(); + return this; + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder addAnnotationSpecId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.add(value); + onChanged(); + return this; + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder addAllAnnotationSpecId( + java.lang.Iterable values) { + ensureAnnotationSpecIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, annotationSpecId_); + onChanged(); + return this; + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder clearAnnotationSpecId() { + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+         * Output only. IDs of the annotation specs used in the confusion matrix.
+         * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder addAnnotationSpecIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.add(value); + onChanged(); + return this; + } + + private java.util.List row_ = + java.util.Collections.emptyList(); + private void ensureRowIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + row_ = new java.util.ArrayList(row_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder> rowBuilder_; + + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public java.util.List getRowList() { + if (rowBuilder_ == null) { + return java.util.Collections.unmodifiableList(row_); + } else { + return rowBuilder_.getMessageList(); + } + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public int getRowCount() { + if (rowBuilder_ == null) { + return row_.size(); + } else { + return rowBuilder_.getCount(); + } + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow(int index) { + if (rowBuilder_ == null) { + return row_.get(index); + } else { + return rowBuilder_.getMessage(index); + } + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder setRow( + int index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowIsMutable(); + row_.set(index, value); + onChanged(); + } else { + rowBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder setRow( + int index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder builderForValue) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + row_.set(index, builderForValue.build()); + onChanged(); + } else { + rowBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder addRow(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowIsMutable(); + row_.add(value); + onChanged(); + } else { + rowBuilder_.addMessage(value); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder addRow( + int index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowIsMutable(); + row_.add(index, value); + onChanged(); + } else { + rowBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder addRow( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder builderForValue) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + row_.add(builderForValue.build()); + onChanged(); + } else { + rowBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder addRow( + int index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder builderForValue) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + row_.add(index, builderForValue.build()); + onChanged(); + } else { + rowBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder addAllRow( + java.lang.Iterable values) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, row_); + onChanged(); + } else { + rowBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder clearRow() { + if (rowBuilder_ == null) { + row_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rowBuilder_.clear(); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public Builder removeRow(int index) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + row_.remove(index); + onChanged(); + } else { + rowBuilder_.remove(index); + } + return this; + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder getRowBuilder( + int index) { + return getRowFieldBuilder().getBuilder(index); + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder getRowOrBuilder( + int index) { + if (rowBuilder_ == null) { + return row_.get(index); } else { + return rowBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public java.util.List + getRowOrBuilderList() { + if (rowBuilder_ != null) { + return rowBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(row_); + } + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder addRowBuilder() { + return getRowFieldBuilder().addBuilder( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.getDefaultInstance()); + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder addRowBuilder( + int index) { + return getRowFieldBuilder().addBuilder( + index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.getDefaultInstance()); + } + /** + *
+         * Output only. Rows in the confusion matrix. The number of rows is equal to
+         * the size of `annotation_spec_id`.
+         * `row[i].value[j]` is the number of examples that have ground truth of the
+         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
+         * the model being evaluated.
+         * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + public java.util.List + getRowBuilderList() { + return getRowFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder> + getRowFieldBuilder() { + if (rowBuilder_ == null) { + rowBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder>( + row_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + row_ = null; + } + return rowBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix) + private static final com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix(); + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ConfusionMatrix parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfusionMatrix(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int AU_PRC_FIELD_NUMBER = 1; + private float auPrc_; + /** + *
+     * Output only. The Area under precision recall curve metric.
+     * 
+ * + * float au_prc = 1; + */ + public float getAuPrc() { + return auPrc_; + } + + public static final int BASE_AU_PRC_FIELD_NUMBER = 2; + private float baseAuPrc_; + /** + *
+     * Output only. The Area under precision recall curve metric based on priors.
+     * 
+ * + * float base_au_prc = 2; + */ + public float getBaseAuPrc() { + return baseAuPrc_; + } + + public static final int CONFIDENCE_METRICS_ENTRY_FIELD_NUMBER = 3; + private java.util.List confidenceMetricsEntry_; + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public java.util.List getConfidenceMetricsEntryList() { + return confidenceMetricsEntry_; + } + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public java.util.List + getConfidenceMetricsEntryOrBuilderList() { + return confidenceMetricsEntry_; + } + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public int getConfidenceMetricsEntryCount() { + return confidenceMetricsEntry_.size(); + } + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry getConfidenceMetricsEntry(int index) { + return confidenceMetricsEntry_.get(index); + } + /** + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder getConfidenceMetricsEntryOrBuilder( + int index) { + return confidenceMetricsEntry_.get(index); + } + + public static final int CONFUSION_MATRIX_FIELD_NUMBER = 4; + private com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix confusionMatrix_; + /** + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public boolean hasConfusionMatrix() { + return confusionMatrix_ != null; + } + /** + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix getConfusionMatrix() { + return confusionMatrix_ == null ? com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.getDefaultInstance() : confusionMatrix_; + } + /** + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder getConfusionMatrixOrBuilder() { + return getConfusionMatrix(); + } + + public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList annotationSpecId_; + /** + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public com.google.protobuf.ProtocolStringList + getAnnotationSpecIdList() { + return annotationSpecId_; + } + /** + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public int getAnnotationSpecIdCount() { + return annotationSpecId_.size(); + } + /** + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public java.lang.String getAnnotationSpecId(int index) { + return annotationSpecId_.get(index); + } + /** + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public com.google.protobuf.ByteString + getAnnotationSpecIdBytes(int index) { + return annotationSpecId_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (auPrc_ != 0F) { + output.writeFloat(1, auPrc_); + } + if (baseAuPrc_ != 0F) { + output.writeFloat(2, baseAuPrc_); + } + for (int i = 0; i < confidenceMetricsEntry_.size(); i++) { + output.writeMessage(3, confidenceMetricsEntry_.get(i)); + } + if (confusionMatrix_ != null) { + output.writeMessage(4, getConfusionMatrix()); + } + for (int i = 0; i < annotationSpecId_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, annotationSpecId_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (auPrc_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, auPrc_); + } + if (baseAuPrc_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, baseAuPrc_); + } + for (int i = 0; i < confidenceMetricsEntry_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, confidenceMetricsEntry_.get(i)); + } + if (confusionMatrix_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getConfusionMatrix()); + } + { + int dataSize = 0; + for (int i = 0; i < annotationSpecId_.size(); i++) { + dataSize += computeStringSizeNoTag(annotationSpecId_.getRaw(i)); + } + size += dataSize; + size += 1 * getAnnotationSpecIdList().size(); + } + 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.v1beta1.ClassificationProto.ClassificationEvaluationMetrics)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics other = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) obj; + + boolean result = true; + result = result && ( + java.lang.Float.floatToIntBits(getAuPrc()) + == java.lang.Float.floatToIntBits( + other.getAuPrc())); + result = result && ( + java.lang.Float.floatToIntBits(getBaseAuPrc()) + == java.lang.Float.floatToIntBits( + other.getBaseAuPrc())); + result = result && getConfidenceMetricsEntryList() + .equals(other.getConfidenceMetricsEntryList()); + result = result && (hasConfusionMatrix() == other.hasConfusionMatrix()); + if (hasConfusionMatrix()) { + result = result && getConfusionMatrix() + .equals(other.getConfusionMatrix()); + } + result = result && getAnnotationSpecIdList() + .equals(other.getAnnotationSpecIdList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AU_PRC_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getAuPrc()); + hash = (37 * hash) + BASE_AU_PRC_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBaseAuPrc()); + if (getConfidenceMetricsEntryCount() > 0) { + hash = (37 * hash) + CONFIDENCE_METRICS_ENTRY_FIELD_NUMBER; + hash = (53 * hash) + getConfidenceMetricsEntryList().hashCode(); + } + if (hasConfusionMatrix()) { + hash = (37 * hash) + CONFUSION_MATRIX_FIELD_NUMBER; + hash = (53 * hash) + getConfusionMatrix().hashCode(); + } + if (getAnnotationSpecIdCount() > 0) { + hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationSpecIdList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Model evaluation metrics for classification problems.
+     * Visible only to v1beta1
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics) + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.class, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getConfidenceMetricsEntryFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + auPrc_ = 0F; + + baseAuPrc_ = 0F; + + if (confidenceMetricsEntryBuilder_ == null) { + confidenceMetricsEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + confidenceMetricsEntryBuilder_.clear(); + } + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = null; + } else { + confusionMatrix_ = null; + confusionMatrixBuilder_ = null; + } + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_descriptor; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics build() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics buildPartial() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics result = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.auPrc_ = auPrc_; + result.baseAuPrc_ = baseAuPrc_; + if (confidenceMetricsEntryBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + confidenceMetricsEntry_ = java.util.Collections.unmodifiableList(confidenceMetricsEntry_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.confidenceMetricsEntry_ = confidenceMetricsEntry_; + } else { + result.confidenceMetricsEntry_ = confidenceMetricsEntryBuilder_.build(); + } + if (confusionMatrixBuilder_ == null) { + result.confusionMatrix_ = confusionMatrix_; + } else { + result.confusionMatrix_ = confusionMatrixBuilder_.build(); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + annotationSpecId_ = annotationSpecId_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.annotationSpecId_ = annotationSpecId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) { + return mergeFrom((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics other) { + if (other == com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance()) return this; + if (other.getAuPrc() != 0F) { + setAuPrc(other.getAuPrc()); + } + if (other.getBaseAuPrc() != 0F) { + setBaseAuPrc(other.getBaseAuPrc()); + } + if (confidenceMetricsEntryBuilder_ == null) { + if (!other.confidenceMetricsEntry_.isEmpty()) { + if (confidenceMetricsEntry_.isEmpty()) { + confidenceMetricsEntry_ = other.confidenceMetricsEntry_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.addAll(other.confidenceMetricsEntry_); + } + onChanged(); + } + } else { + if (!other.confidenceMetricsEntry_.isEmpty()) { + if (confidenceMetricsEntryBuilder_.isEmpty()) { + confidenceMetricsEntryBuilder_.dispose(); + confidenceMetricsEntryBuilder_ = null; + confidenceMetricsEntry_ = other.confidenceMetricsEntry_; + bitField0_ = (bitField0_ & ~0x00000004); + confidenceMetricsEntryBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getConfidenceMetricsEntryFieldBuilder() : null; + } else { + confidenceMetricsEntryBuilder_.addAllMessages(other.confidenceMetricsEntry_); + } + } + } + if (other.hasConfusionMatrix()) { + mergeConfusionMatrix(other.getConfusionMatrix()); + } + if (!other.annotationSpecId_.isEmpty()) { + if (annotationSpecId_.isEmpty()) { + annotationSpecId_ = other.annotationSpecId_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.addAll(other.annotationSpecId_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private float auPrc_ ; + /** + *
+       * Output only. The Area under precision recall curve metric.
+       * 
+ * + * float au_prc = 1; + */ + public float getAuPrc() { + return auPrc_; + } + /** + *
+       * Output only. The Area under precision recall curve metric.
+       * 
+ * + * float au_prc = 1; + */ + public Builder setAuPrc(float value) { + + auPrc_ = value; + onChanged(); + return this; + } + /** + *
+       * Output only. The Area under precision recall curve metric.
+       * 
+ * + * float au_prc = 1; + */ + public Builder clearAuPrc() { + + auPrc_ = 0F; + onChanged(); + return this; + } + + private float baseAuPrc_ ; + /** + *
+       * Output only. The Area under precision recall curve metric based on priors.
+       * 
+ * + * float base_au_prc = 2; + */ + public float getBaseAuPrc() { + return baseAuPrc_; + } + /** + *
+       * Output only. The Area under precision recall curve metric based on priors.
+       * 
+ * + * float base_au_prc = 2; + */ + public Builder setBaseAuPrc(float value) { + + baseAuPrc_ = value; + onChanged(); + return this; + } + /** + *
+       * Output only. The Area under precision recall curve metric based on priors.
+       * 
+ * + * float base_au_prc = 2; + */ + public Builder clearBaseAuPrc() { + + baseAuPrc_ = 0F; + onChanged(); + return this; + } + + private java.util.List confidenceMetricsEntry_ = + java.util.Collections.emptyList(); + private void ensureConfidenceMetricsEntryIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + confidenceMetricsEntry_ = new java.util.ArrayList(confidenceMetricsEntry_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder> confidenceMetricsEntryBuilder_; + + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public java.util.List getConfidenceMetricsEntryList() { + if (confidenceMetricsEntryBuilder_ == null) { + return java.util.Collections.unmodifiableList(confidenceMetricsEntry_); + } else { + return confidenceMetricsEntryBuilder_.getMessageList(); + } + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public int getConfidenceMetricsEntryCount() { + if (confidenceMetricsEntryBuilder_ == null) { + return confidenceMetricsEntry_.size(); + } else { + return confidenceMetricsEntryBuilder_.getCount(); + } + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry getConfidenceMetricsEntry(int index) { + if (confidenceMetricsEntryBuilder_ == null) { + return confidenceMetricsEntry_.get(index); + } else { + return confidenceMetricsEntryBuilder_.getMessage(index); + } + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder setConfidenceMetricsEntry( + int index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.set(index, value); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder setConfidenceMetricsEntry( + int index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder builderForValue) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.set(index, builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder addConfidenceMetricsEntry(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.add(value); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder addConfidenceMetricsEntry( + int index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.add(index, value); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder addConfidenceMetricsEntry( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder builderForValue) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.add(builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder addConfidenceMetricsEntry( + int index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder builderForValue) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.add(index, builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder addAllConfidenceMetricsEntry( + java.lang.Iterable values) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, confidenceMetricsEntry_); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder clearConfidenceMetricsEntry() { + if (confidenceMetricsEntryBuilder_ == null) { + confidenceMetricsEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.clear(); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public Builder removeConfidenceMetricsEntry(int index) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.remove(index); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.remove(index); + } + return this; + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder getConfidenceMetricsEntryBuilder( + int index) { + return getConfidenceMetricsEntryFieldBuilder().getBuilder(index); + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder getConfidenceMetricsEntryOrBuilder( + int index) { + if (confidenceMetricsEntryBuilder_ == null) { + return confidenceMetricsEntry_.get(index); } else { + return confidenceMetricsEntryBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public java.util.List + getConfidenceMetricsEntryOrBuilderList() { + if (confidenceMetricsEntryBuilder_ != null) { + return confidenceMetricsEntryBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(confidenceMetricsEntry_); + } + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder addConfidenceMetricsEntryBuilder() { + return getConfidenceMetricsEntryFieldBuilder().addBuilder( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.getDefaultInstance()); + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder addConfidenceMetricsEntryBuilder( + int index) { + return getConfidenceMetricsEntryFieldBuilder().addBuilder( + index, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.getDefaultInstance()); + } + /** + *
+       * Output only. Metrics that have confidence thresholds.
+       * Precision-recall curve can be derived from it.
+       * 
+ * + * repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + public java.util.List + getConfidenceMetricsEntryBuilderList() { + return getConfidenceMetricsEntryFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntryFieldBuilder() { + if (confidenceMetricsEntryBuilder_ == null) { + confidenceMetricsEntryBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder>( + confidenceMetricsEntry_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + confidenceMetricsEntry_ = null; + } + return confidenceMetricsEntryBuilder_; + } + + private com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix confusionMatrix_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder> confusionMatrixBuilder_; + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public boolean hasConfusionMatrix() { + return confusionMatrixBuilder_ != null || confusionMatrix_ != null; + } + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix getConfusionMatrix() { + if (confusionMatrixBuilder_ == null) { + return confusionMatrix_ == null ? com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.getDefaultInstance() : confusionMatrix_; + } else { + return confusionMatrixBuilder_.getMessage(); + } + } + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public Builder setConfusionMatrix(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix value) { + if (confusionMatrixBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + confusionMatrix_ = value; + onChanged(); + } else { + confusionMatrixBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public Builder setConfusionMatrix( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Builder builderForValue) { + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = builderForValue.build(); + onChanged(); + } else { + confusionMatrixBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public Builder mergeConfusionMatrix(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix value) { + if (confusionMatrixBuilder_ == null) { + if (confusionMatrix_ != null) { + confusionMatrix_ = + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.newBuilder(confusionMatrix_).mergeFrom(value).buildPartial(); + } else { + confusionMatrix_ = value; + } + onChanged(); + } else { + confusionMatrixBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public Builder clearConfusionMatrix() { + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = null; + onChanged(); + } else { + confusionMatrix_ = null; + confusionMatrixBuilder_ = null; + } + + return this; + } + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Builder getConfusionMatrixBuilder() { + + onChanged(); + return getConfusionMatrixFieldBuilder().getBuilder(); + } + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder getConfusionMatrixOrBuilder() { + if (confusionMatrixBuilder_ != null) { + return confusionMatrixBuilder_.getMessageOrBuilder(); + } else { + return confusionMatrix_ == null ? + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.getDefaultInstance() : confusionMatrix_; + } + } + /** + *
+       * Output only. Confusion matrix of the evaluation.
+       * Only set for MULTICLASS classification problems where number
+       * of labels is no more than 10.
+       * Only set for model level evaluation, not for evaluation per label.
+       * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder> + getConfusionMatrixFieldBuilder() { + if (confusionMatrixBuilder_ == null) { + confusionMatrixBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder>( + getConfusionMatrix(), + getParentForChildren(), + isClean()); + confusionMatrix_ = null; + } + return confusionMatrixBuilder_; + } + + private com.google.protobuf.LazyStringList annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureAnnotationSpecIdIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(annotationSpecId_); + bitField0_ |= 0x00000010; + } + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public com.google.protobuf.ProtocolStringList + getAnnotationSpecIdList() { + return annotationSpecId_.getUnmodifiableView(); + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public int getAnnotationSpecIdCount() { + return annotationSpecId_.size(); + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public java.lang.String getAnnotationSpecId(int index) { + return annotationSpecId_.get(index); + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public com.google.protobuf.ByteString + getAnnotationSpecIdBytes(int index) { + return annotationSpecId_.getByteString(index); + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder setAnnotationSpecId( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder addAnnotationSpecId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.add(value); + onChanged(); + return this; + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder addAllAnnotationSpecId( + java.lang.Iterable values) { + ensureAnnotationSpecIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, annotationSpecId_); + onChanged(); + return this; + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder clearAnnotationSpecId() { + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
+       * Output only. The annotation spec ids used for this evaluation.
+       * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder addAnnotationSpecIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.add(value); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics) + private static final com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics(); + } + + public static com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ClassificationEvaluationMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassificationEvaluationMetrics(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/automl/v1beta1/classifica" + + "tion.proto\022\033google.cloud.automl.v1beta1\032" + + "\034google/api/annotations.proto\")\n\030Classif" + + "icationAnnotation\022\r\n\005score\030\001 \001(\002\"\235\005\n\037Cla" + + "ssificationEvaluationMetrics\022\016\n\006au_prc\030\001" + + " \001(\002\022\023\n\013base_au_prc\030\002 \001(\002\022u\n\030confidence_" + + "metrics_entry\030\003 \003(\0132S.google.cloud.autom" + + "l.v1beta1.ClassificationEvaluationMetric" + + "s.ConfidenceMetricsEntry\022f\n\020confusion_ma" + + "trix\030\004 \001(\0132L.google.cloud.automl.v1beta1" + + ".ClassificationEvaluationMetrics.Confusi" + + "onMatrix\022\032\n\022annotation_spec_id\030\005 \003(\t\032\254\001\n" + + "\026ConfidenceMetricsEntry\022\034\n\024confidence_th" + + "reshold\030\001 \001(\002\022\016\n\006recall\030\002 \001(\002\022\021\n\tprecisi" + + "on\030\003 \001(\002\022\020\n\010f1_score\030\004 \001(\002\022\022\n\nrecall_at1" + + "\030\005 \001(\002\022\025\n\rprecision_at1\030\006 \001(\002\022\024\n\014f1_scor" + + "e_at1\030\007 \001(\002\032\252\001\n\017ConfusionMatrix\022\032\n\022annot" + + "ation_spec_id\030\001 \003(\t\022]\n\003row\030\002 \003(\0132P.googl" + + "e.cloud.automl.v1beta1.ClassificationEva" + + "luationMetrics.ConfusionMatrix.Row\032\034\n\003Ro" + + "w\022\025\n\rexample_count\030\001 \003(\005*Y\n\022Classificati" + + "onType\022#\n\037CLASSIFICATION_TYPE_UNSPECIFIE" + + "D\020\000\022\016\n\nMULTICLASS\020\001\022\016\n\nMULTILABEL\020\002By\n\037c" + + "om.google.cloud.automl.v1beta1B\023Classifi" + + "cationProtoZAgoogle.golang.org/genproto/" + + "googleapis/cloud/automl/v1beta1;automlb\006" + + "proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_descriptor, + new java.lang.String[] { "Score", }); + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_descriptor, + new java.lang.String[] { "AuPrc", "BaseAuPrc", "ConfidenceMetricsEntry", "ConfusionMatrix", "AnnotationSpecId", }); + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor = + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor, + new java.lang.String[] { "ConfidenceThreshold", "Recall", "Precision", "F1Score", "RecallAt1", "PrecisionAt1", "F1ScoreAt1", }); + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor = + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor, + new java.lang.String[] { "AnnotationSpecId", "Row", }); + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor = + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor, + new java.lang.String[] { "ExampleCount", }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateDatasetRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateDatasetRequest.java new file mode 100644 index 000000000000..ccfe1fcbbeed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateDatasetRequest.java @@ -0,0 +1,781 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.CreateDataset][google.cloud.automl.v1beta1.AutoMl.CreateDataset].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.CreateDatasetRequest} + */ +public final class CreateDatasetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.cloud.automl.v1beta1.Dataset.Builder subBuilder = null; + if (dataset_ != null) { + subBuilder = dataset_.toBuilder(); + } + dataset_ = input.readMessage(com.google.cloud.automl.v1beta1.Dataset.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dataset_); + dataset_ = subBuilder.buildPartial(); + } + + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.CreateDatasetRequest.class, com.google.cloud.automl.v1beta1.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.v1beta1.Dataset dataset_; + /** + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + public boolean hasDataset() { + return dataset_ != null; + } + /** + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1beta1.Dataset getDataset() { + return dataset_ == null ? com.google.cloud.automl.v1beta1.Dataset.getDefaultInstance() : dataset_; + } + /** + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1beta1.DatasetOrBuilder getDatasetOrBuilder() { + return getDataset(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.CreateDatasetRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.CreateDatasetRequest other = (com.google.cloud.automl.v1beta1.CreateDatasetRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasDataset() == other.hasDataset()); + if (hasDataset()) { + result = result && getDataset() + .equals(other.getDataset()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.CreateDatasetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateDatasetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateDatasetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateDatasetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.CreateDatasetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.CreateDataset].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.CreateDatasetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.CreateDatasetRequest) + com.google.cloud.automl.v1beta1.CreateDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.CreateDatasetRequest.class, com.google.cloud.automl.v1beta1.CreateDatasetRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (datasetBuilder_ == null) { + dataset_ = null; + } else { + dataset_ = null; + datasetBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateDatasetRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.CreateDatasetRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.CreateDatasetRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.CreateDatasetRequest build() { + com.google.cloud.automl.v1beta1.CreateDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.CreateDatasetRequest buildPartial() { + com.google.cloud.automl.v1beta1.CreateDatasetRequest result = new com.google.cloud.automl.v1beta1.CreateDatasetRequest(this); + result.parent_ = parent_; + if (datasetBuilder_ == null) { + result.dataset_ = dataset_; + } else { + result.dataset_ = datasetBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.CreateDatasetRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.CreateDatasetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.CreateDatasetRequest other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.CreateDatasetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.Dataset dataset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.Dataset, com.google.cloud.automl.v1beta1.Dataset.Builder, com.google.cloud.automl.v1beta1.DatasetOrBuilder> datasetBuilder_; + /** + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + public boolean hasDataset() { + return datasetBuilder_ != null || dataset_ != null; + } + /** + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1beta1.Dataset getDataset() { + if (datasetBuilder_ == null) { + return dataset_ == null ? com.google.cloud.automl.v1beta1.Dataset.getDefaultInstance() : dataset_; + } else { + return datasetBuilder_.getMessage(); + } + } + /** + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + public Builder setDataset(com.google.cloud.automl.v1beta1.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.v1beta1.Dataset dataset = 2; + */ + public Builder setDataset( + com.google.cloud.automl.v1beta1.Dataset.Builder builderForValue) { + if (datasetBuilder_ == null) { + dataset_ = builderForValue.build(); + onChanged(); + } else { + datasetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + public Builder mergeDataset(com.google.cloud.automl.v1beta1.Dataset value) { + if (datasetBuilder_ == null) { + if (dataset_ != null) { + dataset_ = + com.google.cloud.automl.v1beta1.Dataset.newBuilder(dataset_).mergeFrom(value).buildPartial(); + } else { + dataset_ = value; + } + onChanged(); + } else { + datasetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.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.v1beta1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1beta1.Dataset.Builder getDatasetBuilder() { + + onChanged(); + return getDatasetFieldBuilder().getBuilder(); + } + /** + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + public com.google.cloud.automl.v1beta1.DatasetOrBuilder getDatasetOrBuilder() { + if (datasetBuilder_ != null) { + return datasetBuilder_.getMessageOrBuilder(); + } else { + return dataset_ == null ? + com.google.cloud.automl.v1beta1.Dataset.getDefaultInstance() : dataset_; + } + } + /** + *
+     * The dataset to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.Dataset, com.google.cloud.automl.v1beta1.Dataset.Builder, com.google.cloud.automl.v1beta1.DatasetOrBuilder> + getDatasetFieldBuilder() { + if (datasetBuilder_ == null) { + datasetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.Dataset, com.google.cloud.automl.v1beta1.Dataset.Builder, com.google.cloud.automl.v1beta1.DatasetOrBuilder>( + getDataset(), + getParentForChildren(), + isClean()); + dataset_ = null; + } + return datasetBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.CreateDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CreateDatasetRequest) + private static final com.google.cloud.automl.v1beta1.CreateDatasetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.CreateDatasetRequest(); + } + + public static com.google.cloud.automl.v1beta1.CreateDatasetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.CreateDatasetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateDatasetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateDatasetRequestOrBuilder.java new file mode 100644 index 000000000000..6c513801f128 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateDatasetRequestOrBuilder.java @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface CreateDatasetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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.v1beta1.Dataset dataset = 2; + */ + boolean hasDataset(); + /** + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + com.google.cloud.automl.v1beta1.Dataset getDataset(); + /** + *
+   * The dataset to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Dataset dataset = 2; + */ + com.google.cloud.automl.v1beta1.DatasetOrBuilder getDatasetOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelOperationMetadata.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelOperationMetadata.java new file mode 100644 index 000000000000..3e45d69fac71 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelOperationMetadata.java @@ -0,0 +1,396 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/operations.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Details of CreateModel operation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.CreateModelOperationMetadata} + */ +public final class CreateModelOperationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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 (!parseUnknownFieldProto3( + 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.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.class, com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + unknownFields.writeTo(output); + } + + 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.v1beta1.CreateModelOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata other = (com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) obj; + + boolean result = true; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.CreateModelOperationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelOperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelOperationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.CreateModelOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.CreateModelOperationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.CreateModelOperationMetadata) + com.google.cloud.automl.v1beta1.CreateModelOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.class, com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_descriptor; + } + + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadata build() { + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadata buildPartial() { + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata result = new com.google.cloud.automl.v1beta1.CreateModelOperationMetadata(this); + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1beta1.CreateModelOperationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.CreateModelOperationMetadata other) { + if (other == com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.CreateModelOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CreateModelOperationMetadata) + private static final com.google.cloud.automl.v1beta1.CreateModelOperationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.CreateModelOperationMetadata(); + } + + public static com.google.cloud.automl.v1beta1.CreateModelOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelOperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..e47039a43d5d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelOperationMetadataOrBuilder.java @@ -0,0 +1,9 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/operations.proto + +package com.google.cloud.automl.v1beta1; + +public interface CreateModelOperationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.CreateModelOperationMetadata) + com.google.protobuf.MessageOrBuilder { +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelRequest.java new file mode 100644 index 000000000000..c76880c50f00 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelRequest.java @@ -0,0 +1,781 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.CreateModel][google.cloud.automl.v1beta1.AutoMl.CreateModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.CreateModelRequest} + */ +public final class CreateModelRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 34: { + com.google.cloud.automl.v1beta1.Model.Builder subBuilder = null; + if (model_ != null) { + subBuilder = model_.toBuilder(); + } + model_ = input.readMessage(com.google.cloud.automl.v1beta1.Model.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(model_); + model_ = subBuilder.buildPartial(); + } + + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.CreateModelRequest.class, com.google.cloud.automl.v1beta1.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.v1beta1.Model model_; + /** + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + public boolean hasModel() { + return model_ != null; + } + /** + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + public com.google.cloud.automl.v1beta1.Model getModel() { + return model_ == null ? com.google.cloud.automl.v1beta1.Model.getDefaultInstance() : model_; + } + /** + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + public com.google.cloud.automl.v1beta1.ModelOrBuilder getModelOrBuilder() { + return getModel(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.CreateModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.CreateModelRequest other = (com.google.cloud.automl.v1beta1.CreateModelRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasModel() == other.hasModel()); + if (hasModel()) { + result = result && getModel() + .equals(other.getModel()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.CreateModelRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.CreateModelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.CreateModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.CreateModelRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.CreateModelRequest) + com.google.cloud.automl.v1beta1.CreateModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.CreateModelRequest.class, com.google.cloud.automl.v1beta1.CreateModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (modelBuilder_ == null) { + model_ = null; + } else { + model_ = null; + modelBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_CreateModelRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.CreateModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.CreateModelRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.CreateModelRequest build() { + com.google.cloud.automl.v1beta1.CreateModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.CreateModelRequest buildPartial() { + com.google.cloud.automl.v1beta1.CreateModelRequest result = new com.google.cloud.automl.v1beta1.CreateModelRequest(this); + result.parent_ = parent_; + if (modelBuilder_ == null) { + result.model_ = model_; + } else { + result.model_ = modelBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.CreateModelRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.CreateModelRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.CreateModelRequest other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.CreateModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.Model model_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.Model, com.google.cloud.automl.v1beta1.Model.Builder, com.google.cloud.automl.v1beta1.ModelOrBuilder> modelBuilder_; + /** + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + public boolean hasModel() { + return modelBuilder_ != null || model_ != null; + } + /** + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + public com.google.cloud.automl.v1beta1.Model getModel() { + if (modelBuilder_ == null) { + return model_ == null ? com.google.cloud.automl.v1beta1.Model.getDefaultInstance() : model_; + } else { + return modelBuilder_.getMessage(); + } + } + /** + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + public Builder setModel(com.google.cloud.automl.v1beta1.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.v1beta1.Model model = 4; + */ + public Builder setModel( + com.google.cloud.automl.v1beta1.Model.Builder builderForValue) { + if (modelBuilder_ == null) { + model_ = builderForValue.build(); + onChanged(); + } else { + modelBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + public Builder mergeModel(com.google.cloud.automl.v1beta1.Model value) { + if (modelBuilder_ == null) { + if (model_ != null) { + model_ = + com.google.cloud.automl.v1beta1.Model.newBuilder(model_).mergeFrom(value).buildPartial(); + } else { + model_ = value; + } + onChanged(); + } else { + modelBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.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.v1beta1.Model model = 4; + */ + public com.google.cloud.automl.v1beta1.Model.Builder getModelBuilder() { + + onChanged(); + return getModelFieldBuilder().getBuilder(); + } + /** + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + public com.google.cloud.automl.v1beta1.ModelOrBuilder getModelOrBuilder() { + if (modelBuilder_ != null) { + return modelBuilder_.getMessageOrBuilder(); + } else { + return model_ == null ? + com.google.cloud.automl.v1beta1.Model.getDefaultInstance() : model_; + } + } + /** + *
+     * The model to create.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.Model, com.google.cloud.automl.v1beta1.Model.Builder, com.google.cloud.automl.v1beta1.ModelOrBuilder> + getModelFieldBuilder() { + if (modelBuilder_ == null) { + modelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.Model, com.google.cloud.automl.v1beta1.Model.Builder, com.google.cloud.automl.v1beta1.ModelOrBuilder>( + getModel(), + getParentForChildren(), + isClean()); + model_ = null; + } + return modelBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.CreateModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CreateModelRequest) + private static final com.google.cloud.automl.v1beta1.CreateModelRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.CreateModelRequest(); + } + + public static com.google.cloud.automl.v1beta1.CreateModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.CreateModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelRequestOrBuilder.java new file mode 100644 index 000000000000..ae97130e9f49 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/CreateModelRequestOrBuilder.java @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface CreateModelRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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.v1beta1.Model model = 4; + */ + boolean hasModel(); + /** + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + com.google.cloud.automl.v1beta1.Model getModel(); + /** + *
+   * The model to create.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model model = 4; + */ + com.google.cloud.automl.v1beta1.ModelOrBuilder getModelOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DataItems.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DataItems.java new file mode 100644 index 000000000000..848003d0ba68 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DataItems.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_Image_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_Image_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_TextSnippet_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_TextSnippet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ExamplePayload_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_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/v1beta1/data_items" + + ".proto\022\033google.cloud.automl.v1beta1\032\034goo" + + "gle/api/annotations.proto\032$google/cloud/" + + "automl/v1beta1/io.proto\"\177\n\005Image\022\025\n\013imag" + + "e_bytes\030\001 \001(\014H\000\022@\n\014input_config\030\006 \001(\0132(." + + "google.cloud.automl.v1beta1.InputConfigH" + + "\000\022\025\n\rthumbnail_uri\030\004 \001(\tB\006\n\004data\"F\n\013Text" + + "Snippet\022\017\n\007content\030\001 \001(\t\022\021\n\tmime_type\030\002 " + + "\001(\t\022\023\n\013content_uri\030\004 \001(\t\"\222\001\n\016ExamplePayl" + + "oad\0223\n\005image\030\001 \001(\0132\".google.cloud.automl" + + ".v1beta1.ImageH\000\022@\n\014text_snippet\030\002 \001(\0132(" + + ".google.cloud.automl.v1beta1.TextSnippet" + + "H\000B\t\n\007payloadBf\n\037com.google.cloud.automl" + + ".v1beta1P\001ZAgoogle.golang.org/genproto/g" + + "oogleapis/cloud/automl/v1beta1;automlb\006p" + + "roto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.Io.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_Image_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_Image_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_Image_descriptor, + new java.lang.String[] { "ImageBytes", "InputConfig", "ThumbnailUri", "Data", }); + internal_static_google_cloud_automl_v1beta1_TextSnippet_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_TextSnippet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_TextSnippet_descriptor, + new java.lang.String[] { "Content", "MimeType", "ContentUri", }); + internal_static_google_cloud_automl_v1beta1_ExamplePayload_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_automl_v1beta1_ExamplePayload_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ExamplePayload_descriptor, + new java.lang.String[] { "Image", "TextSnippet", "Payload", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.Io.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Dataset.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Dataset.java new file mode 100644 index 000000000000..641b1fecec04 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Dataset.java @@ -0,0 +1,1864 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/dataset.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * 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.v1beta1.Dataset} + */ +public final class Dataset extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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_ = ""; + exampleCount_ = 0; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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 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 168: { + + exampleCount_ = input.readInt32(); + break; + } + case 186: { + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.Builder subBuilder = null; + if (datasetMetadataCase_ == 23) { + subBuilder = ((com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) datasetMetadata_).toBuilder(); + } + datasetMetadata_ = + input.readMessage(com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) datasetMetadata_); + datasetMetadata_ = subBuilder.buildPartial(); + } + datasetMetadataCase_ = 23; + break; + } + case 194: { + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.Builder subBuilder = null; + if (datasetMetadataCase_ == 24) { + subBuilder = ((com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_).toBuilder(); + } + datasetMetadata_ = + input.readMessage(com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_); + datasetMetadata_ = subBuilder.buildPartial(); + } + datasetMetadataCase_ = 24; + break; + } + case 202: { + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.Builder subBuilder = null; + if (datasetMetadataCase_ == 25) { + subBuilder = ((com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_).toBuilder(); + } + datasetMetadata_ = + input.readMessage(com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_); + datasetMetadata_ = subBuilder.buildPartial(); + } + datasetMetadataCase_ = 25; + 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.v1beta1.DatasetOuterClass.internal_static_google_cloud_automl_v1beta1_Dataset_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DatasetOuterClass.internal_static_google_cloud_automl_v1beta1_Dataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Dataset.class, com.google.cloud.automl.v1beta1.Dataset.Builder.class); + } + + private int datasetMetadataCase_ = 0; + private java.lang.Object datasetMetadata_; + public enum DatasetMetadataCase + implements com.google.protobuf.Internal.EnumLite { + TRANSLATION_DATASET_METADATA(23), + IMAGE_CLASSIFICATION_DATASET_METADATA(24), + TEXT_CLASSIFICATION_DATASET_METADATA(25), + 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 24: return IMAGE_CLASSIFICATION_DATASET_METADATA; + case 25: return TEXT_CLASSIFICATION_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.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public boolean hasTranslationDatasetMetadata() { + return datasetMetadataCase_ == 23; + } + /** + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadata getTranslationDatasetMetadata() { + if (datasetMetadataCase_ == 23) { + return (com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.getDefaultInstance(); + } + /** + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadataOrBuilder getTranslationDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 23) { + return (com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.getDefaultInstance(); + } + + public static final int IMAGE_CLASSIFICATION_DATASET_METADATA_FIELD_NUMBER = 24; + /** + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public boolean hasImageClassificationDatasetMetadata() { + return datasetMetadataCase_ == 24; + } + /** + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata getImageClassificationDatasetMetadata() { + if (datasetMetadataCase_ == 24) { + return (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + /** + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataOrBuilder getImageClassificationDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 24) { + return (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + + public static final int TEXT_CLASSIFICATION_DATASET_METADATA_FIELD_NUMBER = 25; + /** + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public boolean hasTextClassificationDatasetMetadata() { + return datasetMetadataCase_ == 25; + } + /** + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata getTextClassificationDatasetMetadata() { + if (datasetMetadataCase_ == 25) { + return (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + /** + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataOrBuilder getTextClassificationDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 25) { + return (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.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 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(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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 (createTime_ != null) { + output.writeMessage(14, getCreateTime()); + } + if (exampleCount_ != 0) { + output.writeInt32(21, exampleCount_); + } + if (datasetMetadataCase_ == 23) { + output.writeMessage(23, (com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 24) { + output.writeMessage(24, (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 25) { + output.writeMessage(25, (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_); + } + unknownFields.writeTo(output); + } + + 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 (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, getCreateTime()); + } + 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.v1beta1.TranslationDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 24) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(24, (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 25) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(25, (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_); + } + 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.v1beta1.Dataset)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.Dataset other = (com.google.cloud.automl.v1beta1.Dataset) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDisplayName() + .equals(other.getDisplayName()); + result = result && (getExampleCount() + == other.getExampleCount()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && getDatasetMetadataCase().equals( + other.getDatasetMetadataCase()); + if (!result) return false; + switch (datasetMetadataCase_) { + case 23: + result = result && getTranslationDatasetMetadata() + .equals(other.getTranslationDatasetMetadata()); + break; + case 24: + result = result && getImageClassificationDatasetMetadata() + .equals(other.getImageClassificationDatasetMetadata()); + break; + case 25: + result = result && getTextClassificationDatasetMetadata() + .equals(other.getTextClassificationDatasetMetadata()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + EXAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getExampleCount(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + switch (datasetMetadataCase_) { + case 23: + hash = (37 * hash) + TRANSLATION_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTranslationDatasetMetadata().hashCode(); + break; + case 24: + hash = (37 * hash) + IMAGE_CLASSIFICATION_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getImageClassificationDatasetMetadata().hashCode(); + break; + case 25: + hash = (37 * hash) + TEXT_CLASSIFICATION_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTextClassificationDatasetMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.Dataset parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.Dataset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.Dataset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.Dataset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.Dataset parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.Dataset prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.Dataset} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.Dataset) + com.google.cloud.automl.v1beta1.DatasetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.DatasetOuterClass.internal_static_google_cloud_automl_v1beta1_Dataset_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DatasetOuterClass.internal_static_google_cloud_automl_v1beta1_Dataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Dataset.class, com.google.cloud.automl.v1beta1.Dataset.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + exampleCount_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.DatasetOuterClass.internal_static_google_cloud_automl_v1beta1_Dataset_descriptor; + } + + public com.google.cloud.automl.v1beta1.Dataset getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.Dataset.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.Dataset build() { + com.google.cloud.automl.v1beta1.Dataset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.Dataset buildPartial() { + com.google.cloud.automl.v1beta1.Dataset result = new com.google.cloud.automl.v1beta1.Dataset(this); + if (datasetMetadataCase_ == 23) { + if (translationDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = translationDatasetMetadataBuilder_.build(); + } + } + if (datasetMetadataCase_ == 24) { + if (imageClassificationDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = imageClassificationDatasetMetadataBuilder_.build(); + } + } + if (datasetMetadataCase_ == 25) { + if (textClassificationDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = textClassificationDatasetMetadataBuilder_.build(); + } + } + result.name_ = name_; + result.displayName_ = displayName_; + result.exampleCount_ = exampleCount_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.datasetMetadataCase_ = datasetMetadataCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.Dataset) { + return mergeFrom((com.google.cloud.automl.v1beta1.Dataset)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.Dataset other) { + if (other == com.google.cloud.automl.v1beta1.Dataset.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.getExampleCount() != 0) { + setExampleCount(other.getExampleCount()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + switch (other.getDatasetMetadataCase()) { + case TRANSLATION_DATASET_METADATA: { + mergeTranslationDatasetMetadata(other.getTranslationDatasetMetadata()); + break; + } + case IMAGE_CLASSIFICATION_DATASET_METADATA: { + mergeImageClassificationDatasetMetadata(other.getImageClassificationDatasetMetadata()); + break; + } + case TEXT_CLASSIFICATION_DATASET_METADATA: { + mergeTextClassificationDatasetMetadata(other.getTextClassificationDatasetMetadata()); + break; + } + case DATASETMETADATA_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.Dataset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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 com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata, com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.TranslationDatasetMetadataOrBuilder> translationDatasetMetadataBuilder_; + /** + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public boolean hasTranslationDatasetMetadata() { + return datasetMetadataCase_ == 23; + } + /** + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadata getTranslationDatasetMetadata() { + if (translationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 23) { + return (com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 23) { + return translationDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public Builder setTranslationDatasetMetadata(com.google.cloud.automl.v1beta1.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.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public Builder setTranslationDatasetMetadata( + com.google.cloud.automl.v1beta1.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.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public Builder mergeTranslationDatasetMetadata(com.google.cloud.automl.v1beta1.TranslationDatasetMetadata value) { + if (translationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 23 && + datasetMetadata_ != com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.getDefaultInstance()) { + datasetMetadata_ = com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.newBuilder((com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.Builder getTranslationDatasetMetadataBuilder() { + return getTranslationDatasetMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadataOrBuilder getTranslationDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 23) && (translationDatasetMetadataBuilder_ != null)) { + return translationDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 23) { + return (com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for a dataset used for translation.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata, com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.TranslationDatasetMetadataOrBuilder> + getTranslationDatasetMetadataFieldBuilder() { + if (translationDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 23)) { + datasetMetadata_ = com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.getDefaultInstance(); + } + translationDatasetMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata, com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.TranslationDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 23; + onChanged();; + return translationDatasetMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata, com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataOrBuilder> imageClassificationDatasetMetadataBuilder_; + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public boolean hasImageClassificationDatasetMetadata() { + return datasetMetadataCase_ == 24; + } + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata getImageClassificationDatasetMetadata() { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 24) { + return (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 24) { + return imageClassificationDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public Builder setImageClassificationDatasetMetadata(com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata value) { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetMetadata_ = value; + onChanged(); + } else { + imageClassificationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 24; + return this; + } + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public Builder setImageClassificationDatasetMetadata( + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.Builder builderForValue) { + if (imageClassificationDatasetMetadataBuilder_ == null) { + datasetMetadata_ = builderForValue.build(); + onChanged(); + } else { + imageClassificationDatasetMetadataBuilder_.setMessage(builderForValue.build()); + } + datasetMetadataCase_ = 24; + return this; + } + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public Builder mergeImageClassificationDatasetMetadata(com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata value) { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 24 && + datasetMetadata_ != com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance()) { + datasetMetadata_ = com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.newBuilder((com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_) + .mergeFrom(value).buildPartial(); + } else { + datasetMetadata_ = value; + } + onChanged(); + } else { + if (datasetMetadataCase_ == 24) { + imageClassificationDatasetMetadataBuilder_.mergeFrom(value); + } + imageClassificationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 24; + return this; + } + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public Builder clearImageClassificationDatasetMetadata() { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 24) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + } + } else { + if (datasetMetadataCase_ == 24) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + } + imageClassificationDatasetMetadataBuilder_.clear(); + } + return this; + } + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.Builder getImageClassificationDatasetMetadataBuilder() { + return getImageClassificationDatasetMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataOrBuilder getImageClassificationDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 24) && (imageClassificationDatasetMetadataBuilder_ != null)) { + return imageClassificationDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 24) { + return (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata, com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataOrBuilder> + getImageClassificationDatasetMetadataFieldBuilder() { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 24)) { + datasetMetadata_ = com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + imageClassificationDatasetMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata, com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 24; + onChanged();; + return imageClassificationDatasetMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata, com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataOrBuilder> textClassificationDatasetMetadataBuilder_; + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public boolean hasTextClassificationDatasetMetadata() { + return datasetMetadataCase_ == 25; + } + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata getTextClassificationDatasetMetadata() { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 25) { + return (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 25) { + return textClassificationDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public Builder setTextClassificationDatasetMetadata(com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata value) { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetMetadata_ = value; + onChanged(); + } else { + textClassificationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 25; + return this; + } + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public Builder setTextClassificationDatasetMetadata( + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.Builder builderForValue) { + if (textClassificationDatasetMetadataBuilder_ == null) { + datasetMetadata_ = builderForValue.build(); + onChanged(); + } else { + textClassificationDatasetMetadataBuilder_.setMessage(builderForValue.build()); + } + datasetMetadataCase_ = 25; + return this; + } + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public Builder mergeTextClassificationDatasetMetadata(com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata value) { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 25 && + datasetMetadata_ != com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.getDefaultInstance()) { + datasetMetadata_ = com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.newBuilder((com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_) + .mergeFrom(value).buildPartial(); + } else { + datasetMetadata_ = value; + } + onChanged(); + } else { + if (datasetMetadataCase_ == 25) { + textClassificationDatasetMetadataBuilder_.mergeFrom(value); + } + textClassificationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 25; + return this; + } + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public Builder clearTextClassificationDatasetMetadata() { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 25) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + } + } else { + if (datasetMetadataCase_ == 25) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + } + textClassificationDatasetMetadataBuilder_.clear(); + } + return this; + } + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.Builder getTextClassificationDatasetMetadataBuilder() { + return getTextClassificationDatasetMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataOrBuilder getTextClassificationDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 25) && (textClassificationDatasetMetadataBuilder_ != null)) { + return textClassificationDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 25) { + return (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata, com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataOrBuilder> + getTextClassificationDatasetMetadataFieldBuilder() { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 25)) { + datasetMetadata_ = com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + textClassificationDatasetMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata, com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.Builder, com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 25; + onChanged();; + return textClassificationDatasetMetadataBuilder_; + } + + 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 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_ = null; + 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_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.Dataset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Dataset) + private static final com.google.cloud.automl.v1beta1.Dataset DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.Dataset(); + } + + public static com.google.cloud.automl.v1beta1.Dataset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.Dataset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetName.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetName.java new file mode 100644 index 000000000000..ea24df22e90c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetName.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.automl.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetOrBuilder.java new file mode 100644 index 000000000000..285a6ccea6e7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetOrBuilder.java @@ -0,0 +1,164 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/dataset.proto + +package com.google.cloud.automl.v1beta1; + +public interface DatasetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.Dataset) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + boolean hasTranslationDatasetMetadata(); + /** + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata getTranslationDatasetMetadata(); + /** + *
+   * Metadata for a dataset used for translation.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationDatasetMetadata translation_dataset_metadata = 23; + */ + com.google.cloud.automl.v1beta1.TranslationDatasetMetadataOrBuilder getTranslationDatasetMetadataOrBuilder(); + + /** + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + boolean hasImageClassificationDatasetMetadata(); + /** + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata getImageClassificationDatasetMetadata(); + /** + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + */ + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataOrBuilder getImageClassificationDatasetMetadataOrBuilder(); + + /** + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + boolean hasTextClassificationDatasetMetadata(); + /** + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata getTextClassificationDatasetMetadata(); + /** + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + */ + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataOrBuilder getTextClassificationDatasetMetadataOrBuilder(); + + /** + *
+   * 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(); + + /** + *
+   * 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(); + + public com.google.cloud.automl.v1beta1.Dataset.DatasetMetadataCase getDatasetMetadataCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetOuterClass.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetOuterClass.java new file mode 100644 index 000000000000..92df1adf3912 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DatasetOuterClass.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/dataset.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_Dataset_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_Dataset_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/v1beta1/dataset.pr" + + "oto\022\033google.cloud.automl.v1beta1\032\034google" + + "/api/annotations.proto\0324google/cloud/aut" + + "oml/v1beta1/annotation_payload.proto\032,go" + + "ogle/cloud/automl/v1beta1/data_items.pro" + + "to\032\'google/cloud/automl/v1beta1/image.pr" + + "oto\032&google/cloud/automl/v1beta1/text.pr" + + "oto\032-google/cloud/automl/v1beta1/transla" + + "tion.proto\032\037google/protobuf/timestamp.pr" + + "oto\"\314\003\n\007Dataset\022_\n\034translation_dataset_m" + + "etadata\030\027 \001(\01327.google.cloud.automl.v1be" + + "ta1.TranslationDatasetMetadataH\000\022p\n%imag" + + "e_classification_dataset_metadata\030\030 \001(\0132" + + "?.google.cloud.automl.v1beta1.ImageClass" + + "ificationDatasetMetadataH\000\022n\n$text_class" + + "ification_dataset_metadata\030\031 \001(\0132>.googl" + + "e.cloud.automl.v1beta1.TextClassificatio" + + "nDatasetMetadataH\000\022\014\n\004name\030\001 \001(\t\022\024\n\014disp" + + "lay_name\030\002 \001(\t\022\025\n\rexample_count\030\025 \001(\005\022/\n" + + "\013create_time\030\016 \001(\0132\032.google.protobuf.Tim" + + "estampB\022\n\020dataset_metadataBf\n\037com.google" + + ".cloud.automl.v1beta1P\001ZAgoogle.golang.o" + + "rg/genproto/googleapis/cloud/automl/v1be" + + "ta1;automlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.getDescriptor(), + com.google.cloud.automl.v1beta1.DataItems.getDescriptor(), + com.google.cloud.automl.v1beta1.ImageProto.getDescriptor(), + com.google.cloud.automl.v1beta1.TextProto.getDescriptor(), + com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_Dataset_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_Dataset_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_Dataset_descriptor, + new java.lang.String[] { "TranslationDatasetMetadata", "ImageClassificationDatasetMetadata", "TextClassificationDatasetMetadata", "Name", "DisplayName", "ExampleCount", "CreateTime", "DatasetMetadata", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.getDescriptor(); + com.google.cloud.automl.v1beta1.DataItems.getDescriptor(); + com.google.cloud.automl.v1beta1.ImageProto.getDescriptor(); + com.google.cloud.automl.v1beta1.TextProto.getDescriptor(); + com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteDatasetRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteDatasetRequest.java new file mode 100644 index 000000000000..62e575509713 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteDatasetRequest.java @@ -0,0 +1,552 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1beta1.AutoMl.DeleteDataset].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.DeleteDatasetRequest} + */ +public final class DeleteDatasetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.DeleteDatasetRequest.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.DeleteDatasetRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.DeleteDatasetRequest other = (com.google.cloud.automl.v1beta1.DeleteDatasetRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.DeleteDatasetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.DeleteDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.DeleteDatasetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.DeleteDatasetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.DeleteDatasetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.DeleteDatasetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.DeleteDataset].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.DeleteDatasetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.DeleteDatasetRequest) + com.google.cloud.automl.v1beta1.DeleteDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.DeleteDatasetRequest.class, com.google.cloud.automl.v1beta1.DeleteDatasetRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteDatasetRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.DeleteDatasetRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.DeleteDatasetRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.DeleteDatasetRequest build() { + com.google.cloud.automl.v1beta1.DeleteDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.DeleteDatasetRequest buildPartial() { + com.google.cloud.automl.v1beta1.DeleteDatasetRequest result = new com.google.cloud.automl.v1beta1.DeleteDatasetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.DeleteDatasetRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.DeleteDatasetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.DeleteDatasetRequest other) { + if (other == com.google.cloud.automl.v1beta1.DeleteDatasetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.DeleteDatasetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.DeleteDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DeleteDatasetRequest) + private static final com.google.cloud.automl.v1beta1.DeleteDatasetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.DeleteDatasetRequest(); + } + + public static com.google.cloud.automl.v1beta1.DeleteDatasetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.DeleteDatasetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteDatasetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteDatasetRequestOrBuilder.java new file mode 100644 index 000000000000..cefc83f5168d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteDatasetRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface DeleteDatasetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteModelRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteModelRequest.java new file mode 100644 index 000000000000..3384ebfaed73 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteModelRequest.java @@ -0,0 +1,552 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.DeleteModel][google.cloud.automl.v1beta1.AutoMl.DeleteModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.DeleteModelRequest} + */ +public final class DeleteModelRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.DeleteModelRequest.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.DeleteModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.DeleteModelRequest other = (com.google.cloud.automl.v1beta1.DeleteModelRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.DeleteModelRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.DeleteModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.DeleteModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.DeleteModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.DeleteModelRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.DeleteModelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.DeleteModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.DeleteModelRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.DeleteModelRequest) + com.google.cloud.automl.v1beta1.DeleteModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.DeleteModelRequest.class, com.google.cloud.automl.v1beta1.DeleteModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeleteModelRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.DeleteModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.DeleteModelRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.DeleteModelRequest build() { + com.google.cloud.automl.v1beta1.DeleteModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.DeleteModelRequest buildPartial() { + com.google.cloud.automl.v1beta1.DeleteModelRequest result = new com.google.cloud.automl.v1beta1.DeleteModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.DeleteModelRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.DeleteModelRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.DeleteModelRequest other) { + if (other == com.google.cloud.automl.v1beta1.DeleteModelRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.DeleteModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.DeleteModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DeleteModelRequest) + private static final com.google.cloud.automl.v1beta1.DeleteModelRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.DeleteModelRequest(); + } + + public static com.google.cloud.automl.v1beta1.DeleteModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.DeleteModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteModelRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteModelRequestOrBuilder.java new file mode 100644 index 000000000000..298877cf8aac --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeleteModelRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface DeleteModelRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeployModelRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeployModelRequest.java new file mode 100644 index 000000000000..685038e8b7d2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeployModelRequest.java @@ -0,0 +1,552 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.DeployModel][google.cloud.automl.v1beta1.AutoMl.DeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.DeployModelRequest} + */ +public final class DeployModelRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.DeployModelRequest) + DeployModelRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeployModelRequest.newBuilder() to construct. + private DeployModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeployModelRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeployModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeployModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.DeployModelRequest.class, com.google.cloud.automl.v1beta1.DeployModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of the model to deploy.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Resource name of the model to deploy.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.DeployModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.DeployModelRequest other = (com.google.cloud.automl.v1beta1.DeployModelRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.DeployModelRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.DeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.DeployModelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for [AutoMl.DeployModel][google.cloud.automl.v1beta1.AutoMl.DeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.DeployModelRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.DeployModelRequest) + com.google.cloud.automl.v1beta1.DeployModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeployModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.DeployModelRequest.class, com.google.cloud.automl.v1beta1.DeployModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.DeployModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_DeployModelRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.DeployModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.DeployModelRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.DeployModelRequest build() { + com.google.cloud.automl.v1beta1.DeployModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.DeployModelRequest buildPartial() { + com.google.cloud.automl.v1beta1.DeployModelRequest result = new com.google.cloud.automl.v1beta1.DeployModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.DeployModelRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.DeployModelRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.DeployModelRequest other) { + if (other == com.google.cloud.automl.v1beta1.DeployModelRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.DeployModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.DeployModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.DeployModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DeployModelRequest) + private static final com.google.cloud.automl.v1beta1.DeployModelRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.DeployModelRequest(); + } + + public static com.google.cloud.automl.v1beta1.DeployModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeployModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployModelRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.DeployModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeployModelRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeployModelRequestOrBuilder.java new file mode 100644 index 000000000000..6ce33f5dee29 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DeployModelRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface DeployModelRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.DeployModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the model to deploy.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of the model to deploy.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExamplePayload.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExamplePayload.java new file mode 100644 index 000000000000..4ebd93a3d77b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExamplePayload.java @@ -0,0 +1,969 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Example data used for training or prediction.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ExamplePayload} + */ +public final class ExamplePayload extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.automl.v1beta1.Image.Builder subBuilder = null; + if (payloadCase_ == 1) { + subBuilder = ((com.google.cloud.automl.v1beta1.Image) payload_).toBuilder(); + } + payload_ = + input.readMessage(com.google.cloud.automl.v1beta1.Image.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.Image) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 1; + break; + } + case 18: { + com.google.cloud.automl.v1beta1.TextSnippet.Builder subBuilder = null; + if (payloadCase_ == 2) { + subBuilder = ((com.google.cloud.automl.v1beta1.TextSnippet) payload_).toBuilder(); + } + payload_ = + input.readMessage(com.google.cloud.automl.v1beta1.TextSnippet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.TextSnippet) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 2; + 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.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_ExamplePayload_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_ExamplePayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ExamplePayload.class, com.google.cloud.automl.v1beta1.ExamplePayload.Builder.class); + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + public enum PayloadCase + implements com.google.protobuf.Internal.EnumLite { + IMAGE(1), + 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 1: return IMAGE; + 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 IMAGE_FIELD_NUMBER = 1; + /** + *
+   * An example image.
+   * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public boolean hasImage() { + return payloadCase_ == 1; + } + /** + *
+   * An example image.
+   * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public com.google.cloud.automl.v1beta1.Image getImage() { + if (payloadCase_ == 1) { + return (com.google.cloud.automl.v1beta1.Image) payload_; + } + return com.google.cloud.automl.v1beta1.Image.getDefaultInstance(); + } + /** + *
+   * An example image.
+   * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public com.google.cloud.automl.v1beta1.ImageOrBuilder getImageOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.cloud.automl.v1beta1.Image) payload_; + } + return com.google.cloud.automl.v1beta1.Image.getDefaultInstance(); + } + + public static final int TEXT_SNIPPET_FIELD_NUMBER = 2; + /** + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + public boolean hasTextSnippet() { + return payloadCase_ == 2; + } + /** + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippet getTextSnippet() { + if (payloadCase_ == 2) { + return (com.google.cloud.automl.v1beta1.TextSnippet) payload_; + } + return com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance(); + } + /** + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getTextSnippetOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.cloud.automl.v1beta1.TextSnippet) payload_; + } + return com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.cloud.automl.v1beta1.Image) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.cloud.automl.v1beta1.TextSnippet) payload_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (com.google.cloud.automl.v1beta1.Image) payload_); + } + if (payloadCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ExamplePayload other = (com.google.cloud.automl.v1beta1.ExamplePayload) obj; + + boolean result = true; + result = result && getPayloadCase().equals( + other.getPayloadCase()); + if (!result) return false; + switch (payloadCase_) { + case 1: + result = result && getImage() + .equals(other.getImage()); + break; + case 2: + result = result && getTextSnippet() + .equals(other.getTextSnippet()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + break; + case 2: + hash = (37 * hash) + TEXT_SNIPPET_FIELD_NUMBER; + hash = (53 * hash) + getTextSnippet().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ExamplePayload parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ExamplePayload prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.ExamplePayload} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ExamplePayload) + com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_ExamplePayload_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_ExamplePayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ExamplePayload.class, com.google.cloud.automl.v1beta1.ExamplePayload.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + payloadCase_ = 0; + payload_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_ExamplePayload_descriptor; + } + + public com.google.cloud.automl.v1beta1.ExamplePayload getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ExamplePayload build() { + com.google.cloud.automl.v1beta1.ExamplePayload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ExamplePayload buildPartial() { + com.google.cloud.automl.v1beta1.ExamplePayload result = new com.google.cloud.automl.v1beta1.ExamplePayload(this); + if (payloadCase_ == 1) { + if (imageBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = imageBuilder_.build(); + } + } + if (payloadCase_ == 2) { + if (textSnippetBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = textSnippetBuilder_.build(); + } + } + result.payloadCase_ = payloadCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ExamplePayload) { + return mergeFrom((com.google.cloud.automl.v1beta1.ExamplePayload)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ExamplePayload other) { + if (other == com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case IMAGE: { + mergeImage(other.getImage()); + break; + } + case TEXT_SNIPPET: { + mergeTextSnippet(other.getTextSnippet()); + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ExamplePayload parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.Image, com.google.cloud.automl.v1beta1.Image.Builder, com.google.cloud.automl.v1beta1.ImageOrBuilder> imageBuilder_; + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public boolean hasImage() { + return payloadCase_ == 1; + } + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public com.google.cloud.automl.v1beta1.Image getImage() { + if (imageBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.cloud.automl.v1beta1.Image) payload_; + } + return com.google.cloud.automl.v1beta1.Image.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return imageBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.Image.getDefaultInstance(); + } + } + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public Builder setImage(com.google.cloud.automl.v1beta1.Image value) { + if (imageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + imageBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public Builder setImage( + com.google.cloud.automl.v1beta1.Image.Builder builderForValue) { + if (imageBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + imageBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public Builder mergeImage(com.google.cloud.automl.v1beta1.Image value) { + if (imageBuilder_ == null) { + if (payloadCase_ == 1 && + payload_ != com.google.cloud.automl.v1beta1.Image.getDefaultInstance()) { + payload_ = com.google.cloud.automl.v1beta1.Image.newBuilder((com.google.cloud.automl.v1beta1.Image) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + imageBuilder_.mergeFrom(value); + } + imageBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public Builder clearImage() { + if (imageBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + imageBuilder_.clear(); + } + return this; + } + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public com.google.cloud.automl.v1beta1.Image.Builder getImageBuilder() { + return getImageFieldBuilder().getBuilder(); + } + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + public com.google.cloud.automl.v1beta1.ImageOrBuilder getImageOrBuilder() { + if ((payloadCase_ == 1) && (imageBuilder_ != null)) { + return imageBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.cloud.automl.v1beta1.Image) payload_; + } + return com.google.cloud.automl.v1beta1.Image.getDefaultInstance(); + } + } + /** + *
+     * An example image.
+     * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.Image, com.google.cloud.automl.v1beta1.Image.Builder, com.google.cloud.automl.v1beta1.ImageOrBuilder> + getImageFieldBuilder() { + if (imageBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.cloud.automl.v1beta1.Image.getDefaultInstance(); + } + imageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.Image, com.google.cloud.automl.v1beta1.Image.Builder, com.google.cloud.automl.v1beta1.ImageOrBuilder>( + (com.google.cloud.automl.v1beta1.Image) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged();; + return imageBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, com.google.cloud.automl.v1beta1.TextSnippet.Builder, com.google.cloud.automl.v1beta1.TextSnippetOrBuilder> textSnippetBuilder_; + /** + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + public boolean hasTextSnippet() { + return payloadCase_ == 2; + } + /** + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippet getTextSnippet() { + if (textSnippetBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.cloud.automl.v1beta1.TextSnippet) payload_; + } + return com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return textSnippetBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance(); + } + } + /** + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + public Builder setTextSnippet(com.google.cloud.automl.v1beta1.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.v1beta1.TextSnippet text_snippet = 2; + */ + public Builder setTextSnippet( + com.google.cloud.automl.v1beta1.TextSnippet.Builder builderForValue) { + if (textSnippetBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + textSnippetBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + /** + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + public Builder mergeTextSnippet(com.google.cloud.automl.v1beta1.TextSnippet value) { + if (textSnippetBuilder_ == null) { + if (payloadCase_ == 2 && + payload_ != com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance()) { + payload_ = com.google.cloud.automl.v1beta1.TextSnippet.newBuilder((com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippet.Builder getTextSnippetBuilder() { + return getTextSnippetFieldBuilder().getBuilder(); + } + /** + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getTextSnippetOrBuilder() { + if ((payloadCase_ == 2) && (textSnippetBuilder_ != null)) { + return textSnippetBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.cloud.automl.v1beta1.TextSnippet) payload_; + } + return com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance(); + } + } + /** + *
+     * Example text.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, com.google.cloud.automl.v1beta1.TextSnippet.Builder, com.google.cloud.automl.v1beta1.TextSnippetOrBuilder> + getTextSnippetFieldBuilder() { + if (textSnippetBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance(); + } + textSnippetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, com.google.cloud.automl.v1beta1.TextSnippet.Builder, com.google.cloud.automl.v1beta1.TextSnippetOrBuilder>( + (com.google.cloud.automl.v1beta1.TextSnippet) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged();; + return textSnippetBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ExamplePayload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExamplePayload) + private static final com.google.cloud.automl.v1beta1.ExamplePayload DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ExamplePayload(); + } + + public static com.google.cloud.automl.v1beta1.ExamplePayload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ExamplePayload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExamplePayloadOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExamplePayloadOrBuilder.java new file mode 100644 index 000000000000..9a4b41a03201 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExamplePayloadOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +public interface ExamplePayloadOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ExamplePayload) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * An example image.
+   * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + boolean hasImage(); + /** + *
+   * An example image.
+   * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + com.google.cloud.automl.v1beta1.Image getImage(); + /** + *
+   * An example image.
+   * 
+ * + * .google.cloud.automl.v1beta1.Image image = 1; + */ + com.google.cloud.automl.v1beta1.ImageOrBuilder getImageOrBuilder(); + + /** + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + boolean hasTextSnippet(); + /** + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + com.google.cloud.automl.v1beta1.TextSnippet getTextSnippet(); + /** + *
+   * Example text.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet text_snippet = 2; + */ + com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getTextSnippetOrBuilder(); + + public com.google.cloud.automl.v1beta1.ExamplePayload.PayloadCase getPayloadCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportDataRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportDataRequest.java new file mode 100644 index 000000000000..e1fd6b615179 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportDataRequest.java @@ -0,0 +1,781 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.ExportData][google.cloud.automl.v1beta1.AutoMl.ExportData].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ExportDataRequest} + */ +public final class ExportDataRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + com.google.cloud.automl.v1beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.automl.v1beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ExportDataRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ExportDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ExportDataRequest.class, com.google.cloud.automl.v1beta1.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.v1beta1.OutputConfig outputConfig_; + /** + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null ? com.google.cloud.automl.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } + /** + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.ExportDataRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ExportDataRequest other = (com.google.cloud.automl.v1beta1.ExportDataRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasOutputConfig() == other.hasOutputConfig()); + if (hasOutputConfig()) { + result = result && getOutputConfig() + .equals(other.getOutputConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.ExportDataRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ExportDataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ExportDataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ExportDataRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ExportDataRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ExportDataRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.ExportData].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ExportDataRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ExportDataRequest) + com.google.cloud.automl.v1beta1.ExportDataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ExportDataRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ExportDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ExportDataRequest.class, com.google.cloud.automl.v1beta1.ExportDataRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ExportDataRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.ExportDataRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ExportDataRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ExportDataRequest build() { + com.google.cloud.automl.v1beta1.ExportDataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ExportDataRequest buildPartial() { + com.google.cloud.automl.v1beta1.ExportDataRequest result = new com.google.cloud.automl.v1beta1.ExportDataRequest(this); + result.name_ = name_; + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ExportDataRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.ExportDataRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ExportDataRequest other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ExportDataRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.OutputConfig outputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.OutputConfig, com.google.cloud.automl.v1beta1.OutputConfig.Builder, com.google.cloud.automl.v1beta1.OutputConfigOrBuilder> outputConfigBuilder_; + /** + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null ? com.google.cloud.automl.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + public Builder setOutputConfig(com.google.cloud.automl.v1beta1.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.v1beta1.OutputConfig output_config = 3; + */ + public Builder setOutputConfig( + com.google.cloud.automl.v1beta1.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.v1beta1.OutputConfig output_config = 3; + */ + public Builder mergeOutputConfig(com.google.cloud.automl.v1beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.automl.v1beta1.OutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1beta1.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.v1beta1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null ? + com.google.cloud.automl.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } + } + /** + *
+     * Required. The desired output location.
+     * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.OutputConfig, com.google.cloud.automl.v1beta1.OutputConfig.Builder, com.google.cloud.automl.v1beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.OutputConfig, com.google.cloud.automl.v1beta1.OutputConfig.Builder, com.google.cloud.automl.v1beta1.OutputConfigOrBuilder>( + getOutputConfig(), + getParentForChildren(), + isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ExportDataRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportDataRequest) + private static final com.google.cloud.automl.v1beta1.ExportDataRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ExportDataRequest(); + } + + public static com.google.cloud.automl.v1beta1.ExportDataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ExportDataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportDataRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportDataRequestOrBuilder.java new file mode 100644 index 000000000000..bc636913710b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ExportDataRequestOrBuilder.java @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface ExportDataRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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.v1beta1.OutputConfig output_config = 3; + */ + boolean hasOutputConfig(); + /** + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + com.google.cloud.automl.v1beta1.OutputConfig getOutputConfig(); + /** + *
+   * Required. The desired output location.
+   * 
+ * + * .google.cloud.automl.v1beta1.OutputConfig output_config = 3; + */ + com.google.cloud.automl.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsDestination.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsDestination.java new file mode 100644 index 000000000000..44189dc43906 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsDestination.java @@ -0,0 +1,587 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * The GCS location where the output must be written to
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GcsDestination} + */ +public final class GcsDestination extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + outputUriPrefix_ = s; + 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.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsDestination_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GcsDestination.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.GcsDestination)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.GcsDestination other = (com.google.cloud.automl.v1beta1.GcsDestination) obj; + + boolean result = true; + result = result && getOutputUriPrefix() + .equals(other.getOutputUriPrefix()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.GcsDestination parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GcsDestination parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GcsDestination parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.GcsDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 GCS location where the output must be written to
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GcsDestination} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.GcsDestination) + com.google.cloud.automl.v1beta1.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsDestination_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GcsDestination.class, com.google.cloud.automl.v1beta1.GcsDestination.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + outputUriPrefix_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsDestination_descriptor; + } + + public com.google.cloud.automl.v1beta1.GcsDestination getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.GcsDestination build() { + com.google.cloud.automl.v1beta1.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.GcsDestination buildPartial() { + com.google.cloud.automl.v1beta1.GcsDestination result = new com.google.cloud.automl.v1beta1.GcsDestination(this); + result.outputUriPrefix_ = outputUriPrefix_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.GcsDestination) { + return mergeFrom((com.google.cloud.automl.v1beta1.GcsDestination)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.GcsDestination other) { + if (other == com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance()) return this; + if (!other.getOutputUriPrefix().isEmpty()) { + outputUriPrefix_ = other.outputUriPrefix_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.GcsDestination parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GcsDestination) + private static final com.google.cloud.automl.v1beta1.GcsDestination DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.GcsDestination(); + } + + public static com.google.cloud.automl.v1beta1.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsDestinationOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsDestinationOrBuilder.java new file mode 100644 index 000000000000..ef3f062414e7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsDestinationOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +public interface GcsDestinationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsSource.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsSource.java new file mode 100644 index 000000000000..8fe5611948a0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsSource.java @@ -0,0 +1,647 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * The GCS location for the input content.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GcsSource} + */ +public final class GcsSource extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + inputUris_.add(s); + 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) == 0x00000001)) { + inputUris_ = inputUris_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsSource_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GcsSource.class, com.google.cloud.automl.v1beta1.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: 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: 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: 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: 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.GcsSource other = (com.google.cloud.automl.v1beta1.GcsSource) obj; + + boolean result = true; + result = result && getInputUrisList() + .equals(other.getInputUrisList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.GcsSource parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GcsSource parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.GcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 GCS location for the input content.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GcsSource} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.GcsSource) + com.google.cloud.automl.v1beta1.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsSource_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GcsSource.class, com.google.cloud.automl.v1beta1.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_GcsSource_descriptor; + } + + public com.google.cloud.automl.v1beta1.GcsSource getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.GcsSource.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.GcsSource build() { + com.google.cloud.automl.v1beta1.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.GcsSource buildPartial() { + com.google.cloud.automl.v1beta1.GcsSource result = new com.google.cloud.automl.v1beta1.GcsSource(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + inputUris_ = inputUris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inputUris_ = inputUris_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.GcsSource) { + return mergeFrom((com.google.cloud.automl.v1beta1.GcsSource)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.GcsSource other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.GcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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) == 0x00000001)) { + 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: 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: 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: 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: 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: 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: 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: 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: 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: 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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GcsSource) + private static final com.google.cloud.automl.v1beta1.GcsSource DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.GcsSource(); + } + + public static com.google.cloud.automl.v1beta1.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsSourceOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsSourceOrBuilder.java new file mode 100644 index 000000000000..180038dded22 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GcsSourceOrBuilder.java @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +public interface GcsSourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
+   * long. Accepted forms:
+   * * Full object path: 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: 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: 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: gs://bucket/directory/object.csv
+   * 
+ * + * repeated string input_uris = 1; + */ + com.google.protobuf.ByteString + getInputUrisBytes(int index); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetDatasetRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetDatasetRequest.java new file mode 100644 index 000000000000..e0e529de31ac --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetDatasetRequest.java @@ -0,0 +1,552 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.GetDataset][google.cloud.automl.v1beta1.AutoMl.GetDataset].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GetDatasetRequest} + */ +public final class GetDatasetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GetDatasetRequest.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.GetDatasetRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.GetDatasetRequest other = (com.google.cloud.automl.v1beta1.GetDatasetRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.GetDatasetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetDatasetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetDatasetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetDatasetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.GetDatasetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.GetDataset].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GetDatasetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.GetDatasetRequest) + com.google.cloud.automl.v1beta1.GetDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GetDatasetRequest.class, com.google.cloud.automl.v1beta1.GetDatasetRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetDatasetRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.GetDatasetRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.GetDatasetRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.GetDatasetRequest build() { + com.google.cloud.automl.v1beta1.GetDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.GetDatasetRequest buildPartial() { + com.google.cloud.automl.v1beta1.GetDatasetRequest result = new com.google.cloud.automl.v1beta1.GetDatasetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.GetDatasetRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.GetDatasetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.GetDatasetRequest other) { + if (other == com.google.cloud.automl.v1beta1.GetDatasetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.GetDatasetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.GetDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetDatasetRequest) + private static final com.google.cloud.automl.v1beta1.GetDatasetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.GetDatasetRequest(); + } + + public static com.google.cloud.automl.v1beta1.GetDatasetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.GetDatasetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetDatasetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetDatasetRequestOrBuilder.java new file mode 100644 index 000000000000..a88ab559ad96 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetDatasetRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface GetDatasetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelEvaluationRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelEvaluationRequest.java new file mode 100644 index 000000000000..2d2f1ad5ce03 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelEvaluationRequest.java @@ -0,0 +1,552 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.GetModelEvaluation][google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GetModelEvaluationRequest} + */ +public final class GetModelEvaluationRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.GetModelEvaluationRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest other = (com.google.cloud.automl.v1beta1.GetModelEvaluationRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.GetModelEvaluationRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetModelEvaluationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetModelEvaluationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetModelEvaluationRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetModelEvaluationRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.GetModelEvaluationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.GetModelEvaluation].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GetModelEvaluationRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.GetModelEvaluationRequest) + com.google.cloud.automl.v1beta1.GetModelEvaluationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest.class, com.google.cloud.automl.v1beta1.GetModelEvaluationRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelEvaluationRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.GetModelEvaluationRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.GetModelEvaluationRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.GetModelEvaluationRequest build() { + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.GetModelEvaluationRequest buildPartial() { + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest result = new com.google.cloud.automl.v1beta1.GetModelEvaluationRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.GetModelEvaluationRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.GetModelEvaluationRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.GetModelEvaluationRequest other) { + if (other == com.google.cloud.automl.v1beta1.GetModelEvaluationRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.GetModelEvaluationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.GetModelEvaluationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetModelEvaluationRequest) + private static final com.google.cloud.automl.v1beta1.GetModelEvaluationRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.GetModelEvaluationRequest(); + } + + public static com.google.cloud.automl.v1beta1.GetModelEvaluationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.GetModelEvaluationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelEvaluationRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelEvaluationRequestOrBuilder.java new file mode 100644 index 000000000000..6f6c753bce26 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelEvaluationRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface GetModelEvaluationRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelRequest.java new file mode 100644 index 000000000000..4daa917aef20 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelRequest.java @@ -0,0 +1,552 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.GetModel][google.cloud.automl.v1beta1.AutoMl.GetModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GetModelRequest} + */ +public final class GetModelRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GetModelRequest.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.GetModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.GetModelRequest other = (com.google.cloud.automl.v1beta1.GetModelRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.GetModelRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.GetModelRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.GetModelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.GetModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.GetModelRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.GetModelRequest) + com.google.cloud.automl.v1beta1.GetModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.GetModelRequest.class, com.google.cloud.automl.v1beta1.GetModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_GetModelRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.GetModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.GetModelRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.GetModelRequest build() { + com.google.cloud.automl.v1beta1.GetModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.GetModelRequest buildPartial() { + com.google.cloud.automl.v1beta1.GetModelRequest result = new com.google.cloud.automl.v1beta1.GetModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.GetModelRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.GetModelRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.GetModelRequest other) { + if (other == com.google.cloud.automl.v1beta1.GetModelRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.GetModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.GetModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetModelRequest) + private static final com.google.cloud.automl.v1beta1.GetModelRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.GetModelRequest(); + } + + public static com.google.cloud.automl.v1beta1.GetModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.GetModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelRequestOrBuilder.java new file mode 100644 index 000000000000..2ca3a38ec268 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/GetModelRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface GetModelRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Image.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Image.java new file mode 100644 index 000000000000..4e284e85d17d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Image.java @@ -0,0 +1,971 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * A representation of an image.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.Image} + */ +public final class Image extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.Image) + ImageOrBuilder { +private static final long serialVersionUID = 0L; + // Use Image.newBuilder() to construct. + private Image(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Image() { + thumbnailUri_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Image( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + dataCase_ = 1; + data_ = input.readBytes(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + thumbnailUri_ = s; + break; + } + case 50: { + com.google.cloud.automl.v1beta1.InputConfig.Builder subBuilder = null; + if (dataCase_ == 6) { + subBuilder = ((com.google.cloud.automl.v1beta1.InputConfig) data_).toBuilder(); + } + data_ = + input.readMessage(com.google.cloud.automl.v1beta1.InputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.InputConfig) data_); + data_ = subBuilder.buildPartial(); + } + dataCase_ = 6; + 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.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_Image_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Image.class, com.google.cloud.automl.v1beta1.Image.Builder.class); + } + + private int dataCase_ = 0; + private java.lang.Object data_; + public enum DataCase + implements com.google.protobuf.Internal.EnumLite { + IMAGE_BYTES(1), + INPUT_CONFIG(6), + DATA_NOT_SET(0); + private final int value; + private DataCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 1: return IMAGE_BYTES; + case 6: return INPUT_CONFIG; + case 0: return DATA_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public DataCase + getDataCase() { + return DataCase.forNumber( + dataCase_); + } + + public static final int IMAGE_BYTES_FIELD_NUMBER = 1; + /** + *
+   * Image content represented as a stream of bytes.
+   * Note: As with all `bytes` fields, protobuffers use a pure binary
+   * representation, whereas JSON representations use base64.
+   * 
+ * + * bytes image_bytes = 1; + */ + public com.google.protobuf.ByteString getImageBytes() { + if (dataCase_ == 1) { + return (com.google.protobuf.ByteString) data_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 6; + /** + *
+   * An input config specifying the content of the image.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public boolean hasInputConfig() { + return dataCase_ == 6; + } + /** + *
+   * An input config specifying the content of the image.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public com.google.cloud.automl.v1beta1.InputConfig getInputConfig() { + if (dataCase_ == 6) { + return (com.google.cloud.automl.v1beta1.InputConfig) data_; + } + return com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance(); + } + /** + *
+   * An input config specifying the content of the image.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public com.google.cloud.automl.v1beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (dataCase_ == 6) { + return (com.google.cloud.automl.v1beta1.InputConfig) data_; + } + return com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance(); + } + + public static final int THUMBNAIL_URI_FIELD_NUMBER = 4; + private volatile java.lang.Object thumbnailUri_; + /** + *
+   * Output only. HTTP URI to the thumbnail image.
+   * 
+ * + * string thumbnail_uri = 4; + */ + public java.lang.String getThumbnailUri() { + java.lang.Object ref = thumbnailUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + thumbnailUri_ = s; + return s; + } + } + /** + *
+   * Output only. HTTP URI to the thumbnail image.
+   * 
+ * + * string thumbnail_uri = 4; + */ + public com.google.protobuf.ByteString + getThumbnailUriBytes() { + java.lang.Object ref = thumbnailUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + thumbnailUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (dataCase_ == 1) { + output.writeBytes( + 1, (com.google.protobuf.ByteString) data_); + } + if (!getThumbnailUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, thumbnailUri_); + } + if (dataCase_ == 6) { + output.writeMessage(6, (com.google.cloud.automl.v1beta1.InputConfig) data_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 1, (com.google.protobuf.ByteString) data_); + } + if (!getThumbnailUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, thumbnailUri_); + } + if (dataCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (com.google.cloud.automl.v1beta1.InputConfig) data_); + } + 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.v1beta1.Image)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.Image other = (com.google.cloud.automl.v1beta1.Image) obj; + + boolean result = true; + result = result && getThumbnailUri() + .equals(other.getThumbnailUri()); + result = result && getDataCase().equals( + other.getDataCase()); + if (!result) return false; + switch (dataCase_) { + case 1: + result = result && getImageBytes() + .equals(other.getImageBytes()); + break; + case 6: + result = result && getInputConfig() + .equals(other.getInputConfig()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + THUMBNAIL_URI_FIELD_NUMBER; + hash = (53 * hash) + getThumbnailUri().hashCode(); + switch (dataCase_) { + case 1: + hash = (37 * hash) + IMAGE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getImageBytes().hashCode(); + break; + case 6: + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.Image parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.Image parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.Image parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.Image parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.Image prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A representation of an image.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.Image} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.Image) + com.google.cloud.automl.v1beta1.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_Image_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Image.class, com.google.cloud.automl.v1beta1.Image.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.Image.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + thumbnailUri_ = ""; + + dataCase_ = 0; + data_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_Image_descriptor; + } + + public com.google.cloud.automl.v1beta1.Image getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.Image.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.Image build() { + com.google.cloud.automl.v1beta1.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.Image buildPartial() { + com.google.cloud.automl.v1beta1.Image result = new com.google.cloud.automl.v1beta1.Image(this); + if (dataCase_ == 1) { + result.data_ = data_; + } + if (dataCase_ == 6) { + if (inputConfigBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = inputConfigBuilder_.build(); + } + } + result.thumbnailUri_ = thumbnailUri_; + result.dataCase_ = dataCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.Image) { + return mergeFrom((com.google.cloud.automl.v1beta1.Image)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.Image other) { + if (other == com.google.cloud.automl.v1beta1.Image.getDefaultInstance()) return this; + if (!other.getThumbnailUri().isEmpty()) { + thumbnailUri_ = other.thumbnailUri_; + onChanged(); + } + switch (other.getDataCase()) { + case IMAGE_BYTES: { + setImageBytes(other.getImageBytes()); + break; + } + case INPUT_CONFIG: { + mergeInputConfig(other.getInputConfig()); + break; + } + case DATA_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.Image parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.Image) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int dataCase_ = 0; + private java.lang.Object data_; + public DataCase + getDataCase() { + return DataCase.forNumber( + dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + + /** + *
+     * Image content represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes image_bytes = 1; + */ + public com.google.protobuf.ByteString getImageBytes() { + if (dataCase_ == 1) { + return (com.google.protobuf.ByteString) data_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * Image content represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes image_bytes = 1; + */ + public Builder setImageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + dataCase_ = 1; + data_ = value; + onChanged(); + return this; + } + /** + *
+     * Image content represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes image_bytes = 1; + */ + public Builder clearImageBytes() { + if (dataCase_ == 1) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.InputConfig, com.google.cloud.automl.v1beta1.InputConfig.Builder, com.google.cloud.automl.v1beta1.InputConfigOrBuilder> inputConfigBuilder_; + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public boolean hasInputConfig() { + return dataCase_ == 6; + } + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public com.google.cloud.automl.v1beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + if (dataCase_ == 6) { + return (com.google.cloud.automl.v1beta1.InputConfig) data_; + } + return com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance(); + } else { + if (dataCase_ == 6) { + return inputConfigBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance(); + } + } + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public Builder setInputConfig(com.google.cloud.automl.v1beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + dataCase_ = 6; + return this; + } + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public Builder setInputConfig( + com.google.cloud.automl.v1beta1.InputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 6; + return this; + } + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public Builder mergeInputConfig(com.google.cloud.automl.v1beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (dataCase_ == 6 && + data_ != com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance()) { + data_ = com.google.cloud.automl.v1beta1.InputConfig.newBuilder((com.google.cloud.automl.v1beta1.InputConfig) data_) + .mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 6) { + inputConfigBuilder_.mergeFrom(value); + } + inputConfigBuilder_.setMessage(value); + } + dataCase_ = 6; + return this; + } + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + if (dataCase_ == 6) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 6) { + dataCase_ = 0; + data_ = null; + } + inputConfigBuilder_.clear(); + } + return this; + } + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public com.google.cloud.automl.v1beta1.InputConfig.Builder getInputConfigBuilder() { + return getInputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + public com.google.cloud.automl.v1beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + if ((dataCase_ == 6) && (inputConfigBuilder_ != null)) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 6) { + return (com.google.cloud.automl.v1beta1.InputConfig) data_; + } + return com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance(); + } + } + /** + *
+     * An input config specifying the content of the image.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.InputConfig, com.google.cloud.automl.v1beta1.InputConfig.Builder, com.google.cloud.automl.v1beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + if (!(dataCase_ == 6)) { + data_ = com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance(); + } + inputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.InputConfig, com.google.cloud.automl.v1beta1.InputConfig.Builder, com.google.cloud.automl.v1beta1.InputConfigOrBuilder>( + (com.google.cloud.automl.v1beta1.InputConfig) data_, + getParentForChildren(), + isClean()); + data_ = null; + } + dataCase_ = 6; + onChanged();; + return inputConfigBuilder_; + } + + private java.lang.Object thumbnailUri_ = ""; + /** + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public java.lang.String getThumbnailUri() { + java.lang.Object ref = thumbnailUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + thumbnailUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public com.google.protobuf.ByteString + getThumbnailUriBytes() { + java.lang.Object ref = thumbnailUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + thumbnailUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public Builder setThumbnailUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + thumbnailUri_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public Builder clearThumbnailUri() { + + thumbnailUri_ = getDefaultInstance().getThumbnailUri(); + onChanged(); + return this; + } + /** + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public Builder setThumbnailUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + thumbnailUri_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.Image) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Image) + private static final com.google.cloud.automl.v1beta1.Image DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.Image(); + } + + public static com.google.cloud.automl.v1beta1.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Image(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationDatasetMetadata.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationDatasetMetadata.java new file mode 100644 index 000000000000..8895613f8983 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationDatasetMetadata.java @@ -0,0 +1,515 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/image.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Dataset metadata that is specific to image classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} + */ +public final class ImageClassificationDatasetMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) + ImageClassificationDatasetMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImageClassificationDatasetMetadata.newBuilder() to construct. + private ImageClassificationDatasetMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImageClassificationDatasetMetadata() { + classificationType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImageClassificationDatasetMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + classificationType_ = rawValue; + 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.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.class, com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.Builder.class); + } + + public static final int CLASSIFICATION_TYPE_FIELD_NUMBER = 1; + private int classificationType_; + /** + *
+   * Required.
+   * Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + *
+   * Required.
+   * Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType getClassificationType() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType result = com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (classificationType_ != com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, classificationType_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (classificationType_ != com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, classificationType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata other = (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) obj; + + boolean result = true; + result = result && classificationType_ == other.classificationType_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLASSIFICATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + classificationType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Dataset metadata that is specific to image classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.class, com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + classificationType_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_descriptor; + } + + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata build() { + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata buildPartial() { + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata result = new com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata(this); + result.classificationType_ = classificationType_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata other) { + if (other == com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.getDefaultInstance()) return this; + if (other.classificationType_ != 0) { + setClassificationTypeValue(other.getClassificationTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int classificationType_ = 0; + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public Builder setClassificationTypeValue(int value) { + classificationType_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType getClassificationType() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType result = com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.UNRECOGNIZED : result; + } + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public Builder setClassificationType(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType value) { + if (value == null) { + throw new NullPointerException(); + } + + classificationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public Builder clearClassificationType() { + + classificationType_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) + private static final com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata(); + } + + public static com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImageClassificationDatasetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageClassificationDatasetMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationDatasetMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationDatasetMetadataOrBuilder.java new file mode 100644 index 000000000000..79aa7d950b16 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationDatasetMetadataOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/image.proto + +package com.google.cloud.automl.v1beta1; + +public interface ImageClassificationDatasetMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + int getClassificationTypeValue(); + /** + *
+   * Required.
+   * Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType getClassificationType(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadata.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadata.java new file mode 100644 index 000000000000..09ed636821ec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadata.java @@ -0,0 +1,897 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/image.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Model metadata for image classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ImageClassificationModelMetadata} + */ +public final class ImageClassificationModelMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.ImageClassificationModelMetadata) + ImageClassificationModelMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImageClassificationModelMetadata.newBuilder() to construct. + private ImageClassificationModelMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImageClassificationModelMetadata() { + baseModelId_ = ""; + trainBudget_ = 0L; + trainCost_ = 0L; + stopReason_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImageClassificationModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + baseModelId_ = s; + break; + } + case 16: { + + trainBudget_ = input.readInt64(); + break; + } + case 24: { + + trainCost_ = input.readInt64(); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + stopReason_ = s; + 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.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.class, com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.Builder.class); + } + + public static final int BASE_MODEL_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object baseModelId_; + /** + *
+   * Optional. The ID of the `base` model. If it is specified, the new model
+   * will be created based on the `base` model. Otherwise, the new model will be
+   * created from scratch. The `base` model is expected to be in the same
+   * `project` and `location` as the new model to create.
+   * 
+ * + * string base_model_id = 1; + */ + public java.lang.String getBaseModelId() { + java.lang.Object ref = baseModelId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseModelId_ = s; + return s; + } + } + /** + *
+   * Optional. The ID of the `base` model. If it is specified, the new model
+   * will be created based on the `base` model. Otherwise, the new model will be
+   * created from scratch. The `base` model is expected to be in the same
+   * `project` and `location` as the new model to create.
+   * 
+ * + * string base_model_id = 1; + */ + public com.google.protobuf.ByteString + getBaseModelIdBytes() { + java.lang.Object ref = baseModelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + baseModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRAIN_BUDGET_FIELD_NUMBER = 2; + private long trainBudget_; + /** + *
+   * Required. The train budget of creating this model. The actual
+   * `train_cost` will be equal or less than this value.
+   * 
+ * + * int64 train_budget = 2; + */ + public long getTrainBudget() { + return trainBudget_; + } + + public static final int TRAIN_COST_FIELD_NUMBER = 3; + private long trainCost_; + /** + *
+   * Output only. The actual train cost of creating this model. If this
+   * model is created from a `base` model, the train cost used to create the
+   * `base` model are not included.
+   * 
+ * + * int64 train_cost = 3; + */ + public long getTrainCost() { + return trainCost_; + } + + public static final int STOP_REASON_FIELD_NUMBER = 5; + private volatile java.lang.Object stopReason_; + /** + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. BUDGET_REACHED, CONVERGED.
+   * 
+ * + * string stop_reason = 5; + */ + public java.lang.String getStopReason() { + java.lang.Object ref = stopReason_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stopReason_ = s; + return s; + } + } + /** + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. BUDGET_REACHED, CONVERGED.
+   * 
+ * + * string stop_reason = 5; + */ + public com.google.protobuf.ByteString + getStopReasonBytes() { + java.lang.Object ref = stopReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stopReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getBaseModelIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, baseModelId_); + } + if (trainBudget_ != 0L) { + output.writeInt64(2, trainBudget_); + } + if (trainCost_ != 0L) { + output.writeInt64(3, trainCost_); + } + if (!getStopReasonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, stopReason_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getBaseModelIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, baseModelId_); + } + if (trainBudget_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, trainBudget_); + } + if (trainCost_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, trainCost_); + } + if (!getStopReasonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, stopReason_); + } + 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.v1beta1.ImageClassificationModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata other = (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) obj; + + boolean result = true; + result = result && getBaseModelId() + .equals(other.getBaseModelId()); + result = result && (getTrainBudget() + == other.getTrainBudget()); + result = result && (getTrainCost() + == other.getTrainCost()); + result = result && getStopReason() + .equals(other.getStopReason()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BASE_MODEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getBaseModelId().hashCode(); + hash = (37 * hash) + TRAIN_BUDGET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTrainBudget()); + hash = (37 * hash) + TRAIN_COST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTrainCost()); + hash = (37 * hash) + STOP_REASON_FIELD_NUMBER; + hash = (53 * hash) + getStopReason().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Model metadata for image classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ImageClassificationModelMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ImageClassificationModelMetadata) + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.class, com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + baseModelId_ = ""; + + trainBudget_ = 0L; + + trainCost_ = 0L; + + stopReason_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ImageProto.internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_descriptor; + } + + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata build() { + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata buildPartial() { + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata result = new com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata(this); + result.baseModelId_ = baseModelId_; + result.trainBudget_ = trainBudget_; + result.trainCost_ = trainCost_; + result.stopReason_ = stopReason_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata other) { + if (other == com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance()) return this; + if (!other.getBaseModelId().isEmpty()) { + baseModelId_ = other.baseModelId_; + onChanged(); + } + if (other.getTrainBudget() != 0L) { + setTrainBudget(other.getTrainBudget()); + } + if (other.getTrainCost() != 0L) { + setTrainCost(other.getTrainCost()); + } + if (!other.getStopReason().isEmpty()) { + stopReason_ = other.stopReason_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object baseModelId_ = ""; + /** + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model is expected to be in the same
+     * `project` and `location` as the new model to create.
+     * 
+ * + * string base_model_id = 1; + */ + public java.lang.String getBaseModelId() { + java.lang.Object ref = baseModelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseModelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model is expected to be in the same
+     * `project` and `location` as the new model to create.
+     * 
+ * + * string base_model_id = 1; + */ + public com.google.protobuf.ByteString + getBaseModelIdBytes() { + java.lang.Object ref = baseModelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + baseModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model is expected to be in the same
+     * `project` and `location` as the new model to create.
+     * 
+ * + * string base_model_id = 1; + */ + public Builder setBaseModelId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + baseModelId_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model is expected to be in the same
+     * `project` and `location` as the new model to create.
+     * 
+ * + * string base_model_id = 1; + */ + public Builder clearBaseModelId() { + + baseModelId_ = getDefaultInstance().getBaseModelId(); + onChanged(); + return this; + } + /** + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model is expected to be in the same
+     * `project` and `location` as the new model to create.
+     * 
+ * + * string base_model_id = 1; + */ + public Builder setBaseModelIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + baseModelId_ = value; + onChanged(); + return this; + } + + private long trainBudget_ ; + /** + *
+     * Required. The train budget of creating this model. The actual
+     * `train_cost` will be equal or less than this value.
+     * 
+ * + * int64 train_budget = 2; + */ + public long getTrainBudget() { + return trainBudget_; + } + /** + *
+     * Required. The train budget of creating this model. The actual
+     * `train_cost` will be equal or less than this value.
+     * 
+ * + * int64 train_budget = 2; + */ + public Builder setTrainBudget(long value) { + + trainBudget_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The train budget of creating this model. The actual
+     * `train_cost` will be equal or less than this value.
+     * 
+ * + * int64 train_budget = 2; + */ + public Builder clearTrainBudget() { + + trainBudget_ = 0L; + onChanged(); + return this; + } + + private long trainCost_ ; + /** + *
+     * Output only. The actual train cost of creating this model. If this
+     * model is created from a `base` model, the train cost used to create the
+     * `base` model are not included.
+     * 
+ * + * int64 train_cost = 3; + */ + public long getTrainCost() { + return trainCost_; + } + /** + *
+     * Output only. The actual train cost of creating this model. If this
+     * model is created from a `base` model, the train cost used to create the
+     * `base` model are not included.
+     * 
+ * + * int64 train_cost = 3; + */ + public Builder setTrainCost(long value) { + + trainCost_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The actual train cost of creating this model. If this
+     * model is created from a `base` model, the train cost used to create the
+     * `base` model are not included.
+     * 
+ * + * int64 train_cost = 3; + */ + public Builder clearTrainCost() { + + trainCost_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object stopReason_ = ""; + /** + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. BUDGET_REACHED, CONVERGED.
+     * 
+ * + * string stop_reason = 5; + */ + public java.lang.String getStopReason() { + java.lang.Object ref = stopReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stopReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. BUDGET_REACHED, CONVERGED.
+     * 
+ * + * string stop_reason = 5; + */ + public com.google.protobuf.ByteString + getStopReasonBytes() { + java.lang.Object ref = stopReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stopReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. BUDGET_REACHED, CONVERGED.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder setStopReason( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + stopReason_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. BUDGET_REACHED, CONVERGED.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder clearStopReason() { + + stopReason_ = getDefaultInstance().getStopReason(); + onChanged(); + return this; + } + /** + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. BUDGET_REACHED, CONVERGED.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder setStopReasonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + stopReason_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ImageClassificationModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageClassificationModelMetadata) + private static final com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata(); + } + + public static com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImageClassificationModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageClassificationModelMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadataOrBuilder.java new file mode 100644 index 000000000000..94451f6cf2da --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadataOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/image.proto + +package com.google.cloud.automl.v1beta1; + +public interface ImageClassificationModelMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ImageClassificationModelMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Optional. The ID of the `base` model. If it is specified, the new model
+   * will be created based on the `base` model. Otherwise, the new model will be
+   * created from scratch. The `base` model is expected to be in the same
+   * `project` and `location` as the new model to create.
+   * 
+ * + * string base_model_id = 1; + */ + java.lang.String getBaseModelId(); + /** + *
+   * Optional. The ID of the `base` model. If it is specified, the new model
+   * will be created based on the `base` model. Otherwise, the new model will be
+   * created from scratch. The `base` model is expected to be in the same
+   * `project` and `location` as the new model to create.
+   * 
+ * + * string base_model_id = 1; + */ + com.google.protobuf.ByteString + getBaseModelIdBytes(); + + /** + *
+   * Required. The train budget of creating this model. The actual
+   * `train_cost` will be equal or less than this value.
+   * 
+ * + * int64 train_budget = 2; + */ + long getTrainBudget(); + + /** + *
+   * Output only. The actual train cost of creating this model. If this
+   * model is created from a `base` model, the train cost used to create the
+   * `base` model are not included.
+   * 
+ * + * int64 train_cost = 3; + */ + long getTrainCost(); + + /** + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. BUDGET_REACHED, CONVERGED.
+   * 
+ * + * string stop_reason = 5; + */ + java.lang.String getStopReason(); + /** + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. BUDGET_REACHED, CONVERGED.
+   * 
+ * + * string stop_reason = 5; + */ + com.google.protobuf.ByteString + getStopReasonBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageOrBuilder.java new file mode 100644 index 000000000000..e8f921324b3b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +public interface ImageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.Image) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Image content represented as a stream of bytes.
+   * Note: As with all `bytes` fields, protobuffers use a pure binary
+   * representation, whereas JSON representations use base64.
+   * 
+ * + * bytes image_bytes = 1; + */ + com.google.protobuf.ByteString getImageBytes(); + + /** + *
+   * An input config specifying the content of the image.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + boolean hasInputConfig(); + /** + *
+   * An input config specifying the content of the image.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + com.google.cloud.automl.v1beta1.InputConfig getInputConfig(); + /** + *
+   * An input config specifying the content of the image.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 6; + */ + com.google.cloud.automl.v1beta1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + *
+   * Output only. HTTP URI to the thumbnail image.
+   * 
+ * + * string thumbnail_uri = 4; + */ + java.lang.String getThumbnailUri(); + /** + *
+   * Output only. HTTP URI to the thumbnail image.
+   * 
+ * + * string thumbnail_uri = 4; + */ + com.google.protobuf.ByteString + getThumbnailUriBytes(); + + public com.google.cloud.automl.v1beta1.Image.DataCase getDataCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageProto.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageProto.java new file mode 100644 index 000000000000..c7f91c5ae280 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageProto.java @@ -0,0 +1,84 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/image.proto + +package com.google.cloud.automl.v1beta1; + +public final class ImageProto { + private ImageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_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/v1beta1/image.prot" + + "o\022\033google.cloud.automl.v1beta1\032\034google/a" + + "pi/annotations.proto\0320google/cloud/autom" + + "l/v1beta1/classification.proto\032\037google/p" + + "rotobuf/timestamp.proto\"r\n\"ImageClassifi" + + "cationDatasetMetadata\022L\n\023classification_" + + "type\030\001 \001(\0162/.google.cloud.automl.v1beta1" + + ".ClassificationType\"x\n ImageClassificati" + + "onModelMetadata\022\025\n\rbase_model_id\030\001 \001(\t\022\024" + + "\n\014train_budget\030\002 \001(\003\022\022\n\ntrain_cost\030\003 \001(\003" + + "\022\023\n\013stop_reason\030\005 \001(\tBr\n\037com.google.clou" + + "d.automl.v1beta1B\nImageProtoP\001ZAgoogle.g" + + "olang.org/genproto/googleapis/cloud/auto" + + "ml/v1beta1;automlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ImageClassificationDatasetMetadata_descriptor, + new java.lang.String[] { "ClassificationType", }); + internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_descriptor, + new java.lang.String[] { "BaseModelId", "TrainBudget", "TrainCost", "StopReason", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImportDataRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImportDataRequest.java new file mode 100644 index 000000000000..a7bc7e5bcde7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImportDataRequest.java @@ -0,0 +1,788 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportData].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ImportDataRequest} + */ +public final class ImportDataRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + com.google.cloud.automl.v1beta1.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = input.readMessage(com.google.cloud.automl.v1beta1.InputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ImportDataRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ImportDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ImportDataRequest.class, com.google.cloud.automl.v1beta1.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.v1beta1.InputConfig inputConfig_; + /** + *
+   * Required. The desired input location.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + *
+   * Required. The desired input location.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1beta1.InputConfig getInputConfig() { + return inputConfig_ == null ? com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance() : inputConfig_; + } + /** + *
+   * Required. The desired input location.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.ImportDataRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ImportDataRequest other = (com.google.cloud.automl.v1beta1.ImportDataRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasInputConfig() == other.hasInputConfig()); + if (hasInputConfig()) { + result = result && getInputConfig() + .equals(other.getInputConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.ImportDataRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ImportDataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ImportDataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ImportDataRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ImportDataRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ImportDataRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.ImportData].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ImportDataRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ImportDataRequest) + com.google.cloud.automl.v1beta1.ImportDataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ImportDataRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ImportDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ImportDataRequest.class, com.google.cloud.automl.v1beta1.ImportDataRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ImportDataRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.ImportDataRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ImportDataRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ImportDataRequest build() { + com.google.cloud.automl.v1beta1.ImportDataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ImportDataRequest buildPartial() { + com.google.cloud.automl.v1beta1.ImportDataRequest result = new com.google.cloud.automl.v1beta1.ImportDataRequest(this); + result.name_ = name_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ImportDataRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.ImportDataRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ImportDataRequest other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ImportDataRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.InputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.InputConfig, com.google.cloud.automl.v1beta1.InputConfig.Builder, com.google.cloud.automl.v1beta1.InputConfigOrBuilder> inputConfigBuilder_; + /** + *
+     * Required. The desired input location.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + *
+     * Required. The desired input location.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null ? com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance() : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Required. The desired input location.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public Builder setInputConfig(com.google.cloud.automl.v1beta1.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.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public Builder setInputConfig( + com.google.cloud.automl.v1beta1.InputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The desired input location.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public Builder mergeInputConfig(com.google.cloud.automl.v1beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.automl.v1beta1.InputConfig.newBuilder(inputConfig_).mergeFrom(value).buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The desired input location.
+     * 
+ * + * .google.cloud.automl.v1beta1.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.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1beta1.InputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The desired input location.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + public com.google.cloud.automl.v1beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null ? + com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance() : inputConfig_; + } + } + /** + *
+     * Required. The desired input location.
+     * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.InputConfig, com.google.cloud.automl.v1beta1.InputConfig.Builder, com.google.cloud.automl.v1beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.InputConfig, com.google.cloud.automl.v1beta1.InputConfig.Builder, com.google.cloud.automl.v1beta1.InputConfigOrBuilder>( + getInputConfig(), + getParentForChildren(), + isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ImportDataRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImportDataRequest) + private static final com.google.cloud.automl.v1beta1.ImportDataRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ImportDataRequest(); + } + + public static com.google.cloud.automl.v1beta1.ImportDataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ImportDataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImportDataRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImportDataRequestOrBuilder.java new file mode 100644 index 000000000000..a755b382fa30 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImportDataRequestOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface ImportDataRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + boolean hasInputConfig(); + /** + *
+   * Required. The desired input location.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + com.google.cloud.automl.v1beta1.InputConfig getInputConfig(); + /** + *
+   * Required. The desired input location.
+   * 
+ * + * .google.cloud.automl.v1beta1.InputConfig input_config = 3; + */ + com.google.cloud.automl.v1beta1.InputConfigOrBuilder getInputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfig.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfig.java new file mode 100644 index 000000000000..05971b945600 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfig.java @@ -0,0 +1,717 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Input configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.InputConfig} + */ +public final class InputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.automl.v1beta1.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.automl.v1beta1.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage(com.google.cloud.automl.v1beta1.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + 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.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_InputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.InputConfig.class, com.google.cloud.automl.v1beta1.InputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + public enum SourceCase + implements com.google.protobuf.Internal.EnumLite { + GCS_SOURCE(1), + SOURCE_NOT_SET(0); + private final int value; + private SourceCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: return GCS_SOURCE; + case 0: return SOURCE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public SourceCase + getSourceCase() { + return SourceCase.forNumber( + sourceCase_); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + /** + *
+   * The GCS location for the input content.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + *
+   * The GCS location for the input content.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1beta1.GcsSource getGcsSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.automl.v1beta1.GcsSource) source_; + } + return com.google.cloud.automl.v1beta1.GcsSource.getDefaultInstance(); + } + /** + *
+   * The GCS location for the input content.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.automl.v1beta1.GcsSource) source_; + } + return com.google.cloud.automl.v1beta1.GcsSource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.automl.v1beta1.GcsSource) source_); + } + unknownFields.writeTo(output); + } + + 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.v1beta1.GcsSource) source_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1beta1.InputConfig)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.InputConfig other = (com.google.cloud.automl.v1beta1.InputConfig) obj; + + boolean result = true; + result = result && getSourceCase().equals( + other.getSourceCase()); + if (!result) return false; + switch (sourceCase_) { + case 1: + result = result && getGcsSource() + .equals(other.getGcsSource()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.InputConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.InputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.InputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.InputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.InputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.InputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.InputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.InputConfig) + com.google.cloud.automl.v1beta1.InputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_InputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.InputConfig.class, com.google.cloud.automl.v1beta1.InputConfig.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + sourceCase_ = 0; + source_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_InputConfig_descriptor; + } + + public com.google.cloud.automl.v1beta1.InputConfig getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.InputConfig build() { + com.google.cloud.automl.v1beta1.InputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.InputConfig buildPartial() { + com.google.cloud.automl.v1beta1.InputConfig result = new com.google.cloud.automl.v1beta1.InputConfig(this); + if (sourceCase_ == 1) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.InputConfig) { + return mergeFrom((com.google.cloud.automl.v1beta1.InputConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.InputConfig other) { + if (other == com.google.cloud.automl.v1beta1.InputConfig.getDefaultInstance()) return this; + switch (other.getSourceCase()) { + case GCS_SOURCE: { + mergeGcsSource(other.getGcsSource()); + break; + } + case SOURCE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.InputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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 com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.GcsSource, com.google.cloud.automl.v1beta1.GcsSource.Builder, com.google.cloud.automl.v1beta1.GcsSourceOrBuilder> gcsSourceBuilder_; + /** + *
+     * The GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + *
+     * The GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1beta1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.automl.v1beta1.GcsSource) source_; + } + return com.google.cloud.automl.v1beta1.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.GcsSource.getDefaultInstance(); + } + } + /** + *
+     * The GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.automl.v1beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + *
+     * The GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.cloud.automl.v1beta1.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + *
+     * The GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.automl.v1beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1 && + source_ != com.google.cloud.automl.v1beta1.GcsSource.getDefaultInstance()) { + source_ = com.google.cloud.automl.v1beta1.GcsSource.newBuilder((com.google.cloud.automl.v1beta1.GcsSource) source_) + .mergeFrom(value).buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + gcsSourceBuilder_.mergeFrom(value); + } + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + *
+     * The GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.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 GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1beta1.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + *
+     * The GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 1) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.automl.v1beta1.GcsSource) source_; + } + return com.google.cloud.automl.v1beta1.GcsSource.getDefaultInstance(); + } + } + /** + *
+     * The GCS location for the input content.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.GcsSource, com.google.cloud.automl.v1beta1.GcsSource.Builder, com.google.cloud.automl.v1beta1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.automl.v1beta1.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.GcsSource, com.google.cloud.automl.v1beta1.GcsSource.Builder, com.google.cloud.automl.v1beta1.GcsSourceOrBuilder>( + (com.google.cloud.automl.v1beta1.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged();; + return gcsSourceBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.InputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.InputConfig) + private static final com.google.cloud.automl.v1beta1.InputConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.InputConfig(); + } + + public static com.google.cloud.automl.v1beta1.InputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.InputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfigOrBuilder.java new file mode 100644 index 000000000000..659a3532b3cc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfigOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +public interface InputConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.InputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The GCS location for the input content.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + boolean hasGcsSource(); + /** + *
+   * The GCS location for the input content.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + com.google.cloud.automl.v1beta1.GcsSource getGcsSource(); + /** + *
+   * The GCS location for the input content.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsSource gcs_source = 1; + */ + com.google.cloud.automl.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + public com.google.cloud.automl.v1beta1.InputConfig.SourceCase getSourceCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Io.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Io.java new file mode 100644 index 000000000000..07f7cf34db64 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Io.java @@ -0,0 +1,100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_InputConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_InputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_OutputConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_GcsSource_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_GcsDestination_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_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$google/cloud/automl/v1beta1/io.proto\022\033" + + "google.cloud.automl.v1beta1\032\034google/api/" + + "annotations.proto\"U\n\013InputConfig\022<\n\ngcs_" + + "source\030\001 \001(\0132&.google.cloud.automl.v1bet" + + "a1.GcsSourceH\000B\010\n\006source\"e\n\014OutputConfig" + + "\022F\n\017gcs_destination\030\001 \001(\0132+.google.cloud" + + ".automl.v1beta1.GcsDestinationH\000B\r\n\013dest" + + "ination\"\037\n\tGcsSource\022\022\n\ninput_uris\030\001 \003(\t" + + "\"+\n\016GcsDestination\022\031\n\021output_uri_prefix\030" + + "\001 \001(\tBf\n\037com.google.cloud.automl.v1beta1" + + "P\001ZAgoogle.golang.org/genproto/googleapi" + + "s/cloud/automl/v1beta1;automlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_InputConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_InputConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_InputConfig_descriptor, + new java.lang.String[] { "GcsSource", "Source", }); + internal_static_google_cloud_automl_v1beta1_OutputConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_OutputConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_OutputConfig_descriptor, + new java.lang.String[] { "GcsDestination", "Destination", }); + internal_static_google_cloud_automl_v1beta1_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_automl_v1beta1_GcsSource_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_GcsSource_descriptor, + new java.lang.String[] { "InputUris", }); + internal_static_google_cloud_automl_v1beta1_GcsDestination_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_automl_v1beta1_GcsDestination_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_GcsDestination_descriptor, + new java.lang.String[] { "OutputUriPrefix", }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsRequest.java new file mode 100644 index 000000000000..0ad5757c1dc4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsRequest.java @@ -0,0 +1,989 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListDatasetsRequest} + */ +public final class ListDatasetsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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_ = ""; + pageSize_ = 0; + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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; + } + } + } + } 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListDatasetsRequest.class, com.google.cloud.automl.v1beta1.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.
+   * An example of using the filter is:
+   *   * `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.
+   * An example of using the filter is:
+   *   * `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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+   * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+   * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.ListDatasetsRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ListDatasetsRequest other = (com.google.cloud.automl.v1beta1.ListDatasetsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.ListDatasetsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ListDatasetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.ListDatasets].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListDatasetsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ListDatasetsRequest) + com.google.cloud.automl.v1beta1.ListDatasetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListDatasetsRequest.class, com.google.cloud.automl.v1beta1.ListDatasetsRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.ListDatasetsRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ListDatasetsRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ListDatasetsRequest build() { + com.google.cloud.automl.v1beta1.ListDatasetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ListDatasetsRequest buildPartial() { + com.google.cloud.automl.v1beta1.ListDatasetsRequest result = new com.google.cloud.automl.v1beta1.ListDatasetsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ListDatasetsRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.ListDatasetsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ListDatasetsRequest other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ListDatasetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.
+     * An example of using the filter is:
+     *   * `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.
+     * An example of using the filter is:
+     *   * `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.
+     * An example of using the filter is:
+     *   * `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.
+     * An example of using the filter is:
+     *   * `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.
+     * An example of using the filter is:
+     *   * `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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+     * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ListDatasetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListDatasetsRequest) + private static final com.google.cloud.automl.v1beta1.ListDatasetsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ListDatasetsRequest(); + } + + public static com.google.cloud.automl.v1beta1.ListDatasetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ListDatasetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsRequestOrBuilder.java new file mode 100644 index 000000000000..81086fced9b1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface ListDatasetsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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.
+   * An example of using the filter is:
+   *   * `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.
+   * An example of using the filter is:
+   *   * `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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+   * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse.next_page_token] of the previous
+   * [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets] call.
+   * 
+ * + * string page_token = 6; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsResponse.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsResponse.java new file mode 100644 index 000000000000..d4e1fa1d0df8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsResponse.java @@ -0,0 +1,999 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Response message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListDatasetsResponse} + */ +public final class ListDatasetsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + datasets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + datasets_.add( + input.readMessage(com.google.cloud.automl.v1beta1.Dataset.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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) == 0x00000001)) { + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListDatasetsResponse.class, com.google.cloud.automl.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public java.util.List getDatasetsList() { + return datasets_; + } + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public java.util.List + getDatasetsOrBuilderList() { + return datasets_; + } + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public int getDatasetsCount() { + return datasets_.size(); + } + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1beta1.Dataset getDatasets(int index) { + return datasets_.get(index); + } + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.ListDatasetsResponse)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ListDatasetsResponse other = (com.google.cloud.automl.v1beta1.ListDatasetsResponse) obj; + + boolean result = true; + result = result && getDatasetsList() + .equals(other.getDatasetsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.ListDatasetsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ListDatasetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.ListDatasets].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListDatasetsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ListDatasetsResponse) + com.google.cloud.automl.v1beta1.ListDatasetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListDatasetsResponse.class, com.google.cloud.automl.v1beta1.ListDatasetsResponse.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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(); + } + } + public Builder clear() { + super.clear(); + if (datasetsBuilder_ == null) { + datasets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + datasetsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListDatasetsResponse_descriptor; + } + + public com.google.cloud.automl.v1beta1.ListDatasetsResponse getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ListDatasetsResponse.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ListDatasetsResponse build() { + com.google.cloud.automl.v1beta1.ListDatasetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ListDatasetsResponse buildPartial() { + com.google.cloud.automl.v1beta1.ListDatasetsResponse result = new com.google.cloud.automl.v1beta1.ListDatasetsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (datasetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + 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; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ListDatasetsResponse) { + return mergeFrom((com.google.cloud.automl.v1beta1.ListDatasetsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ListDatasetsResponse other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ListDatasetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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) == 0x00000001)) { + datasets_ = new java.util.ArrayList(datasets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Dataset, com.google.cloud.automl.v1beta1.Dataset.Builder, com.google.cloud.automl.v1beta1.DatasetOrBuilder> datasetsBuilder_; + + /** + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public int getDatasetsCount() { + if (datasetsBuilder_ == null) { + return datasets_.size(); + } else { + return datasetsBuilder_.getCount(); + } + } + /** + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1beta1.Dataset getDatasets(int index) { + if (datasetsBuilder_ == null) { + return datasets_.get(index); + } else { + return datasetsBuilder_.getMessage(index); + } + } + /** + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public Builder setDatasets( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public Builder setDatasets( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public Builder addDatasets(com.google.cloud.automl.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public Builder addDatasets( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public Builder addDatasets( + com.google.cloud.automl.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public Builder addDatasets( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1beta1.Dataset.Builder getDatasetsBuilder( + int index) { + return getDatasetsFieldBuilder().getBuilder(index); + } + /** + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1beta1.DatasetOrBuilder getDatasetsOrBuilder( + int index) { + if (datasetsBuilder_ == null) { + return datasets_.get(index); } else { + return datasetsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.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.v1beta1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1beta1.Dataset.Builder addDatasetsBuilder() { + return getDatasetsFieldBuilder().addBuilder( + com.google.cloud.automl.v1beta1.Dataset.getDefaultInstance()); + } + /** + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public com.google.cloud.automl.v1beta1.Dataset.Builder addDatasetsBuilder( + int index) { + return getDatasetsFieldBuilder().addBuilder( + index, com.google.cloud.automl.v1beta1.Dataset.getDefaultInstance()); + } + /** + *
+     * The datasets read.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + public java.util.List + getDatasetsBuilderList() { + return getDatasetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Dataset, com.google.cloud.automl.v1beta1.Dataset.Builder, com.google.cloud.automl.v1beta1.DatasetOrBuilder> + getDatasetsFieldBuilder() { + if (datasetsBuilder_ == null) { + datasetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Dataset, com.google.cloud.automl.v1beta1.Dataset.Builder, com.google.cloud.automl.v1beta1.DatasetOrBuilder>( + datasets_, + ((bitField0_ & 0x00000001) == 0x00000001), + 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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ListDatasetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListDatasetsResponse) + private static final com.google.cloud.automl.v1beta1.ListDatasetsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ListDatasetsResponse(); + } + + public static com.google.cloud.automl.v1beta1.ListDatasetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ListDatasetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsResponseOrBuilder.java new file mode 100644 index 000000000000..0e59479d3fc8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListDatasetsResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface ListDatasetsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ListDatasetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + java.util.List + getDatasetsList(); + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + com.google.cloud.automl.v1beta1.Dataset getDatasets(int index); + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + int getDatasetsCount(); + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + java.util.List + getDatasetsOrBuilderList(); + /** + *
+   * The datasets read.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Dataset datasets = 1; + */ + com.google.cloud.automl.v1beta1.DatasetOrBuilder getDatasetsOrBuilder( + int index); + + /** + *
+   * A token to retrieve next page of results.
+   * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsRequest.page_token] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsRequest.java new file mode 100644 index 000000000000..dbb14acc0685 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsRequest.java @@ -0,0 +1,1020 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListModelEvaluationsRequest} + */ +public final class ListModelEvaluationsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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_ = ""; + pageSize_ = 0; + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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; + } + } + } + } 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest.class, com.google.cloud.automl.v1beta1.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` of the previous
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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` of the previous
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.ListModelEvaluationsRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest other = (com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.ListModelEvaluationsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelEvaluationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelEvaluationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelEvaluationsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelEvaluationsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.ListModelEvaluations].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListModelEvaluationsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ListModelEvaluationsRequest) + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest.class, com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest build() { + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest buildPartial() { + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest result = new com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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` of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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` of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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` of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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` of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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` of the previous
+     * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ListModelEvaluationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListModelEvaluationsRequest) + private static final com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest(); + } + + public static com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsRequestOrBuilder.java new file mode 100644 index 000000000000..39287660c0c1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsRequestOrBuilder.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface ListModelEvaluationsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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` of the previous
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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` of the previous
+   * [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations] call.
+   * 
+ * + * string page_token = 6; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsResponse.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsResponse.java new file mode 100644 index 000000000000..ee97890c3f8b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsResponse.java @@ -0,0 +1,999 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListModelEvaluationsResponse} + */ +public final class ListModelEvaluationsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + modelEvaluation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + modelEvaluation_.add( + input.readMessage(com.google.cloud.automl.v1beta1.ModelEvaluation.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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) == 0x00000001)) { + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.class, com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public java.util.List getModelEvaluationList() { + return modelEvaluation_; + } + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public java.util.List + getModelEvaluationOrBuilderList() { + return modelEvaluation_; + } + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public int getModelEvaluationCount() { + return modelEvaluation_.size(); + } + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1beta1.ModelEvaluation getModelEvaluation(int index) { + return modelEvaluation_.get(index); + } + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1beta1.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 [ListModelEvaluations.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 [ListModelEvaluations.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.ListModelEvaluationsResponse)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse other = (com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse) obj; + + boolean result = true; + result = result && getModelEvaluationList() + .equals(other.getModelEvaluationList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.ListModelEvaluationsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelEvaluationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelEvaluationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelEvaluationsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelEvaluationsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.ListModelEvaluations].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListModelEvaluationsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ListModelEvaluationsResponse) + com.google.cloud.automl.v1beta1.ListModelEvaluationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.class, com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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(); + } + } + public Builder clear() { + super.clear(); + if (modelEvaluationBuilder_ == null) { + modelEvaluation_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + modelEvaluationBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelEvaluationsResponse_descriptor; + } + + public com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse build() { + com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse buildPartial() { + com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse result = new com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (modelEvaluationBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + 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; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse) { + return mergeFrom((com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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) == 0x00000001)) { + modelEvaluation_ = new java.util.ArrayList(modelEvaluation_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ModelEvaluation, com.google.cloud.automl.v1beta1.ModelEvaluation.Builder, com.google.cloud.automl.v1beta1.ModelEvaluationOrBuilder> modelEvaluationBuilder_; + + /** + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public Builder setModelEvaluation( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public Builder setModelEvaluation( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public Builder addModelEvaluation(com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public Builder addModelEvaluation( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public Builder addModelEvaluation( + com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public Builder addModelEvaluation( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1beta1.ModelEvaluation.Builder getModelEvaluationBuilder( + int index) { + return getModelEvaluationFieldBuilder().getBuilder(index); + } + /** + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1beta1.ModelEvaluation.Builder addModelEvaluationBuilder() { + return getModelEvaluationFieldBuilder().addBuilder( + com.google.cloud.automl.v1beta1.ModelEvaluation.getDefaultInstance()); + } + /** + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public com.google.cloud.automl.v1beta1.ModelEvaluation.Builder addModelEvaluationBuilder( + int index) { + return getModelEvaluationFieldBuilder().addBuilder( + index, com.google.cloud.automl.v1beta1.ModelEvaluation.getDefaultInstance()); + } + /** + *
+     * List of model evaluations in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + public java.util.List + getModelEvaluationBuilderList() { + return getModelEvaluationFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ModelEvaluation, com.google.cloud.automl.v1beta1.ModelEvaluation.Builder, com.google.cloud.automl.v1beta1.ModelEvaluationOrBuilder> + getModelEvaluationFieldBuilder() { + if (modelEvaluationBuilder_ == null) { + modelEvaluationBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.ModelEvaluation, com.google.cloud.automl.v1beta1.ModelEvaluation.Builder, com.google.cloud.automl.v1beta1.ModelEvaluationOrBuilder>( + modelEvaluation_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + modelEvaluation_ = null; + } + return modelEvaluationBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token to retrieve next page of results.
+     * Pass to [ListModelEvaluations.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 [ListModelEvaluations.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 [ListModelEvaluations.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 [ListModelEvaluations.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 [ListModelEvaluations.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ListModelEvaluationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListModelEvaluationsResponse) + private static final com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse(); + } + + public static com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsResponseOrBuilder.java new file mode 100644 index 000000000000..99171ef078ec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelEvaluationsResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface ListModelEvaluationsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ListModelEvaluationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + java.util.List + getModelEvaluationList(); + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + com.google.cloud.automl.v1beta1.ModelEvaluation getModelEvaluation(int index); + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + int getModelEvaluationCount(); + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + java.util.List + getModelEvaluationOrBuilderList(); + /** + *
+   * List of model evaluations in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.ModelEvaluation model_evaluation = 1; + */ + com.google.cloud.automl.v1beta1.ModelEvaluationOrBuilder getModelEvaluationOrBuilder( + int index); + + /** + *
+   * A token to retrieve next page of results.
+   * Pass to [ListModelEvaluations.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 [ListModelEvaluations.page_token][] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsRequest.java new file mode 100644 index 000000000000..59890fe22c28 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsRequest.java @@ -0,0 +1,1006 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListModelsRequest} + */ +public final class ListModelsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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_ = ""; + pageSize_ = 0; + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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; + } + } + } + } 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListModelsRequest.class, com.google.cloud.automl.v1beta1.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.
+   *   * `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 sibling 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.
+   *   * `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 sibling 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.v1beta1.ListModelsResponse.next_page_token] of the previous
+   * [AutoMl.ListModels][google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse.next_page_token] of the previous
+   * [AutoMl.ListModels][google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.ListModelsRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ListModelsRequest other = (com.google.cloud.automl.v1beta1.ListModelsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.ListModelsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ListModelsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.ListModels].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListModelsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ListModelsRequest) + com.google.cloud.automl.v1beta1.ListModelsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListModelsRequest.class, com.google.cloud.automl.v1beta1.ListModelsRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.ListModelsRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ListModelsRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ListModelsRequest build() { + com.google.cloud.automl.v1beta1.ListModelsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ListModelsRequest buildPartial() { + com.google.cloud.automl.v1beta1.ListModelsRequest result = new com.google.cloud.automl.v1beta1.ListModelsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ListModelsRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.ListModelsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ListModelsRequest other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ListModelsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.
+     *   * `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 sibling 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.
+     *   * `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 sibling 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.
+     *   * `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 sibling 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.
+     *   * `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 sibling 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.
+     *   * `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 sibling 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.v1beta1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse.next_page_token] of the previous
+     * [AutoMl.ListModels][google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ListModelsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListModelsRequest) + private static final com.google.cloud.automl.v1beta1.ListModelsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ListModelsRequest(); + } + + public static com.google.cloud.automl.v1beta1.ListModelsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ListModelsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsRequestOrBuilder.java new file mode 100644 index 000000000000..caac8d75c1d9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsRequestOrBuilder.java @@ -0,0 +1,92 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface ListModelsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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.
+   *   * `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 sibling 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.
+   *   * `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 sibling 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.v1beta1.ListModelsResponse.next_page_token] of the previous
+   * [AutoMl.ListModels][google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse.next_page_token] of the previous
+   * [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels] call.
+   * 
+ * + * string page_token = 6; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsResponse.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsResponse.java new file mode 100644 index 000000000000..5f2b30d3e03f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsResponse.java @@ -0,0 +1,999 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Response message for [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListModelsResponse} + */ +public final class ListModelsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + model_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + model_.add( + input.readMessage(com.google.cloud.automl.v1beta1.Model.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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) == 0x00000001)) { + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListModelsResponse.class, com.google.cloud.automl.v1beta1.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.v1beta1.Model model = 1; + */ + public java.util.List getModelList() { + return model_; + } + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + public java.util.List + getModelOrBuilderList() { + return model_; + } + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + public int getModelCount() { + return model_.size(); + } + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + public com.google.cloud.automl.v1beta1.Model getModel(int index) { + return model_.get(index); + } + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + public com.google.cloud.automl.v1beta1.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 [ListModels.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 [ListModels.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.ListModelsResponse)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ListModelsResponse other = (com.google.cloud.automl.v1beta1.ListModelsResponse) obj; + + boolean result = true; + result = result && getModelList() + .equals(other.getModelList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.ListModelsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ListModelsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ListModelsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.AutoMl.ListModels].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ListModelsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ListModelsResponse) + com.google.cloud.automl.v1beta1.ListModelsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ListModelsResponse.class, com.google.cloud.automl.v1beta1.ListModelsResponse.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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(); + } + } + public Builder clear() { + super.clear(); + if (modelBuilder_ == null) { + model_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + modelBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_ListModelsResponse_descriptor; + } + + public com.google.cloud.automl.v1beta1.ListModelsResponse getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ListModelsResponse.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ListModelsResponse build() { + com.google.cloud.automl.v1beta1.ListModelsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ListModelsResponse buildPartial() { + com.google.cloud.automl.v1beta1.ListModelsResponse result = new com.google.cloud.automl.v1beta1.ListModelsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (modelBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + 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; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ListModelsResponse) { + return mergeFrom((com.google.cloud.automl.v1beta1.ListModelsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ListModelsResponse other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ListModelsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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) == 0x00000001)) { + model_ = new java.util.ArrayList(model_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Model, com.google.cloud.automl.v1beta1.Model.Builder, com.google.cloud.automl.v1beta1.ModelOrBuilder> modelBuilder_; + + /** + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.Model model = 1; + */ + public com.google.cloud.automl.v1beta1.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.v1beta1.Model model = 1; + */ + public Builder setModel( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.Model model = 1; + */ + public Builder setModel( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.Model model = 1; + */ + public Builder addModel(com.google.cloud.automl.v1beta1.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.v1beta1.Model model = 1; + */ + public Builder addModel( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.Model model = 1; + */ + public Builder addModel( + com.google.cloud.automl.v1beta1.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.v1beta1.Model model = 1; + */ + public Builder addModel( + int index, com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Model model = 1; + */ + public com.google.cloud.automl.v1beta1.Model.Builder getModelBuilder( + int index) { + return getModelFieldBuilder().getBuilder(index); + } + /** + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + public com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.Model model = 1; + */ + public com.google.cloud.automl.v1beta1.Model.Builder addModelBuilder() { + return getModelFieldBuilder().addBuilder( + com.google.cloud.automl.v1beta1.Model.getDefaultInstance()); + } + /** + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + public com.google.cloud.automl.v1beta1.Model.Builder addModelBuilder( + int index) { + return getModelFieldBuilder().addBuilder( + index, com.google.cloud.automl.v1beta1.Model.getDefaultInstance()); + } + /** + *
+     * List of models in the requested page.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + public java.util.List + getModelBuilderList() { + return getModelFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Model, com.google.cloud.automl.v1beta1.Model.Builder, com.google.cloud.automl.v1beta1.ModelOrBuilder> + getModelFieldBuilder() { + if (modelBuilder_ == null) { + modelBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Model, com.google.cloud.automl.v1beta1.Model.Builder, com.google.cloud.automl.v1beta1.ModelOrBuilder>( + model_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + model_ = null; + } + return modelBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token to retrieve next page of results.
+     * Pass to [ListModels.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 [ListModels.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 [ListModels.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 [ListModels.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 [ListModels.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ListModelsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListModelsResponse) + private static final com.google.cloud.automl.v1beta1.ListModelsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ListModelsResponse(); + } + + public static com.google.cloud.automl.v1beta1.ListModelsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ListModelsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsResponseOrBuilder.java new file mode 100644 index 000000000000..5929350d083b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ListModelsResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface ListModelsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ListModelsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + java.util.List + getModelList(); + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + com.google.cloud.automl.v1beta1.Model getModel(int index); + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + int getModelCount(); + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + java.util.List + getModelOrBuilderList(); + /** + *
+   * List of models in the requested page.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Model model = 1; + */ + com.google.cloud.automl.v1beta1.ModelOrBuilder getModelOrBuilder( + int index); + + /** + *
+   * A token to retrieve next page of results.
+   * Pass to [ListModels.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 [ListModels.page_token][] to obtain that page.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/LocationName.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/LocationName.java new file mode 100644 index 000000000000..37512378703a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/LocationName.java @@ -0,0 +1,189 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.automl.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Model.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Model.java new file mode 100644 index 000000000000..a79583db3987 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Model.java @@ -0,0 +1,2470 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/model.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * API proto representing a trained machine learning model.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.Model} + */ +public final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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 106: { + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.Builder subBuilder = null; + if (modelMetadataCase_ == 13) { + subBuilder = ((com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_).toBuilder(); + } + modelMetadata_ = + input.readMessage(com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_); + modelMetadata_ = subBuilder.buildPartial(); + } + modelMetadataCase_ = 13; + break; + } + case 114: { + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder subBuilder = null; + if (modelMetadataCase_ == 14) { + subBuilder = ((com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_).toBuilder(); + } + modelMetadata_ = + input.readMessage(com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_); + modelMetadata_ = subBuilder.buildPartial(); + } + modelMetadataCase_ = 14; + break; + } + case 122: { + com.google.cloud.automl.v1beta1.TranslationModelMetadata.Builder subBuilder = null; + if (modelMetadataCase_ == 15) { + subBuilder = ((com.google.cloud.automl.v1beta1.TranslationModelMetadata) modelMetadata_).toBuilder(); + } + modelMetadata_ = + input.readMessage(com.google.cloud.automl.v1beta1.TranslationModelMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.TranslationModelMetadata) modelMetadata_); + modelMetadata_ = subBuilder.buildPartial(); + } + modelMetadataCase_ = 15; + 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.v1beta1.ModelOuterClass.internal_static_google_cloud_automl_v1beta1_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ModelOuterClass.internal_static_google_cloud_automl_v1beta1_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Model.class, com.google.cloud.automl.v1beta1.Model.Builder.class); + } + + /** + *
+   * Deployment state of the model.
+   * 
+ * + * Protobuf enum {@code google.cloud.automl.v1beta1.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< + DeploymentState> 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.v1beta1.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.v1beta1.Model.DeploymentState) + } + + private int modelMetadataCase_ = 0; + private java.lang.Object modelMetadata_; + public enum ModelMetadataCase + implements com.google.protobuf.Internal.EnumLite { + IMAGE_CLASSIFICATION_MODEL_METADATA(13), + TEXT_CLASSIFICATION_MODEL_METADATA(14), + 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 13: return IMAGE_CLASSIFICATION_MODEL_METADATA; + case 14: return TEXT_CLASSIFICATION_MODEL_METADATA; + 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 IMAGE_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER = 13; + /** + *
+   * Metadata for image classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public boolean hasImageClassificationModelMetadata() { + return modelMetadataCase_ == 13; + } + /** + *
+   * Metadata for image classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata getImageClassificationModelMetadata() { + if (modelMetadataCase_ == 13) { + return (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance(); + } + /** + *
+   * Metadata for image classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadataOrBuilder getImageClassificationModelMetadataOrBuilder() { + if (modelMetadataCase_ == 13) { + return (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance(); + } + + public static final int TEXT_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER = 14; + /** + *
+   * Metadata for text classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public boolean hasTextClassificationModelMetadata() { + return modelMetadataCase_ == 14; + } + /** + *
+   * Metadata for text classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata getTextClassificationModelMetadata() { + if (modelMetadataCase_ == 14) { + return (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance(); + } + /** + *
+   * Metadata for text classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadataOrBuilder getTextClassificationModelMetadataOrBuilder() { + if (modelMetadataCase_ == 14) { + return (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance(); + } + + public static final int TRANSLATION_MODEL_METADATA_FIELD_NUMBER = 15; + /** + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public boolean hasTranslationModelMetadata() { + return modelMetadataCase_ == 15; + } + /** + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public com.google.cloud.automl.v1beta1.TranslationModelMetadata getTranslationModelMetadata() { + if (modelMetadataCase_ == 15) { + return (com.google.cloud.automl.v1beta1.TranslationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.TranslationModelMetadata.getDefaultInstance(); + } + /** + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public com.google.cloud.automl.v1beta1.TranslationModelMetadataOrBuilder getTranslationModelMetadataOrBuilder() { + if (modelMetadataCase_ == 15) { + return (com.google.cloud.automl.v1beta1.TranslationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.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.
+   * 
+ * + * 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.
+   * 
+ * + * 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 this model was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Output only.
+   * Timestamp when this model was created.
+   * 
+ * + * .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 this model was created.
+   * 
+ * + * .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.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + public int getDeploymentStateValue() { + return deploymentState_; + } + /** + *
+   * Output only. Deployment state of the model.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + public com.google.cloud.automl.v1beta1.Model.DeploymentState getDeploymentState() { + com.google.cloud.automl.v1beta1.Model.DeploymentState result = com.google.cloud.automl.v1beta1.Model.DeploymentState.valueOf(deploymentState_); + return result == null ? com.google.cloud.automl.v1beta1.Model.DeploymentState.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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.v1beta1.Model.DeploymentState.DEPLOYMENT_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, deploymentState_); + } + if (updateTime_ != null) { + output.writeMessage(11, getUpdateTime()); + } + if (modelMetadataCase_ == 13) { + output.writeMessage(13, (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 14) { + output.writeMessage(14, (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 15) { + output.writeMessage(15, (com.google.cloud.automl.v1beta1.TranslationModelMetadata) modelMetadata_); + } + unknownFields.writeTo(output); + } + + 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.v1beta1.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_ == 13) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 14) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 15) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, (com.google.cloud.automl.v1beta1.TranslationModelMetadata) modelMetadata_); + } + 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.v1beta1.Model)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.Model other = (com.google.cloud.automl.v1beta1.Model) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDisplayName() + .equals(other.getDisplayName()); + result = result && getDatasetId() + .equals(other.getDatasetId()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime() + .equals(other.getUpdateTime()); + } + result = result && deploymentState_ == other.deploymentState_; + result = result && getModelMetadataCase().equals( + other.getModelMetadataCase()); + if (!result) return false; + switch (modelMetadataCase_) { + case 13: + result = result && getImageClassificationModelMetadata() + .equals(other.getImageClassificationModelMetadata()); + break; + case 14: + result = result && getTextClassificationModelMetadata() + .equals(other.getTextClassificationModelMetadata()); + break; + case 15: + result = result && getTranslationModelMetadata() + .equals(other.getTranslationModelMetadata()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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_; + switch (modelMetadataCase_) { + case 13: + hash = (37 * hash) + IMAGE_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getImageClassificationModelMetadata().hashCode(); + break; + case 14: + hash = (37 * hash) + TEXT_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTextClassificationModelMetadata().hashCode(); + break; + case 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.v1beta1.Model parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.Model) + com.google.cloud.automl.v1beta1.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ModelOuterClass.internal_static_google_cloud_automl_v1beta1_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ModelOuterClass.internal_static_google_cloud_automl_v1beta1_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Model.class, com.google.cloud.automl.v1beta1.Model.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + 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; + + modelMetadataCase_ = 0; + modelMetadata_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ModelOuterClass.internal_static_google_cloud_automl_v1beta1_Model_descriptor; + } + + public com.google.cloud.automl.v1beta1.Model getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.Model.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.Model build() { + com.google.cloud.automl.v1beta1.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.Model buildPartial() { + com.google.cloud.automl.v1beta1.Model result = new com.google.cloud.automl.v1beta1.Model(this); + if (modelMetadataCase_ == 13) { + if (imageClassificationModelMetadataBuilder_ == null) { + result.modelMetadata_ = modelMetadata_; + } else { + result.modelMetadata_ = imageClassificationModelMetadataBuilder_.build(); + } + } + if (modelMetadataCase_ == 14) { + if (textClassificationModelMetadataBuilder_ == null) { + result.modelMetadata_ = modelMetadata_; + } else { + result.modelMetadata_ = textClassificationModelMetadataBuilder_.build(); + } + } + if (modelMetadataCase_ == 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.modelMetadataCase_ = modelMetadataCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.Model) { + return mergeFrom((com.google.cloud.automl.v1beta1.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.Model other) { + if (other == com.google.cloud.automl.v1beta1.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()); + } + switch (other.getModelMetadataCase()) { + case IMAGE_CLASSIFICATION_MODEL_METADATA: { + mergeImageClassificationModelMetadata(other.getImageClassificationModelMetadata()); + break; + } + case TEXT_CLASSIFICATION_MODEL_METADATA: { + mergeTextClassificationModelMetadata(other.getTextClassificationModelMetadata()); + break; + } + case TRANSLATION_MODEL_METADATA: { + mergeTranslationModelMetadata(other.getTranslationModelMetadata()); + break; + } + case MODELMETADATA_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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 com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata, com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.Builder, com.google.cloud.automl.v1beta1.ImageClassificationModelMetadataOrBuilder> imageClassificationModelMetadataBuilder_; + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public boolean hasImageClassificationModelMetadata() { + return modelMetadataCase_ == 13; + } + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata getImageClassificationModelMetadata() { + if (imageClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 13) { + return (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance(); + } else { + if (modelMetadataCase_ == 13) { + return imageClassificationModelMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public Builder setImageClassificationModelMetadata(com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata value) { + if (imageClassificationModelMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelMetadata_ = value; + onChanged(); + } else { + imageClassificationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 13; + return this; + } + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public Builder setImageClassificationModelMetadata( + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.Builder builderForValue) { + if (imageClassificationModelMetadataBuilder_ == null) { + modelMetadata_ = builderForValue.build(); + onChanged(); + } else { + imageClassificationModelMetadataBuilder_.setMessage(builderForValue.build()); + } + modelMetadataCase_ = 13; + return this; + } + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public Builder mergeImageClassificationModelMetadata(com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata value) { + if (imageClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 13 && + modelMetadata_ != com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance()) { + modelMetadata_ = com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.newBuilder((com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_) + .mergeFrom(value).buildPartial(); + } else { + modelMetadata_ = value; + } + onChanged(); + } else { + if (modelMetadataCase_ == 13) { + imageClassificationModelMetadataBuilder_.mergeFrom(value); + } + imageClassificationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 13; + return this; + } + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public Builder clearImageClassificationModelMetadata() { + if (imageClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 13) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + onChanged(); + } + } else { + if (modelMetadataCase_ == 13) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + } + imageClassificationModelMetadataBuilder_.clear(); + } + return this; + } + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.Builder getImageClassificationModelMetadataBuilder() { + return getImageClassificationModelMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadataOrBuilder getImageClassificationModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 13) && (imageClassificationModelMetadataBuilder_ != null)) { + return imageClassificationModelMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelMetadataCase_ == 13) { + return (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for image classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata, com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.Builder, com.google.cloud.automl.v1beta1.ImageClassificationModelMetadataOrBuilder> + getImageClassificationModelMetadataFieldBuilder() { + if (imageClassificationModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 13)) { + modelMetadata_ = com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.getDefaultInstance(); + } + imageClassificationModelMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata, com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.Builder, com.google.cloud.automl.v1beta1.ImageClassificationModelMetadataOrBuilder>( + (com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) modelMetadata_, + getParentForChildren(), + isClean()); + modelMetadata_ = null; + } + modelMetadataCase_ = 13; + onChanged();; + return imageClassificationModelMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata, com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder, com.google.cloud.automl.v1beta1.TextClassificationModelMetadataOrBuilder> textClassificationModelMetadataBuilder_; + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public boolean hasTextClassificationModelMetadata() { + return modelMetadataCase_ == 14; + } + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata getTextClassificationModelMetadata() { + if (textClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 14) { + return (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance(); + } else { + if (modelMetadataCase_ == 14) { + return textClassificationModelMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public Builder setTextClassificationModelMetadata(com.google.cloud.automl.v1beta1.TextClassificationModelMetadata value) { + if (textClassificationModelMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelMetadata_ = value; + onChanged(); + } else { + textClassificationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 14; + return this; + } + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public Builder setTextClassificationModelMetadata( + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder builderForValue) { + if (textClassificationModelMetadataBuilder_ == null) { + modelMetadata_ = builderForValue.build(); + onChanged(); + } else { + textClassificationModelMetadataBuilder_.setMessage(builderForValue.build()); + } + modelMetadataCase_ = 14; + return this; + } + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public Builder mergeTextClassificationModelMetadata(com.google.cloud.automl.v1beta1.TextClassificationModelMetadata value) { + if (textClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 14 && + modelMetadata_ != com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance()) { + modelMetadata_ = com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.newBuilder((com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_) + .mergeFrom(value).buildPartial(); + } else { + modelMetadata_ = value; + } + onChanged(); + } else { + if (modelMetadataCase_ == 14) { + textClassificationModelMetadataBuilder_.mergeFrom(value); + } + textClassificationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 14; + return this; + } + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public Builder clearTextClassificationModelMetadata() { + if (textClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 14) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + onChanged(); + } + } else { + if (modelMetadataCase_ == 14) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + } + textClassificationModelMetadataBuilder_.clear(); + } + return this; + } + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder getTextClassificationModelMetadataBuilder() { + return getTextClassificationModelMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadataOrBuilder getTextClassificationModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 14) && (textClassificationModelMetadataBuilder_ != null)) { + return textClassificationModelMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelMetadataCase_ == 14) { + return (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for text classification models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata, com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder, com.google.cloud.automl.v1beta1.TextClassificationModelMetadataOrBuilder> + getTextClassificationModelMetadataFieldBuilder() { + if (textClassificationModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 14)) { + modelMetadata_ = com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance(); + } + textClassificationModelMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata, com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder, com.google.cloud.automl.v1beta1.TextClassificationModelMetadataOrBuilder>( + (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) modelMetadata_, + getParentForChildren(), + isClean()); + modelMetadata_ = null; + } + modelMetadataCase_ = 14; + onChanged();; + return textClassificationModelMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationModelMetadata, com.google.cloud.automl.v1beta1.TranslationModelMetadata.Builder, com.google.cloud.automl.v1beta1.TranslationModelMetadataOrBuilder> translationModelMetadataBuilder_; + /** + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public boolean hasTranslationModelMetadata() { + return modelMetadataCase_ == 15; + } + /** + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public com.google.cloud.automl.v1beta1.TranslationModelMetadata getTranslationModelMetadata() { + if (translationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 15) { + return (com.google.cloud.automl.v1beta1.TranslationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.TranslationModelMetadata.getDefaultInstance(); + } else { + if (modelMetadataCase_ == 15) { + return translationModelMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.TranslationModelMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public Builder setTranslationModelMetadata(com.google.cloud.automl.v1beta1.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.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public Builder setTranslationModelMetadata( + com.google.cloud.automl.v1beta1.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.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public Builder mergeTranslationModelMetadata(com.google.cloud.automl.v1beta1.TranslationModelMetadata value) { + if (translationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 15 && + modelMetadata_ != com.google.cloud.automl.v1beta1.TranslationModelMetadata.getDefaultInstance()) { + modelMetadata_ = com.google.cloud.automl.v1beta1.TranslationModelMetadata.newBuilder((com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public com.google.cloud.automl.v1beta1.TranslationModelMetadata.Builder getTranslationModelMetadataBuilder() { + return getTranslationModelMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + public com.google.cloud.automl.v1beta1.TranslationModelMetadataOrBuilder getTranslationModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 15) && (translationModelMetadataBuilder_ != null)) { + return translationModelMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelMetadataCase_ == 15) { + return (com.google.cloud.automl.v1beta1.TranslationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1beta1.TranslationModelMetadata.getDefaultInstance(); + } + } + /** + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationModelMetadata, com.google.cloud.automl.v1beta1.TranslationModelMetadata.Builder, com.google.cloud.automl.v1beta1.TranslationModelMetadataOrBuilder> + getTranslationModelMetadataFieldBuilder() { + if (translationModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 15)) { + modelMetadata_ = com.google.cloud.automl.v1beta1.TranslationModelMetadata.getDefaultInstance(); + } + translationModelMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationModelMetadata, com.google.cloud.automl.v1beta1.TranslationModelMetadata.Builder, com.google.cloud.automl.v1beta1.TranslationModelMetadataOrBuilder>( + (com.google.cloud.automl.v1beta1.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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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_ = null; + 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 was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Output only.
+     * Timestamp when this model was created.
+     * 
+ * + * .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 this model was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only.
+     * Timestamp when this model was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only.
+     * Timestamp when this model was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only.
+     * Timestamp when this model was created.
+     * 
+ * + * .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 this model was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only.
+     * Timestamp when this model was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Output only.
+     * Timestamp when this model was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_ = null; + 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.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + public int getDeploymentStateValue() { + return deploymentState_; + } + /** + *
+     * Output only. Deployment state of the model.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + public Builder setDeploymentStateValue(int value) { + deploymentState_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. Deployment state of the model.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + public com.google.cloud.automl.v1beta1.Model.DeploymentState getDeploymentState() { + com.google.cloud.automl.v1beta1.Model.DeploymentState result = com.google.cloud.automl.v1beta1.Model.DeploymentState.valueOf(deploymentState_); + return result == null ? com.google.cloud.automl.v1beta1.Model.DeploymentState.UNRECOGNIZED : result; + } + /** + *
+     * Output only. Deployment state of the model.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + public Builder setDeploymentState(com.google.cloud.automl.v1beta1.Model.DeploymentState value) { + if (value == null) { + throw new NullPointerException(); + } + + deploymentState_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. Deployment state of the model.
+     * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + public Builder clearDeploymentState() { + + deploymentState_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Model) + private static final com.google.cloud.automl.v1beta1.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.Model(); + } + + public static com.google.cloud.automl.v1beta1.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluation.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluation.java new file mode 100644 index 000000000000..5bd09036ec28 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluation.java @@ -0,0 +1,1650 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/model_evaluation.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Evaluation results of a model.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.ModelEvaluation} + */ +public final class ModelEvaluation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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_ = ""; + evaluatedExampleCount_ = 0; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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 66: { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.Builder subBuilder = null; + if (metricsCase_ == 8) { + subBuilder = ((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_).toBuilder(); + } + metrics_ = + input.readMessage(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_); + metrics_ = subBuilder.buildPartial(); + } + metricsCase_ = 8; + break; + } + case 74: { + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.Builder subBuilder = null; + if (metricsCase_ == 9) { + subBuilder = ((com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) metrics_).toBuilder(); + } + metrics_ = + input.readMessage(com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) metrics_); + metrics_ = subBuilder.buildPartial(); + } + metricsCase_ = 9; + 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.v1beta1.ModelEvaluationOuterClass.internal_static_google_cloud_automl_v1beta1_ModelEvaluation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.internal_static_google_cloud_automl_v1beta1_ModelEvaluation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ModelEvaluation.class, com.google.cloud.automl.v1beta1.ModelEvaluation.Builder.class); + } + + private int metricsCase_ = 0; + private java.lang.Object metrics_; + public enum MetricsCase + implements com.google.protobuf.Internal.EnumLite { + CLASSIFICATION_EVALUATION_METRICS(8), + 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 8: return CLASSIFICATION_EVALUATION_METRICS; + 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 CLASSIFICATION_EVALUATION_METRICS_FIELD_NUMBER = 8; + /** + *
+   * Evaluation metrics for models on classification problems models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public boolean hasClassificationEvaluationMetrics() { + return metricsCase_ == 8; + } + /** + *
+   * Evaluation metrics for models on classification problems models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics getClassificationEvaluationMetrics() { + if (metricsCase_ == 8) { + return (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance(); + } + /** + *
+   * Evaluation metrics for models on classification problems models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetricsOrBuilder getClassificationEvaluationMetricsOrBuilder() { + if (metricsCase_ == 8) { + return (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance(); + } + + public static final int TRANSLATION_EVALUATION_METRICS_FIELD_NUMBER = 9; + /** + *
+   * Evaluation metrics for models on translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public boolean hasTranslationEvaluationMetrics() { + return metricsCase_ == 9; + } + /** + *
+   * Evaluation metrics for models on translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics getTranslationEvaluationMetrics() { + if (metricsCase_ == 9) { + return (com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.getDefaultInstance(); + } + /** + *
+   * Evaluation metrics for models on translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetricsOrBuilder getTranslationEvaluationMetricsOrBuilder() { + if (metricsCase_ == 9) { + return (com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1beta1.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
+   * ID is empty for overall model evaluation.
+   * NOTE: Currently there is no way to obtain the display_name of the
+   * annotation spec from its ID. To see the display_names, review the model
+   * evaluations in the UI.
+   * 
+ * + * 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
+   * ID is empty for overall model evaluation.
+   * NOTE: Currently there is no way to obtain the display_name of the
+   * annotation spec from its ID. To see the display_names, review the model
+   * evaluations in the UI.
+   * 
+ * + * 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.
+   * 
+ * + * int32 evaluated_example_count = 6; + */ + public int getEvaluatedExampleCount() { + return evaluatedExampleCount_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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_ == 8) { + output.writeMessage(8, (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_); + } + if (metricsCase_ == 9) { + output.writeMessage(9, (com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) metrics_); + } + unknownFields.writeTo(output); + } + + 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_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_); + } + if (metricsCase_ == 9) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, (com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.ModelEvaluation other = (com.google.cloud.automl.v1beta1.ModelEvaluation) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getAnnotationSpecId() + .equals(other.getAnnotationSpecId()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (getEvaluatedExampleCount() + == other.getEvaluatedExampleCount()); + result = result && getMetricsCase().equals( + other.getMetricsCase()); + if (!result) return false; + switch (metricsCase_) { + case 8: + result = result && getClassificationEvaluationMetrics() + .equals(other.getClassificationEvaluationMetrics()); + break; + case 9: + result = result && getTranslationEvaluationMetrics() + .equals(other.getTranslationEvaluationMetrics()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 8: + hash = (37 * hash) + CLASSIFICATION_EVALUATION_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationEvaluationMetrics().hashCode(); + break; + case 9: + hash = (37 * hash) + TRANSLATION_EVALUATION_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getTranslationEvaluationMetrics().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.ModelEvaluation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.ModelEvaluation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.ModelEvaluation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.ModelEvaluation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.ModelEvaluation) + com.google.cloud.automl.v1beta1.ModelEvaluationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.internal_static_google_cloud_automl_v1beta1_ModelEvaluation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.internal_static_google_cloud_automl_v1beta1_ModelEvaluation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.ModelEvaluation.class, com.google.cloud.automl.v1beta1.ModelEvaluation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + 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; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.internal_static_google_cloud_automl_v1beta1_ModelEvaluation_descriptor; + } + + public com.google.cloud.automl.v1beta1.ModelEvaluation getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.ModelEvaluation.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.ModelEvaluation build() { + com.google.cloud.automl.v1beta1.ModelEvaluation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.ModelEvaluation buildPartial() { + com.google.cloud.automl.v1beta1.ModelEvaluation result = new com.google.cloud.automl.v1beta1.ModelEvaluation(this); + if (metricsCase_ == 8) { + if (classificationEvaluationMetricsBuilder_ == null) { + result.metrics_ = metrics_; + } else { + result.metrics_ = classificationEvaluationMetricsBuilder_.build(); + } + } + if (metricsCase_ == 9) { + if (translationEvaluationMetricsBuilder_ == null) { + result.metrics_ = metrics_; + } 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; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.ModelEvaluation) { + return mergeFrom((com.google.cloud.automl.v1beta1.ModelEvaluation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.ModelEvaluation other) { + if (other == com.google.cloud.automl.v1beta1.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 CLASSIFICATION_EVALUATION_METRICS: { + mergeClassificationEvaluationMetrics(other.getClassificationEvaluationMetrics()); + break; + } + case TRANSLATION_EVALUATION_METRICS: { + mergeTranslationEvaluationMetrics(other.getTranslationEvaluationMetrics()); + break; + } + case METRICS_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.ModelEvaluation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.ClassificationProto.ClassificationEvaluationMetrics, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetricsOrBuilder> classificationEvaluationMetricsBuilder_; + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public boolean hasClassificationEvaluationMetrics() { + return metricsCase_ == 8; + } + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics getClassificationEvaluationMetrics() { + if (classificationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 8) { + return (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance(); + } else { + if (metricsCase_ == 8) { + return classificationEvaluationMetricsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance(); + } + } + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public Builder setClassificationEvaluationMetrics(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics value) { + if (classificationEvaluationMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + onChanged(); + } else { + classificationEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 8; + return this; + } + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public Builder setClassificationEvaluationMetrics( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.Builder builderForValue) { + if (classificationEvaluationMetricsBuilder_ == null) { + metrics_ = builderForValue.build(); + onChanged(); + } else { + classificationEvaluationMetricsBuilder_.setMessage(builderForValue.build()); + } + metricsCase_ = 8; + return this; + } + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public Builder mergeClassificationEvaluationMetrics(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics value) { + if (classificationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 8 && + metrics_ != com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance()) { + metrics_ = com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.newBuilder((com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_) + .mergeFrom(value).buildPartial(); + } else { + metrics_ = value; + } + onChanged(); + } else { + if (metricsCase_ == 8) { + classificationEvaluationMetricsBuilder_.mergeFrom(value); + } + classificationEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 8; + return this; + } + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public Builder clearClassificationEvaluationMetrics() { + if (classificationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 8) { + metricsCase_ = 0; + metrics_ = null; + onChanged(); + } + } else { + if (metricsCase_ == 8) { + metricsCase_ = 0; + metrics_ = null; + } + classificationEvaluationMetricsBuilder_.clear(); + } + return this; + } + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.Builder getClassificationEvaluationMetricsBuilder() { + return getClassificationEvaluationMetricsFieldBuilder().getBuilder(); + } + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetricsOrBuilder getClassificationEvaluationMetricsOrBuilder() { + if ((metricsCase_ == 8) && (classificationEvaluationMetricsBuilder_ != null)) { + return classificationEvaluationMetricsBuilder_.getMessageOrBuilder(); + } else { + if (metricsCase_ == 8) { + return (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance(); + } + } + /** + *
+     * Evaluation metrics for models on classification problems models.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetricsOrBuilder> + getClassificationEvaluationMetricsFieldBuilder() { + if (classificationEvaluationMetricsBuilder_ == null) { + if (!(metricsCase_ == 8)) { + metrics_ = com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.getDefaultInstance(); + } + classificationEvaluationMetricsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics.Builder, com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetricsOrBuilder>( + (com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics) metrics_, + getParentForChildren(), + isClean()); + metrics_ = null; + } + metricsCase_ = 8; + onChanged();; + return classificationEvaluationMetricsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics, com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.Builder, com.google.cloud.automl.v1beta1.TranslationEvaluationMetricsOrBuilder> translationEvaluationMetricsBuilder_; + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public boolean hasTranslationEvaluationMetrics() { + return metricsCase_ == 9; + } + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics getTranslationEvaluationMetrics() { + if (translationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 9) { + return (com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.getDefaultInstance(); + } else { + if (metricsCase_ == 9) { + return translationEvaluationMetricsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.getDefaultInstance(); + } + } + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public Builder setTranslationEvaluationMetrics(com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics value) { + if (translationEvaluationMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + onChanged(); + } else { + translationEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 9; + return this; + } + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public Builder setTranslationEvaluationMetrics( + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.Builder builderForValue) { + if (translationEvaluationMetricsBuilder_ == null) { + metrics_ = builderForValue.build(); + onChanged(); + } else { + translationEvaluationMetricsBuilder_.setMessage(builderForValue.build()); + } + metricsCase_ = 9; + return this; + } + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public Builder mergeTranslationEvaluationMetrics(com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics value) { + if (translationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 9 && + metrics_ != com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.getDefaultInstance()) { + metrics_ = com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.newBuilder((com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) metrics_) + .mergeFrom(value).buildPartial(); + } else { + metrics_ = value; + } + onChanged(); + } else { + if (metricsCase_ == 9) { + translationEvaluationMetricsBuilder_.mergeFrom(value); + } + translationEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 9; + return this; + } + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.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; + } + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.Builder getTranslationEvaluationMetricsBuilder() { + return getTranslationEvaluationMetricsFieldBuilder().getBuilder(); + } + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetricsOrBuilder getTranslationEvaluationMetricsOrBuilder() { + if ((metricsCase_ == 9) && (translationEvaluationMetricsBuilder_ != null)) { + return translationEvaluationMetricsBuilder_.getMessageOrBuilder(); + } else { + if (metricsCase_ == 9) { + return (com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.getDefaultInstance(); + } + } + /** + *
+     * Evaluation metrics for models on translation models.
+     * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics, com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.Builder, com.google.cloud.automl.v1beta1.TranslationEvaluationMetricsOrBuilder> + getTranslationEvaluationMetricsFieldBuilder() { + if (translationEvaluationMetricsBuilder_ == null) { + if (!(metricsCase_ == 9)) { + metrics_ = com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.getDefaultInstance(); + } + translationEvaluationMetricsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics, com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.Builder, com.google.cloud.automl.v1beta1.TranslationEvaluationMetricsOrBuilder>( + (com.google.cloud.automl.v1beta1.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
+     * ID is empty for overall model evaluation.
+     * NOTE: Currently there is no way to obtain the display_name of the
+     * annotation spec from its ID. To see the display_names, review the model
+     * evaluations in the UI.
+     * 
+ * + * 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
+     * ID is empty for overall model evaluation.
+     * NOTE: Currently there is no way to obtain the display_name of the
+     * annotation spec from its ID. To see the display_names, review the model
+     * evaluations in the UI.
+     * 
+ * + * 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
+     * ID is empty for overall model evaluation.
+     * NOTE: Currently there is no way to obtain the display_name of the
+     * annotation spec from its ID. To see the display_names, review the model
+     * evaluations in the UI.
+     * 
+ * + * 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
+     * ID is empty for overall model evaluation.
+     * NOTE: Currently there is no way to obtain the display_name of the
+     * annotation spec from its ID. To see the display_names, review the model
+     * evaluations in the UI.
+     * 
+ * + * 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
+     * ID is empty for overall model evaluation.
+     * NOTE: Currently there is no way to obtain the display_name of the
+     * annotation spec from its ID. To see the display_names, review the model
+     * evaluations in the UI.
+     * 
+ * + * 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_ = null; + 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.
+     * 
+ * + * int32 evaluated_example_count = 6; + */ + public int getEvaluatedExampleCount() { + return evaluatedExampleCount_; + } + /** + *
+     * Output only. The number of examples used for model evaluation.
+     * 
+ * + * 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.
+     * 
+ * + * int32 evaluated_example_count = 6; + */ + public Builder clearEvaluatedExampleCount() { + + evaluatedExampleCount_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.ModelEvaluation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ModelEvaluation) + private static final com.google.cloud.automl.v1beta1.ModelEvaluation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.ModelEvaluation(); + } + + public static com.google.cloud.automl.v1beta1.ModelEvaluation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.ModelEvaluation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationName.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationName.java new file mode 100644 index 000000000000..a2db7fc2e233 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationName.java @@ -0,0 +1,235 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.automl.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOrBuilder.java new file mode 100644 index 000000000000..b7f1b4ed4889 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOrBuilder.java @@ -0,0 +1,150 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/model_evaluation.proto + +package com.google.cloud.automl.v1beta1; + +public interface ModelEvaluationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.ModelEvaluation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Evaluation metrics for models on classification problems models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + boolean hasClassificationEvaluationMetrics(); + /** + *
+   * Evaluation metrics for models on classification problems models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetrics getClassificationEvaluationMetrics(); + /** + *
+   * Evaluation metrics for models on classification problems models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationEvaluationMetricsOrBuilder getClassificationEvaluationMetricsOrBuilder(); + + /** + *
+   * Evaluation metrics for models on translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + boolean hasTranslationEvaluationMetrics(); + /** + *
+   * Evaluation metrics for models on translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics getTranslationEvaluationMetrics(); + /** + *
+   * Evaluation metrics for models on translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + */ + com.google.cloud.automl.v1beta1.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
+   * ID is empty for overall model evaluation.
+   * NOTE: Currently there is no way to obtain the display_name of the
+   * annotation spec from its ID. To see the display_names, review the model
+   * evaluations in the UI.
+   * 
+ * + * string annotation_spec_id = 2; + */ + java.lang.String getAnnotationSpecId(); + /** + *
+   * Output only.
+   * The ID of the annotation spec that the model evaluation applies to. The
+   * ID is empty for overall model evaluation.
+   * NOTE: Currently there is no way to obtain the display_name of the
+   * annotation spec from its ID. To see the display_names, review the model
+   * evaluations in the UI.
+   * 
+ * + * 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.
+   * 
+ * + * int32 evaluated_example_count = 6; + */ + int getEvaluatedExampleCount(); + + public com.google.cloud.automl.v1beta1.ModelEvaluation.MetricsCase getMetricsCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOuterClass.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOuterClass.java new file mode 100644 index 000000000000..d36fe573fb79 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelEvaluationOuterClass.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/model_evaluation.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_ModelEvaluation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_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 = { + "\n2google/cloud/automl/v1beta1/model_eval" + + "uation.proto\022\033google.cloud.automl.v1beta" + + "1\032\034google/api/annotations.proto\0320google/" + + "cloud/automl/v1beta1/classification.prot" + + "o\032-google/cloud/automl/v1beta1/translati" + + "on.proto\032\037google/protobuf/timestamp.prot" + + "o\"\350\002\n\017ModelEvaluation\022i\n!classification_" + + "evaluation_metrics\030\010 \001(\0132<.google.cloud." + + "automl.v1beta1.ClassificationEvaluationM" + + "etricsH\000\022c\n\036translation_evaluation_metri" + + "cs\030\t \001(\01329.google.cloud.automl.v1beta1.T" + + "ranslationEvaluationMetricsH\000\022\014\n\004name\030\001 " + + "\001(\t\022\032\n\022annotation_spec_id\030\002 \001(\t\022/\n\013creat" + + "e_time\030\005 \001(\0132\032.google.protobuf.Timestamp" + + "\022\037\n\027evaluated_example_count\030\006 \001(\005B\t\n\007met" + + "ricsBf\n\037com.google.cloud.automl.v1beta1P" + + "\001ZAgoogle.golang.org/genproto/googleapis" + + "/cloud/automl/v1beta1;automlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(), + com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_ModelEvaluation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_ModelEvaluation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_ModelEvaluation_descriptor, + new java.lang.String[] { "ClassificationEvaluationMetrics", "TranslationEvaluationMetrics", "Name", "AnnotationSpecId", "CreateTime", "EvaluatedExampleCount", "Metrics", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(); + com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelName.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelName.java new file mode 100644 index 000000000000..fa2b443fe99c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelName.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.automl.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ModelName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/models/{model}"); + + private volatile Map 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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelOrBuilder.java new file mode 100644 index 000000000000..a3faa588478d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelOrBuilder.java @@ -0,0 +1,229 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/model.proto + +package com.google.cloud.automl.v1beta1; + +public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.Model) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Metadata for image classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + boolean hasImageClassificationModelMetadata(); + /** + *
+   * Metadata for image classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata getImageClassificationModelMetadata(); + /** + *
+   * Metadata for image classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + */ + com.google.cloud.automl.v1beta1.ImageClassificationModelMetadataOrBuilder getImageClassificationModelMetadataOrBuilder(); + + /** + *
+   * Metadata for text classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + boolean hasTextClassificationModelMetadata(); + /** + *
+   * Metadata for text classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata getTextClassificationModelMetadata(); + /** + *
+   * Metadata for text classification models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextClassificationModelMetadata text_classification_model_metadata = 14; + */ + com.google.cloud.automl.v1beta1.TextClassificationModelMetadataOrBuilder getTextClassificationModelMetadataOrBuilder(); + + /** + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + boolean hasTranslationModelMetadata(); + /** + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + com.google.cloud.automl.v1beta1.TranslationModelMetadata getTranslationModelMetadata(); + /** + *
+   * Metadata for translation models.
+   * 
+ * + * .google.cloud.automl.v1beta1.TranslationModelMetadata translation_model_metadata = 15; + */ + com.google.cloud.automl.v1beta1.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.
+   * 
+ * + * 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.
+   * 
+ * + * 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 this model was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + boolean hasCreateTime(); + /** + *
+   * Output only.
+   * Timestamp when this model was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Output only.
+   * Timestamp when this model was created.
+   * 
+ * + * .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.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + int getDeploymentStateValue(); + /** + *
+   * Output only. Deployment state of the model.
+   * 
+ * + * .google.cloud.automl.v1beta1.Model.DeploymentState deployment_state = 8; + */ + com.google.cloud.automl.v1beta1.Model.DeploymentState getDeploymentState(); + + public com.google.cloud.automl.v1beta1.Model.ModelMetadataCase getModelMetadataCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelOuterClass.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelOuterClass.java new file mode 100644 index 000000000000..177acd4b8df7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelOuterClass.java @@ -0,0 +1,89 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/model.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_Model_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_Model_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/v1beta1/model.prot" + + "o\022\033google.cloud.automl.v1beta1\032\034google/a" + + "pi/annotations.proto\032\'google/cloud/autom" + + "l/v1beta1/image.proto\032&google/cloud/auto" + + "ml/v1beta1/text.proto\032-google/cloud/auto" + + "ml/v1beta1/translation.proto\032\037google/pro" + + "tobuf/timestamp.proto\"\213\005\n\005Model\022l\n#image" + + "_classification_model_metadata\030\r \001(\0132=.g" + + "oogle.cloud.automl.v1beta1.ImageClassifi" + + "cationModelMetadataH\000\022j\n\"text_classifica" + + "tion_model_metadata\030\016 \001(\0132<.google.cloud" + + ".automl.v1beta1.TextClassificationModelM" + + "etadataH\000\022[\n\032translation_model_metadata\030" + + "\017 \001(\01325.google.cloud.automl.v1beta1.Tran" + + "slationModelMetadataH\000\022\014\n\004name\030\001 \001(\t\022\024\n\014" + + "display_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.Ti" + + "mestamp\022/\n\013update_time\030\013 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022L\n\020deployment_state\030\010 \001" + + "(\01622.google.cloud.automl.v1beta1.Model.D" + + "eploymentState\"Q\n\017DeploymentState\022 \n\034DEP" + + "LOYMENT_STATE_UNSPECIFIED\020\000\022\014\n\010DEPLOYED\020" + + "\001\022\016\n\nUNDEPLOYED\020\002B\020\n\016model_metadataBf\n\037c" + + "om.google.cloud.automl.v1beta1P\001ZAgoogle" + + ".golang.org/genproto/googleapis/cloud/au" + + "toml/v1beta1;automlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.ImageProto.getDescriptor(), + com.google.cloud.automl.v1beta1.TextProto.getDescriptor(), + com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_Model_descriptor, + new java.lang.String[] { "ImageClassificationModelMetadata", "TextClassificationModelMetadata", "TranslationModelMetadata", "Name", "DisplayName", "DatasetId", "CreateTime", "UpdateTime", "DeploymentState", "ModelMetadata", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.ImageProto.getDescriptor(); + com.google.cloud.automl.v1beta1.TextProto.getDescriptor(); + com.google.cloud.automl.v1beta1.TranslationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OperationMetadata.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OperationMetadata.java new file mode 100644 index 000000000000..c6cb3e3a9c53 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OperationMetadata.java @@ -0,0 +1,1758 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/operations.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Metadata used across all long running operations returned by AutoML API.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.OperationMetadata} + */ +public final class OperationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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() { + progressPercent_ = 0; + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + partialFailures_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + 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 82: { + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 10) { + subBuilder = ((com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) details_).toBuilder(); + } + details_ = + input.readMessage(com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 10; + break; + } + case 104: { + + progressPercent_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + 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.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_OperationMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.OperationMetadata.class, com.google.cloud.automl.v1beta1.OperationMetadata.Builder.class); + } + + private int bitField0_; + private int detailsCase_ = 0; + private java.lang.Object details_; + public enum DetailsCase + implements com.google.protobuf.Internal.EnumLite { + 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 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 CREATE_MODEL_DETAILS_FIELD_NUMBER = 10; + /** + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public boolean hasCreateModelDetails() { + return detailsCase_ == 10; + } + /** + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadata getCreateModelDetails() { + if (detailsCase_ == 10) { + return (com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance(); + } + /** + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadataOrBuilder getCreateModelDetailsOrBuilder() { + if (detailsCase_ == 10) { + return (com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance(); + } + + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 13; + private int progressPercent_; + /** + *
+   * Output only. Progress of operation. Range: [0, 100].
+   * 
+ * + * 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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_ == 10) { + output.writeMessage(10, (com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) details_); + } + if (progressPercent_ != 0) { + output.writeInt32(13, progressPercent_); + } + unknownFields.writeTo(output); + } + + 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_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, (com.google.cloud.automl.v1beta1.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.v1beta1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.OperationMetadata other = (com.google.cloud.automl.v1beta1.OperationMetadata) obj; + + boolean result = true; + result = result && (getProgressPercent() + == other.getProgressPercent()); + result = result && getPartialFailuresList() + .equals(other.getPartialFailuresList()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime() + .equals(other.getUpdateTime()); + } + result = result && getDetailsCase().equals( + other.getDetailsCase()); + if (!result) return false; + switch (detailsCase_) { + case 10: + result = result && getCreateModelDetails() + .equals(other.getCreateModelDetails()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 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.v1beta1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.OperationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.OperationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.OperationMetadata) + com.google.cloud.automl.v1beta1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_OperationMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.OperationMetadata.class, com.google.cloud.automl.v1beta1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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(); + } + } + public Builder clear() { + super.clear(); + progressPercent_ = 0; + + if (partialFailuresBuilder_ == null) { + partialFailures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } 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; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.Operations.internal_static_google_cloud_automl_v1beta1_OperationMetadata_descriptor; + } + + public com.google.cloud.automl.v1beta1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.OperationMetadata.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.OperationMetadata build() { + com.google.cloud.automl.v1beta1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.OperationMetadata buildPartial() { + com.google.cloud.automl.v1beta1.OperationMetadata result = new com.google.cloud.automl.v1beta1.OperationMetadata(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (detailsCase_ == 10) { + if (createModelDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = createModelDetailsBuilder_.build(); + } + } + result.progressPercent_ = progressPercent_; + if (partialFailuresBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + partialFailures_ = java.util.Collections.unmodifiableList(partialFailures_); + bitField0_ = (bitField0_ & ~0x00000004); + } + 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; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.OperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1beta1.OperationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.OperationMetadata other) { + if (other == com.google.cloud.automl.v1beta1.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_ & ~0x00000004); + } else { + ensurePartialFailuresIsMutable(); + partialFailures_.addAll(other.partialFailures_); + } + onChanged(); + } + } else { + if (!other.partialFailures_.isEmpty()) { + if (partialFailuresBuilder_.isEmpty()) { + partialFailuresBuilder_.dispose(); + partialFailuresBuilder_ = null; + partialFailures_ = other.partialFailures_; + bitField0_ = (bitField0_ & ~0x00000004); + 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 CREATE_MODEL_DETAILS: { + mergeCreateModelDetails(other.getCreateModelDetails()); + break; + } + case DETAILS_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelOperationMetadata, com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.Builder, com.google.cloud.automl.v1beta1.CreateModelOperationMetadataOrBuilder> createModelDetailsBuilder_; + /** + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public boolean hasCreateModelDetails() { + return detailsCase_ == 10; + } + /** + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadata getCreateModelDetails() { + if (createModelDetailsBuilder_ == null) { + if (detailsCase_ == 10) { + return (com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 10) { + return createModelDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance(); + } + } + /** + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public Builder setCreateModelDetails(com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public Builder setCreateModelDetails( + com.google.cloud.automl.v1beta1.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.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public Builder mergeCreateModelDetails(com.google.cloud.automl.v1beta1.CreateModelOperationMetadata value) { + if (createModelDetailsBuilder_ == null) { + if (detailsCase_ == 10 && + details_ != com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance()) { + details_ = com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.newBuilder((com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.Builder getCreateModelDetailsBuilder() { + return getCreateModelDetailsFieldBuilder().getBuilder(); + } + /** + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + public com.google.cloud.automl.v1beta1.CreateModelOperationMetadataOrBuilder getCreateModelDetailsOrBuilder() { + if ((detailsCase_ == 10) && (createModelDetailsBuilder_ != null)) { + return createModelDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 10) { + return (com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance(); + } + } + /** + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata, com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.Builder, com.google.cloud.automl.v1beta1.CreateModelOperationMetadataOrBuilder> + getCreateModelDetailsFieldBuilder() { + if (createModelDetailsBuilder_ == null) { + if (!(detailsCase_ == 10)) { + details_ = com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.getDefaultInstance(); + } + createModelDetailsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata, com.google.cloud.automl.v1beta1.CreateModelOperationMetadata.Builder, com.google.cloud.automl.v1beta1.CreateModelOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1beta1.CreateModelOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 10; + onChanged();; + return createModelDetailsBuilder_; + } + + private int progressPercent_ ; + /** + *
+     * Output only. Progress of operation. Range: [0, 100].
+     * 
+ * + * int32 progress_percent = 13; + */ + public int getProgressPercent() { + return progressPercent_; + } + /** + *
+     * Output only. Progress of operation. Range: [0, 100].
+     * 
+ * + * int32 progress_percent = 13; + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. Progress of operation. Range: [0, 100].
+     * 
+ * + * 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_ & 0x00000004) == 0x00000004)) { + partialFailures_ = new java.util.ArrayList(partialFailures_); + bitField0_ |= 0x00000004; + } + } + + 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_ & ~0x00000004); + 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_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + partialFailures_ = null; + } + return partialFailuresBuilder_; + } + + private com.google.protobuf.Timestamp createTime_ = null; + 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_ = null; + 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_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.OperationMetadata) + private static final com.google.cloud.automl.v1beta1.OperationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.OperationMetadata(); + } + + public static com.google.cloud.automl.v1beta1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..c99fb87cf82f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OperationMetadataOrBuilder.java @@ -0,0 +1,154 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/operations.proto + +package com.google.cloud.automl.v1beta1; + +public interface OperationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + boolean hasCreateModelDetails(); + /** + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + com.google.cloud.automl.v1beta1.CreateModelOperationMetadata getCreateModelDetails(); + /** + *
+   * Details of CreateModel operation.
+   * 
+ * + * .google.cloud.automl.v1beta1.CreateModelOperationMetadata create_model_details = 10; + */ + com.google.cloud.automl.v1beta1.CreateModelOperationMetadataOrBuilder getCreateModelDetailsOrBuilder(); + + /** + *
+   * Output only. Progress of operation. Range: [0, 100].
+   * 
+ * + * 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.v1beta1.OperationMetadata.DetailsCase getDetailsCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Operations.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Operations.java new file mode 100644 index 000000000000..d0b6c37e24cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Operations.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/operations.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_OperationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_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/v1beta1/operations" + + ".proto\022\033google.cloud.automl.v1beta1\032\034goo" + + "gle/api/annotations.proto\032\'google/cloud/" + + "automl/v1beta1/model.proto\0322google/cloud" + + "/automl/v1beta1/model_evaluation.proto\032\033" + + "google/protobuf/empty.proto\032\037google/prot" + + "obuf/timestamp.proto\032\027google/rpc/status." + + "proto\"\243\002\n\021OperationMetadata\022Y\n\024create_mo" + + "del_details\030\n \001(\01329.google.cloud.automl." + + "v1beta1.CreateModelOperationMetadataH\000\022\030" + + "\n\020progress_percent\030\r \001(\005\022,\n\020partial_fail" + + "ures\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.T" + + "imestampB\t\n\007details\"\036\n\034CreateModelOperat" + + "ionMetadataBf\n\037com.google.cloud.automl.v" + + "1beta1P\001ZAgoogle.golang.org/genproto/goo" + + "gleapis/cloud/automl/v1beta1;automlb\006pro" + + "to3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.ModelOuterClass.getDescriptor(), + com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_OperationMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_OperationMetadata_descriptor, + new java.lang.String[] { "CreateModelDetails", "ProgressPercent", "PartialFailures", "CreateTime", "UpdateTime", "Details", }); + internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_CreateModelOperationMetadata_descriptor, + new java.lang.String[] { }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.ModelOuterClass.getDescriptor(); + com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OutputConfig.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OutputConfig.java new file mode 100644 index 000000000000..2b30d517b21b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OutputConfig.java @@ -0,0 +1,717 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Output configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.OutputConfig} + */ +public final class OutputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.automl.v1beta1.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = ((com.google.cloud.automl.v1beta1.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage(com.google.cloud.automl.v1beta1.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1beta1.GcsDestination) destination_); + destination_ = subBuilder.buildPartial(); + } + destinationCase_ = 1; + 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.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_OutputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.OutputConfig.class, com.google.cloud.automl.v1beta1.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 GCS location where the output must be written to.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + *
+   * The GCS location where the output must be written to.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.automl.v1beta1.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1beta1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance(); + } + /** + *
+   * The GCS location where the output must be written to.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.automl.v1beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1beta1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (destinationCase_ == 1) { + output.writeMessage(1, (com.google.cloud.automl.v1beta1.GcsDestination) destination_); + } + unknownFields.writeTo(output); + } + + 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.v1beta1.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.v1beta1.OutputConfig)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.OutputConfig other = (com.google.cloud.automl.v1beta1.OutputConfig) obj; + + boolean result = true; + result = result && getDestinationCase().equals( + other.getDestinationCase()); + if (!result) return false; + switch (destinationCase_) { + case 1: + result = result && getGcsDestination() + .equals(other.getGcsDestination()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.OutputConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.OutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.OutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.OutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.OutputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.OutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Output configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.OutputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.OutputConfig) + com.google.cloud.automl.v1beta1.OutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_OutputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.OutputConfig.class, com.google.cloud.automl.v1beta1.OutputConfig.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.Io.internal_static_google_cloud_automl_v1beta1_OutputConfig_descriptor; + } + + public com.google.cloud.automl.v1beta1.OutputConfig getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.OutputConfig.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.OutputConfig build() { + com.google.cloud.automl.v1beta1.OutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.OutputConfig buildPartial() { + com.google.cloud.automl.v1beta1.OutputConfig result = new com.google.cloud.automl.v1beta1.OutputConfig(this); + if (destinationCase_ == 1) { + if (gcsDestinationBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = gcsDestinationBuilder_.build(); + } + } + result.destinationCase_ = destinationCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.OutputConfig) { + return mergeFrom((com.google.cloud.automl.v1beta1.OutputConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.OutputConfig other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.OutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.GcsDestination, com.google.cloud.automl.v1beta1.GcsDestination.Builder, com.google.cloud.automl.v1beta1.GcsDestinationOrBuilder> gcsDestinationBuilder_; + /** + *
+     * The GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + *
+     * The GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.automl.v1beta1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1beta1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance(); + } + } + /** + *
+     * The GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination(com.google.cloud.automl.v1beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + *
+     * The GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.automl.v1beta1.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + *
+     * The GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination(com.google.cloud.automl.v1beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 && + destination_ != com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance()) { + destination_ = com.google.cloud.automl.v1beta1.GcsDestination.newBuilder((com.google.cloud.automl.v1beta1.GcsDestination) destination_) + .mergeFrom(value).buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + *
+     * The GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.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 GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.automl.v1beta1.GcsDestination.Builder getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + *
+     * The GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.automl.v1beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1beta1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance(); + } + } + /** + *
+     * The GCS location where the output must be written to.
+     * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.GcsDestination, com.google.cloud.automl.v1beta1.GcsDestination.Builder, com.google.cloud.automl.v1beta1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.cloud.automl.v1beta1.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.GcsDestination, com.google.cloud.automl.v1beta1.GcsDestination.Builder, com.google.cloud.automl.v1beta1.GcsDestinationOrBuilder>( + (com.google.cloud.automl.v1beta1.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged();; + return gcsDestinationBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.OutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.OutputConfig) + private static final com.google.cloud.automl.v1beta1.OutputConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.OutputConfig(); + } + + public static com.google.cloud.automl.v1beta1.OutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.OutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OutputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OutputConfigOrBuilder.java new file mode 100644 index 000000000000..9dfae78bf3b1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/OutputConfigOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/io.proto + +package com.google.cloud.automl.v1beta1; + +public interface OutputConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.OutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The GCS location where the output must be written to.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + boolean hasGcsDestination(); + /** + *
+   * The GCS location where the output must be written to.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + com.google.cloud.automl.v1beta1.GcsDestination getGcsDestination(); + /** + *
+   * The GCS location where the output must be written to.
+   * 
+ * + * .google.cloud.automl.v1beta1.GcsDestination gcs_destination = 1; + */ + com.google.cloud.automl.v1beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + public com.google.cloud.automl.v1beta1.OutputConfig.DestinationCase getDestinationCase(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequest.java new file mode 100644 index 000000000000..b730fc94e894 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequest.java @@ -0,0 +1,1192 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/prediction_service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.PredictRequest} + */ +public final class PredictRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + com.google.cloud.automl.v1beta1.ExamplePayload.Builder subBuilder = null; + if (payload_ != null) { + subBuilder = payload_.toBuilder(); + } + payload_ = input.readMessage(com.google.cloud.automl.v1beta1.ExamplePayload.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(payload_); + payload_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + 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; + } + } + } + } 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.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_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); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.PredictRequest.class, com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1beta1.ExamplePayload getPayload() { + return payload_ == null ? com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder getPayloadOrBuilder() { + return getPayload(); + } + + public static final int PARAMS_FIELD_NUMBER = 3; + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_PredictRequest_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * 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.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * 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.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * 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.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.PredictRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.PredictRequest other = (com.google.cloud.automl.v1beta1.PredictRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasPayload() == other.hasPayload()); + if (hasPayload()) { + result = result && getPayload() + .equals(other.getPayload()); + } + result = result && internalGetParams().equals( + other.internalGetParams()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.PredictRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.PredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.PredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.PredictRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.PredictRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.PredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.PredictionService.Predict].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.PredictRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.PredictRequest) + com.google.cloud.automl.v1beta1.PredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_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); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.PredictRequest.class, com.google.cloud.automl.v1beta1.PredictRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + if (payloadBuilder_ == null) { + payload_ = null; + } else { + payload_ = null; + payloadBuilder_ = null; + } + internalGetMutableParams().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_PredictRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.PredictRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.PredictRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.PredictRequest build() { + com.google.cloud.automl.v1beta1.PredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.PredictRequest buildPartial() { + com.google.cloud.automl.v1beta1.PredictRequest result = new com.google.cloud.automl.v1beta1.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; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.PredictRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.PredictRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.PredictRequest other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.PredictRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload payload_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ExamplePayload, com.google.cloud.automl.v1beta1.ExamplePayload.Builder, com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1beta1.ExamplePayload getPayload() { + if (payloadBuilder_ == null) { + return payload_ == null ? com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + public Builder setPayload(com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + public Builder setPayload( + com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + public Builder mergePayload(com.google.cloud.automl.v1beta1.ExamplePayload value) { + if (payloadBuilder_ == null) { + if (payload_ != null) { + payload_ = + com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + public com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder getPayloadOrBuilder() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + return payload_ == null ? + com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ExamplePayload, com.google.cloud.automl.v1beta1.ExamplePayload.Builder, com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ExamplePayload, com.google.cloud.automl.v1beta1.ExamplePayload.Builder, com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder>( + getPayload(), + getParentForChildren(), + isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an
+     *     image, it will only produce results that have at least this confidence
+     *     score threshold. The default is 0.5.
+     * 
+ * + * 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.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an
+     *     image, it will only produce results that have at least this confidence
+     *     score threshold. The default is 0.5.
+     * 
+ * + * 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.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an
+     *     image, it will only produce results that have at least this confidence
+     *     score threshold. The default is 0.5.
+     * 
+ * + * 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.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an
+     *     image, it will only produce results that have at least this confidence
+     *     score threshold. The default is 0.5.
+     * 
+ * + * 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.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an
+     *     image, it will only produce results that have at least this confidence
+     *     score threshold. The default is 0.5.
+     * 
+ * + * 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.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an
+     *     image, it will only produce results that have at least this confidence
+     *     score threshold. The default is 0.5.
+     * 
+ * + * 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.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an
+     *     image, it will only produce results that have at least this confidence
+     *     score threshold. The default is 0.5.
+     * 
+ * + * map<string, string> params = 3; + */ + + public Builder putAllParams( + java.util.Map values) { + internalGetMutableParams().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.PredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.PredictRequest) + private static final com.google.cloud.automl.v1beta1.PredictRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.PredictRequest(); + } + + public static com.google.cloud.automl.v1beta1.PredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.PredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequestOrBuilder.java new file mode 100644 index 000000000000..b355a278f514 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequestOrBuilder.java @@ -0,0 +1,142 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/prediction_service.proto + +package com.google.cloud.automl.v1beta1; + +public interface PredictRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + com.google.cloud.automl.v1beta1.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.v1beta1.ExamplePayload payload = 2; + */ + com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder getPayloadOrBuilder(); + + /** + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * map<string, string> params = 3; + */ + int getParamsCount(); + /** + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * 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.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * map<string, string> params = 3; + */ + java.util.Map + getParamsMap(); + /** + *
+   * Additional domain-specific parameters, any string must be up to 25000
+   * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * 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.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an
+   *     image, it will only produce results that have at least this confidence
+   *     score threshold. The default is 0.5.
+   * 
+ * + * map<string, string> params = 3; + */ + + java.lang.String getParamsOrThrow( + java.lang.String key); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponse.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponse.java new file mode 100644 index 000000000000..4011579840f9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponse.java @@ -0,0 +1,1156 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/prediction_service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Response message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
+ * Currently, this is only
+ * used to return an image recognition prediction result. More prediction
+ * output metadata might be introduced in the future.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.PredictResponse} + */ +public final class PredictResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + payload_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + payload_.add( + input.readMessage(com.google.cloud.automl.v1beta1.AnnotationPayload.parser(), extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + 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; + } + } + } + } 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) == 0x00000001)) { + 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.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_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); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.PredictResponse.class, com.google.cloud.automl.v1beta1.PredictResponse.Builder.class); + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private java.util.List payload_; + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public java.util.List getPayloadList() { + return payload_; + } + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public java.util.List + getPayloadOrBuilderList() { + return payload_; + } + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public int getPayloadCount() { + return payload_.size(); + } + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1beta1.AnnotationPayload getPayload(int index) { + return payload_.get(index); + } + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1beta1.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< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_PredictResponse_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.PredictResponse)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.PredictResponse other = (com.google.cloud.automl.v1beta1.PredictResponse) obj; + + boolean result = true; + result = result && getPayloadList() + .equals(other.getPayloadList()); + result = result && internalGetMetadata().equals( + other.internalGetMetadata()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.PredictResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.PredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.PredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.PredictResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.PredictResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.PredictResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.PredictionService.Predict].
+   * Currently, this is only
+   * used to return an image recognition prediction result. More prediction
+   * output metadata might be introduced in the future.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.PredictResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.PredictResponse) + com.google.cloud.automl.v1beta1.PredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_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); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.PredictResponse.class, com.google.cloud.automl.v1beta1.PredictResponse.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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(); + } + } + public Builder clear() { + super.clear(); + if (payloadBuilder_ == null) { + payload_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + payloadBuilder_.clear(); + } + internalGetMutableMetadata().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.PredictionServiceProto.internal_static_google_cloud_automl_v1beta1_PredictResponse_descriptor; + } + + public com.google.cloud.automl.v1beta1.PredictResponse getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.PredictResponse.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.PredictResponse build() { + com.google.cloud.automl.v1beta1.PredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.PredictResponse buildPartial() { + com.google.cloud.automl.v1beta1.PredictResponse result = new com.google.cloud.automl.v1beta1.PredictResponse(this); + int from_bitField0_ = bitField0_; + if (payloadBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + 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; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.PredictResponse) { + return mergeFrom((com.google.cloud.automl.v1beta1.PredictResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.PredictResponse other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.PredictResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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) == 0x00000001)) { + payload_ = new java.util.ArrayList(payload_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.AnnotationPayload, com.google.cloud.automl.v1beta1.AnnotationPayload.Builder, com.google.cloud.automl.v1beta1.AnnotationPayloadOrBuilder> payloadBuilder_; + + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public java.util.List getPayloadList() { + if (payloadBuilder_ == null) { + return java.util.Collections.unmodifiableList(payload_); + } else { + return payloadBuilder_.getMessageList(); + } + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public int getPayloadCount() { + if (payloadBuilder_ == null) { + return payload_.size(); + } else { + return payloadBuilder_.getCount(); + } + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1beta1.AnnotationPayload getPayload(int index) { + if (payloadBuilder_ == null) { + return payload_.get(index); + } else { + return payloadBuilder_.getMessage(index); + } + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public Builder setPayload( + int index, com.google.cloud.automl.v1beta1.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.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public Builder setPayload( + int index, com.google.cloud.automl.v1beta1.AnnotationPayload.Builder builderForValue) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + payload_.set(index, builderForValue.build()); + onChanged(); + } else { + payloadBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public Builder addPayload(com.google.cloud.automl.v1beta1.AnnotationPayload value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePayloadIsMutable(); + payload_.add(value); + onChanged(); + } else { + payloadBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public Builder addPayload( + int index, com.google.cloud.automl.v1beta1.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.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public Builder addPayload( + com.google.cloud.automl.v1beta1.AnnotationPayload.Builder builderForValue) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + payload_.add(builderForValue.build()); + onChanged(); + } else { + payloadBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public Builder addPayload( + int index, com.google.cloud.automl.v1beta1.AnnotationPayload.Builder builderForValue) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + payload_.add(index, builderForValue.build()); + onChanged(); + } else { + payloadBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.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.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.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.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public Builder removePayload(int index) { + if (payloadBuilder_ == null) { + ensurePayloadIsMutable(); + payload_.remove(index); + onChanged(); + } else { + payloadBuilder_.remove(index); + } + return this; + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1beta1.AnnotationPayload.Builder getPayloadBuilder( + int index) { + return getPayloadFieldBuilder().getBuilder(index); + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1beta1.AnnotationPayloadOrBuilder getPayloadOrBuilder( + int index) { + if (payloadBuilder_ == null) { + return payload_.get(index); } else { + return payloadBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public java.util.List + getPayloadOrBuilderList() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(payload_); + } + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1beta1.AnnotationPayload.Builder addPayloadBuilder() { + return getPayloadFieldBuilder().addBuilder( + com.google.cloud.automl.v1beta1.AnnotationPayload.getDefaultInstance()); + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public com.google.cloud.automl.v1beta1.AnnotationPayload.Builder addPayloadBuilder( + int index) { + return getPayloadFieldBuilder().addBuilder( + index, com.google.cloud.automl.v1beta1.AnnotationPayload.getDefaultInstance()); + } + /** + *
+     * Prediction result.
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + public java.util.List + getPayloadBuilderList() { + return getPayloadFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.AnnotationPayload, com.google.cloud.automl.v1beta1.AnnotationPayload.Builder, com.google.cloud.automl.v1beta1.AnnotationPayloadOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.AnnotationPayload, com.google.cloud.automl.v1beta1.AnnotationPayload.Builder, com.google.cloud.automl.v1beta1.AnnotationPayloadOrBuilder>( + payload_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.PredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.PredictResponse) + private static final com.google.cloud.automl.v1beta1.PredictResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.PredictResponse(); + } + + public static com.google.cloud.automl.v1beta1.PredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.PredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponseOrBuilder.java new file mode 100644 index 000000000000..6c636986737a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponseOrBuilder.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/prediction_service.proto + +package com.google.cloud.automl.v1beta1; + +public interface PredictResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.PredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + java.util.List + getPayloadList(); + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + com.google.cloud.automl.v1beta1.AnnotationPayload getPayload(int index); + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + int getPayloadCount(); + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + java.util.List + getPayloadOrBuilderList(); + /** + *
+   * Prediction result.
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.AnnotationPayload payload = 1; + */ + com.google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceProto.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceProto.java new file mode 100644 index 000000000000..fbf07cb5fa8b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceProto.java @@ -0,0 +1,122 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/prediction_service.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_PredictRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_PredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_PredictRequest_ParamsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_PredictRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_PredictResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_PredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_PredictResponse_MetadataEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_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 = { + "\n4google/cloud/automl/v1beta1/prediction" + + "_service.proto\022\033google.cloud.automl.v1be" + + "ta1\032\034google/api/annotations.proto\0324googl" + + "e/cloud/automl/v1beta1/annotation_payloa" + + "d.proto\032,google/cloud/automl/v1beta1/dat" + + "a_items.proto\"\324\001\n\016PredictRequest\022\014\n\004name" + + "\030\001 \001(\t\022<\n\007payload\030\002 \001(\0132+.google.cloud.a" + + "utoml.v1beta1.ExamplePayload\022G\n\006params\030\003" + + " \003(\01327.google.cloud.automl.v1beta1.Predi" + + "ctRequest.ParamsEntry\032-\n\013ParamsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\321\001\n\017Predict" + + "Response\022?\n\007payload\030\001 \003(\0132..google.cloud" + + ".automl.v1beta1.AnnotationPayload\022L\n\010met" + + "adata\030\002 \003(\0132:.google.cloud.automl.v1beta" + + "1.PredictResponse.MetadataEntry\032/\n\rMetad" + + "ataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" + + "2\276\001\n\021PredictionService\022\250\001\n\007Predict\022+.goo" + + "gle.cloud.automl.v1beta1.PredictRequest\032" + + ",.google.cloud.automl.v1beta1.PredictRes" + + "ponse\"B\202\323\344\223\002<\"7/v1beta1/{name=projects/*" + + "/locations/*/models/*}:predict:\001*B~\n\037com" + + ".google.cloud.automl.v1beta1B\026Prediction" + + "ServiceProtoP\001ZAgoogle.golang.org/genpro" + + "to/googleapis/cloud/automl/v1beta1;autom" + + "lb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.getDescriptor(), + com.google.cloud.automl.v1beta1.DataItems.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_PredictRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_PredictRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_PredictRequest_descriptor, + new java.lang.String[] { "Name", "Payload", "Params", }); + internal_static_google_cloud_automl_v1beta1_PredictRequest_ParamsEntry_descriptor = + internal_static_google_cloud_automl_v1beta1_PredictRequest_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_automl_v1beta1_PredictRequest_ParamsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_PredictRequest_ParamsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_automl_v1beta1_PredictResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_PredictResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_PredictResponse_descriptor, + new java.lang.String[] { "Payload", "Metadata", }); + internal_static_google_cloud_automl_v1beta1_PredictResponse_MetadataEntry_descriptor = + internal_static_google_cloud_automl_v1beta1_PredictResponse_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_automl_v1beta1_PredictResponse_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_PredictResponse_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.AnnotationPayloadOuterClass.getDescriptor(); + com.google.cloud.automl.v1beta1.DataItems.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationDatasetMetadata.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationDatasetMetadata.java new file mode 100644 index 000000000000..a842b80c594e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationDatasetMetadata.java @@ -0,0 +1,515 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/text.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Dataset metadata for classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} + */ +public final class TextClassificationDatasetMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) + TextClassificationDatasetMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use TextClassificationDatasetMetadata.newBuilder() to construct. + private TextClassificationDatasetMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextClassificationDatasetMetadata() { + classificationType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextClassificationDatasetMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + classificationType_ = rawValue; + 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.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.class, com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.Builder.class); + } + + public static final int CLASSIFICATION_TYPE_FIELD_NUMBER = 1; + private int classificationType_; + /** + *
+   * Required.
+   * Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + *
+   * Required.
+   * Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType getClassificationType() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType result = com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (classificationType_ != com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, classificationType_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (classificationType_ != com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, classificationType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata other = (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) obj; + + boolean result = true; + result = result && classificationType_ == other.classificationType_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLASSIFICATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + classificationType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Dataset metadata for classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.class, com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + classificationType_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_descriptor; + } + + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata build() { + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata buildPartial() { + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata result = new com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata(this); + result.classificationType_ = classificationType_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata other) { + if (other == com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.getDefaultInstance()) return this; + if (other.classificationType_ != 0) { + setClassificationTypeValue(other.getClassificationTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int classificationType_ = 0; + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public Builder setClassificationTypeValue(int value) { + classificationType_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType getClassificationType() { + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType result = com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.UNRECOGNIZED : result; + } + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public Builder setClassificationType(com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType value) { + if (value == null) { + throw new NullPointerException(); + } + + classificationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + public Builder clearClassificationType() { + + classificationType_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) + private static final com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata(); + } + + public static com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TextClassificationDatasetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextClassificationDatasetMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationDatasetMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationDatasetMetadataOrBuilder.java new file mode 100644 index 000000000000..1bfcb2b0dc32 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationDatasetMetadataOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/text.proto + +package com.google.cloud.automl.v1beta1; + +public interface TextClassificationDatasetMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + int getClassificationTypeValue(); + /** + *
+   * Required.
+   * Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 1; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType getClassificationType(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadata.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadata.java new file mode 100644 index 000000000000..c41e7be2a872 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadata.java @@ -0,0 +1,396 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/text.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Model metadata that is specific to text classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TextClassificationModelMetadata} + */ +public final class TextClassificationModelMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.TextClassificationModelMetadata) + TextClassificationModelMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use TextClassificationModelMetadata.newBuilder() to construct. + private TextClassificationModelMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextClassificationModelMetadata() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextClassificationModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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 (!parseUnknownFieldProto3( + 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.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.class, com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + unknownFields.writeTo(output); + } + + 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.v1beta1.TextClassificationModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata other = (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) obj; + + boolean result = true; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.TextClassificationModelMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.TextClassificationModelMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Model metadata that is specific to text classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TextClassificationModelMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.TextClassificationModelMetadata) + com.google.cloud.automl.v1beta1.TextClassificationModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.class, com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.TextProto.internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_descriptor; + } + + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata build() { + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata buildPartial() { + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata result = new com.google.cloud.automl.v1beta1.TextClassificationModelMetadata(this); + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1beta1.TextClassificationModelMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.TextClassificationModelMetadata other) { + if (other == com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.TextClassificationModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.TextClassificationModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextClassificationModelMetadata) + private static final com.google.cloud.automl.v1beta1.TextClassificationModelMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.TextClassificationModelMetadata(); + } + + public static com.google.cloud.automl.v1beta1.TextClassificationModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TextClassificationModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextClassificationModelMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadataOrBuilder.java new file mode 100644 index 000000000000..9cb3edbc9189 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadataOrBuilder.java @@ -0,0 +1,9 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/text.proto + +package com.google.cloud.automl.v1beta1; + +public interface TextClassificationModelMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.TextClassificationModelMetadata) + com.google.protobuf.MessageOrBuilder { +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextProto.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextProto.java new file mode 100644 index 000000000000..8c67757d52a9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextProto.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/text.proto + +package com.google.cloud.automl.v1beta1; + +public final class TextProto { + private TextProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_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/v1beta1/text.proto" + + "\022\033google.cloud.automl.v1beta1\032\034google/ap" + + "i/annotations.proto\0320google/cloud/automl" + + "/v1beta1/classification.proto\"q\n!TextCla" + + "ssificationDatasetMetadata\022L\n\023classifica" + + "tion_type\030\001 \001(\0162/.google.cloud.automl.v1" + + "beta1.ClassificationType\"!\n\037TextClassifi" + + "cationModelMetadataBq\n\037com.google.cloud." + + "automl.v1beta1B\tTextProtoP\001ZAgoogle.gola" + + "ng.org/genproto/googleapis/cloud/automl/" + + "v1beta1;automlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_descriptor, + new java.lang.String[] { "ClassificationType", }); + internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_descriptor, + new java.lang.String[] { }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippet.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippet.java new file mode 100644 index 000000000000..5863fd915f26 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippet.java @@ -0,0 +1,890 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * A representation of a text snippet.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TextSnippet} + */ +public final class TextSnippet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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; + } + } + } + } 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.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_TextSnippet_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_TextSnippet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TextSnippet.class, com.google.cloud.automl.v1beta1.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_; + /** + *
+   * The format of the source text. For example, "text/html" or
+   * "text/plain". If left blank the format is automatically determined from
+   * the type of the uploaded content. The default is "text/html". Up to 25000
+   * characters long.
+   * 
+ * + * 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; + } + } + /** + *
+   * The format of the source text. For example, "text/html" or
+   * "text/plain". If left blank the format is automatically determined from
+   * the type of the uploaded content. The default is "text/html". Up to 25000
+   * characters long.
+   * 
+ * + * 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.TextSnippet)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.TextSnippet other = (com.google.cloud.automl.v1beta1.TextSnippet) obj; + + boolean result = true; + result = result && getContent() + .equals(other.getContent()); + result = result && getMimeType() + .equals(other.getMimeType()); + result = result && getContentUri() + .equals(other.getContentUri()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.TextSnippet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TextSnippet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TextSnippet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TextSnippet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TextSnippet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.TextSnippet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.TextSnippet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.TextSnippet) + com.google.cloud.automl.v1beta1.TextSnippetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_TextSnippet_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_TextSnippet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TextSnippet.class, com.google.cloud.automl.v1beta1.TextSnippet.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + content_ = ""; + + mimeType_ = ""; + + contentUri_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.DataItems.internal_static_google_cloud_automl_v1beta1_TextSnippet_descriptor; + } + + public com.google.cloud.automl.v1beta1.TextSnippet getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.TextSnippet build() { + com.google.cloud.automl.v1beta1.TextSnippet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.TextSnippet buildPartial() { + com.google.cloud.automl.v1beta1.TextSnippet result = new com.google.cloud.automl.v1beta1.TextSnippet(this); + result.content_ = content_; + result.mimeType_ = mimeType_; + result.contentUri_ = contentUri_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.TextSnippet) { + return mergeFrom((com.google.cloud.automl.v1beta1.TextSnippet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.TextSnippet other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.TextSnippet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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_ = ""; + /** + *
+     * The format of the source text. For example, "text/html" or
+     * "text/plain". If left blank the format is automatically determined from
+     * the type of the uploaded content. The default is "text/html". Up to 25000
+     * characters long.
+     * 
+ * + * 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; + } + } + /** + *
+     * The format of the source text. For example, "text/html" or
+     * "text/plain". If left blank the format is automatically determined from
+     * the type of the uploaded content. The default is "text/html". Up to 25000
+     * characters long.
+     * 
+ * + * 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; + } + } + /** + *
+     * The format of the source text. For example, "text/html" or
+     * "text/plain". If left blank the format is automatically determined from
+     * the type of the uploaded content. The default is "text/html". Up to 25000
+     * characters long.
+     * 
+ * + * string mime_type = 2; + */ + public Builder setMimeType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mimeType_ = value; + onChanged(); + return this; + } + /** + *
+     * The format of the source text. For example, "text/html" or
+     * "text/plain". If left blank the format is automatically determined from
+     * the type of the uploaded content. The default is "text/html". Up to 25000
+     * characters long.
+     * 
+ * + * string mime_type = 2; + */ + public Builder clearMimeType() { + + mimeType_ = getDefaultInstance().getMimeType(); + onChanged(); + return this; + } + /** + *
+     * The format of the source text. For example, "text/html" or
+     * "text/plain". If left blank the format is automatically determined from
+     * the type of the uploaded content. The default is "text/html". Up to 25000
+     * characters long.
+     * 
+ * + * 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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.TextSnippet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextSnippet) + private static final com.google.cloud.automl.v1beta1.TextSnippet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.TextSnippet(); + } + + public static com.google.cloud.automl.v1beta1.TextSnippet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.TextSnippet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippetOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippetOrBuilder.java new file mode 100644 index 000000000000..37960a0e8431 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippetOrBuilder.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +public interface TextSnippetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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(); + + /** + *
+   * The format of the source text. For example, "text/html" or
+   * "text/plain". If left blank the format is automatically determined from
+   * the type of the uploaded content. The default is "text/html". Up to 25000
+   * characters long.
+   * 
+ * + * string mime_type = 2; + */ + java.lang.String getMimeType(); + /** + *
+   * The format of the source text. For example, "text/html" or
+   * "text/plain". If left blank the format is automatically determined from
+   * the type of the uploaded content. The default is "text/html". Up to 25000
+   * characters long.
+   * 
+ * + * 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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationAnnotation.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationAnnotation.java new file mode 100644 index 000000000000..e171b2447fbd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationAnnotation.java @@ -0,0 +1,626 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Annotation details specific to translation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TranslationAnnotation} + */ +public final class TranslationAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.automl.v1beta1.TextSnippet.Builder subBuilder = null; + if (translatedContent_ != null) { + subBuilder = translatedContent_.toBuilder(); + } + translatedContent_ = input.readMessage(com.google.cloud.automl.v1beta1.TextSnippet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(translatedContent_); + translatedContent_ = subBuilder.buildPartial(); + } + + 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.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TranslationAnnotation.class, com.google.cloud.automl.v1beta1.TranslationAnnotation.Builder.class); + } + + public static final int TRANSLATED_CONTENT_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1beta1.TextSnippet translatedContent_; + /** + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + public boolean hasTranslatedContent() { + return translatedContent_ != null; + } + /** + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1beta1.TextSnippet getTranslatedContent() { + return translatedContent_ == null ? com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance() : translatedContent_; + } + /** + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getTranslatedContentOrBuilder() { + return getTranslatedContent(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (translatedContent_ != null) { + output.writeMessage(1, getTranslatedContent()); + } + unknownFields.writeTo(output); + } + + 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.v1beta1.TranslationAnnotation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.TranslationAnnotation other = (com.google.cloud.automl.v1beta1.TranslationAnnotation) obj; + + boolean result = true; + result = result && (hasTranslatedContent() == other.hasTranslatedContent()); + if (hasTranslatedContent()) { + result = result && getTranslatedContent() + .equals(other.getTranslatedContent()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.TranslationAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.TranslationAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.TranslationAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.TranslationAnnotation) + com.google.cloud.automl.v1beta1.TranslationAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TranslationAnnotation.class, com.google.cloud.automl.v1beta1.TranslationAnnotation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + if (translatedContentBuilder_ == null) { + translatedContent_ = null; + } else { + translatedContent_ = null; + translatedContentBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_descriptor; + } + + public com.google.cloud.automl.v1beta1.TranslationAnnotation getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.TranslationAnnotation build() { + com.google.cloud.automl.v1beta1.TranslationAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.TranslationAnnotation buildPartial() { + com.google.cloud.automl.v1beta1.TranslationAnnotation result = new com.google.cloud.automl.v1beta1.TranslationAnnotation(this); + if (translatedContentBuilder_ == null) { + result.translatedContent_ = translatedContent_; + } else { + result.translatedContent_ = translatedContentBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.TranslationAnnotation) { + return mergeFrom((com.google.cloud.automl.v1beta1.TranslationAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.TranslationAnnotation other) { + if (other == com.google.cloud.automl.v1beta1.TranslationAnnotation.getDefaultInstance()) return this; + if (other.hasTranslatedContent()) { + mergeTranslatedContent(other.getTranslatedContent()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.TranslationAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.TranslationAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1beta1.TextSnippet translatedContent_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, com.google.cloud.automl.v1beta1.TextSnippet.Builder, com.google.cloud.automl.v1beta1.TextSnippetOrBuilder> translatedContentBuilder_; + /** + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + public boolean hasTranslatedContent() { + return translatedContentBuilder_ != null || translatedContent_ != null; + } + /** + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1beta1.TextSnippet getTranslatedContent() { + if (translatedContentBuilder_ == null) { + return translatedContent_ == null ? com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance() : translatedContent_; + } else { + return translatedContentBuilder_.getMessage(); + } + } + /** + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + public Builder setTranslatedContent(com.google.cloud.automl.v1beta1.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.v1beta1.TextSnippet translated_content = 1; + */ + public Builder setTranslatedContent( + com.google.cloud.automl.v1beta1.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.v1beta1.TextSnippet translated_content = 1; + */ + public Builder mergeTranslatedContent(com.google.cloud.automl.v1beta1.TextSnippet value) { + if (translatedContentBuilder_ == null) { + if (translatedContent_ != null) { + translatedContent_ = + com.google.cloud.automl.v1beta1.TextSnippet.newBuilder(translatedContent_).mergeFrom(value).buildPartial(); + } else { + translatedContent_ = value; + } + onChanged(); + } else { + translatedContentBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1beta1.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.v1beta1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1beta1.TextSnippet.Builder getTranslatedContentBuilder() { + + onChanged(); + return getTranslatedContentFieldBuilder().getBuilder(); + } + /** + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + public com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getTranslatedContentOrBuilder() { + if (translatedContentBuilder_ != null) { + return translatedContentBuilder_.getMessageOrBuilder(); + } else { + return translatedContent_ == null ? + com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance() : translatedContent_; + } + } + /** + *
+     * Output only . The translated content.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, com.google.cloud.automl.v1beta1.TextSnippet.Builder, com.google.cloud.automl.v1beta1.TextSnippetOrBuilder> + getTranslatedContentFieldBuilder() { + if (translatedContentBuilder_ == null) { + translatedContentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, com.google.cloud.automl.v1beta1.TextSnippet.Builder, com.google.cloud.automl.v1beta1.TextSnippetOrBuilder>( + getTranslatedContent(), + getParentForChildren(), + isClean()); + translatedContent_ = null; + } + return translatedContentBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.TranslationAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TranslationAnnotation) + private static final com.google.cloud.automl.v1beta1.TranslationAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.TranslationAnnotation(); + } + + public static com.google.cloud.automl.v1beta1.TranslationAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.TranslationAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationAnnotationOrBuilder.java new file mode 100644 index 000000000000..14530b83338e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationAnnotationOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +public interface TranslationAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.TranslationAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + boolean hasTranslatedContent(); + /** + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + com.google.cloud.automl.v1beta1.TextSnippet getTranslatedContent(); + /** + *
+   * Output only . The translated content.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet translated_content = 1; + */ + com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getTranslatedContentOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationDatasetMetadata.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationDatasetMetadata.java new file mode 100644 index 000000000000..c7e2f4ec898a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationDatasetMetadata.java @@ -0,0 +1,707 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Dataset metadata that is specific to translation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TranslationDatasetMetadata} + */ +public final class TranslationDatasetMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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; + } + } + } + } 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.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.TranslationDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata other = (com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) obj; + + boolean result = true; + result = result && getSourceLanguageCode() + .equals(other.getSourceLanguageCode()); + result = result && getTargetLanguageCode() + .equals(other.getTargetLanguageCode()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.TranslationDatasetMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationDatasetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationDatasetMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationDatasetMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.TranslationDatasetMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.TranslationDatasetMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.TranslationDatasetMetadata) + com.google.cloud.automl.v1beta1.TranslationDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.class, com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + sourceLanguageCode_ = ""; + + targetLanguageCode_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_descriptor; + } + + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.TranslationDatasetMetadata.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadata build() { + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadata buildPartial() { + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata result = new com.google.cloud.automl.v1beta1.TranslationDatasetMetadata(this); + result.sourceLanguageCode_ = sourceLanguageCode_; + result.targetLanguageCode_ = targetLanguageCode_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.TranslationDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1beta1.TranslationDatasetMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.TranslationDatasetMetadata other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.TranslationDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.TranslationDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TranslationDatasetMetadata) + private static final com.google.cloud.automl.v1beta1.TranslationDatasetMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.TranslationDatasetMetadata(); + } + + public static com.google.cloud.automl.v1beta1.TranslationDatasetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.TranslationDatasetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationDatasetMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationDatasetMetadataOrBuilder.java new file mode 100644 index 000000000000..814bbfcba82f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationDatasetMetadataOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +public interface TranslationDatasetMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationEvaluationMetrics.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationEvaluationMetrics.java new file mode 100644 index 000000000000..d7d2cc05a14b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationEvaluationMetrics.java @@ -0,0 +1,551 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Evaluation metrics for the dataset.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TranslationEvaluationMetrics} + */ +public final class TranslationEvaluationMetrics extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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() { + bleuScore_ = 0D; + baseBleuScore_ = 0D; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 9: { + + bleuScore_ = input.readDouble(); + break; + } + case 17: { + + baseBleuScore_ = input.readDouble(); + 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.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.TranslationEvaluationMetrics)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics other = (com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) obj; + + boolean result = true; + result = result && ( + java.lang.Double.doubleToLongBits(getBleuScore()) + == java.lang.Double.doubleToLongBits( + other.getBleuScore())); + result = result && ( + java.lang.Double.doubleToLongBits(getBaseBleuScore()) + == java.lang.Double.doubleToLongBits( + other.getBaseBleuScore())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.TranslationEvaluationMetrics parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationEvaluationMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationEvaluationMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationEvaluationMetrics parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationEvaluationMetrics parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.TranslationEvaluationMetrics} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.TranslationEvaluationMetrics) + com.google.cloud.automl.v1beta1.TranslationEvaluationMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.class, com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + bleuScore_ = 0D; + + baseBleuScore_ = 0D; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_descriptor; + } + + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics build() { + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics buildPartial() { + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics result = new com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics(this); + result.bleuScore_ = bleuScore_; + result.baseBleuScore_ = baseBleuScore_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) { + return mergeFrom((com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.TranslationEvaluationMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TranslationEvaluationMetrics) + private static final com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics(); + } + + public static com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.TranslationEvaluationMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationEvaluationMetricsOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationEvaluationMetricsOrBuilder.java new file mode 100644 index 000000000000..8c9535aed8d9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationEvaluationMetricsOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +public interface TranslationEvaluationMetricsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationModelMetadata.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationModelMetadata.java new file mode 100644 index 000000000000..2099619f12a6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationModelMetadata.java @@ -0,0 +1,897 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Model metadata that is specific to translation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.TranslationModelMetadata} + */ +public final class TranslationModelMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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; + } + } + } + } 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.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TranslationModelMetadata.class, com.google.cloud.automl.v1beta1.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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.TranslationModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.TranslationModelMetadata other = (com.google.cloud.automl.v1beta1.TranslationModelMetadata) obj; + + boolean result = true; + result = result && getBaseModel() + .equals(other.getBaseModel()); + result = result && getSourceLanguageCode() + .equals(other.getSourceLanguageCode()); + result = result && getTargetLanguageCode() + .equals(other.getTargetLanguageCode()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.TranslationModelMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationModelMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.TranslationModelMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.TranslationModelMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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.v1beta1.TranslationModelMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.TranslationModelMetadata) + com.google.cloud.automl.v1beta1.TranslationModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.TranslationModelMetadata.class, com.google.cloud.automl.v1beta1.TranslationModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.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) { + } + } + public Builder clear() { + super.clear(); + baseModel_ = ""; + + sourceLanguageCode_ = ""; + + targetLanguageCode_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.TranslationProto.internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_descriptor; + } + + public com.google.cloud.automl.v1beta1.TranslationModelMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.TranslationModelMetadata.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.TranslationModelMetadata build() { + com.google.cloud.automl.v1beta1.TranslationModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.TranslationModelMetadata buildPartial() { + com.google.cloud.automl.v1beta1.TranslationModelMetadata result = new com.google.cloud.automl.v1beta1.TranslationModelMetadata(this); + result.baseModel_ = baseModel_; + result.sourceLanguageCode_ = sourceLanguageCode_; + result.targetLanguageCode_ = targetLanguageCode_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.TranslationModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1beta1.TranslationModelMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.TranslationModelMetadata other) { + if (other == com.google.cloud.automl.v1beta1.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; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.TranslationModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.TranslationModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TranslationModelMetadata) + private static final com.google.cloud.automl.v1beta1.TranslationModelMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.TranslationModelMetadata(); + } + + public static com.google.cloud.automl.v1beta1.TranslationModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.automl.v1beta1.TranslationModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationModelMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationModelMetadataOrBuilder.java new file mode 100644 index 000000000000..5d68214c8827 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationModelMetadataOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +public interface TranslationModelMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationProto.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationProto.java new file mode 100644 index 000000000000..f35f92b6a3a0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TranslationProto.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/translation.proto + +package com.google.cloud.automl.v1beta1; + +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_v1beta1_TranslationDatasetMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_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/v1beta1/translatio" + + "n.proto\022\033google.cloud.automl.v1beta1\032\034go" + + "ogle/api/annotations.proto\032,google/cloud" + + "/automl/v1beta1/data_items.proto\"X\n\032Tran" + + "slationDatasetMetadata\022\034\n\024source_languag" + + "e_code\030\001 \001(\t\022\034\n\024target_language_code\030\002 \001" + + "(\t\"K\n\034TranslationEvaluationMetrics\022\022\n\nbl" + + "eu_score\030\001 \001(\001\022\027\n\017base_bleu_score\030\002 \001(\001\"" + + "j\n\030TranslationModelMetadata\022\022\n\nbase_mode" + + "l\030\001 \001(\t\022\034\n\024source_language_code\030\002 \001(\t\022\034\n" + + "\024target_language_code\030\003 \001(\t\"]\n\025Translati" + + "onAnnotation\022D\n\022translated_content\030\001 \001(\013" + + "2(.google.cloud.automl.v1beta1.TextSnipp" + + "etBx\n\037com.google.cloud.automl.v1beta1B\020T" + + "ranslationProtoP\001ZAgoogle.golang.org/gen" + + "proto/googleapis/cloud/automl/v1beta1;au" + + "tomlb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.DataItems.getDescriptor(), + }, assigner); + internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_TranslationDatasetMetadata_descriptor, + new java.lang.String[] { "SourceLanguageCode", "TargetLanguageCode", }); + internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_TranslationEvaluationMetrics_descriptor, + new java.lang.String[] { "BleuScore", "BaseBleuScore", }); + internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_TranslationModelMetadata_descriptor, + new java.lang.String[] { "BaseModel", "SourceLanguageCode", "TargetLanguageCode", }); + internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_TranslationAnnotation_descriptor, + new java.lang.String[] { "TranslatedContent", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.DataItems.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/UndeployModelRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/UndeployModelRequest.java new file mode 100644 index 000000000000..48049c10f38a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/UndeployModelRequest.java @@ -0,0 +1,552 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +/** + *
+ * Request message for [AutoMl.UndeployModel][google.cloud.automl.v1beta1.AutoMl.UndeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.UndeployModelRequest} + */ +public final class UndeployModelRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.UndeployModelRequest) + UndeployModelRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UndeployModelRequest.newBuilder() to construct. + private UndeployModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UndeployModelRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UndeployModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.UndeployModelRequest.class, com.google.cloud.automl.v1beta1.UndeployModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of the model to undeploy.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Resource name of the model to undeploy.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.v1beta1.UndeployModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.UndeployModelRequest other = (com.google.cloud.automl.v1beta1.UndeployModelRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.v1beta1.UndeployModelRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.automl.v1beta1.UndeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.automl.v1beta1.UndeployModelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for [AutoMl.UndeployModel][google.cloud.automl.v1beta1.AutoMl.UndeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.UndeployModelRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.UndeployModelRequest) + com.google.cloud.automl.v1beta1.UndeployModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.UndeployModelRequest.class, com.google.cloud.automl.v1beta1.UndeployModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.UndeployModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.automl.v1beta1.AutoMlProto.internal_static_google_cloud_automl_v1beta1_UndeployModelRequest_descriptor; + } + + public com.google.cloud.automl.v1beta1.UndeployModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.UndeployModelRequest.getDefaultInstance(); + } + + public com.google.cloud.automl.v1beta1.UndeployModelRequest build() { + com.google.cloud.automl.v1beta1.UndeployModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.automl.v1beta1.UndeployModelRequest buildPartial() { + com.google.cloud.automl.v1beta1.UndeployModelRequest result = new com.google.cloud.automl.v1beta1.UndeployModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.UndeployModelRequest) { + return mergeFrom((com.google.cloud.automl.v1beta1.UndeployModelRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.UndeployModelRequest other) { + if (other == com.google.cloud.automl.v1beta1.UndeployModelRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.UndeployModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.UndeployModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.UndeployModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.UndeployModelRequest) + private static final com.google.cloud.automl.v1beta1.UndeployModelRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.UndeployModelRequest(); + } + + public static com.google.cloud.automl.v1beta1.UndeployModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public UndeployModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployModelRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.automl.v1beta1.UndeployModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/UndeployModelRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/UndeployModelRequestOrBuilder.java new file mode 100644 index 000000000000..beb63591046d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/UndeployModelRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/service.proto + +package com.google.cloud.automl.v1beta1; + +public interface UndeployModelRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.UndeployModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the model to undeploy.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of the model to undeploy.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/annotation_payload.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/annotation_payload.proto new file mode 100644 index 000000000000..02bc280b21ca --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/annotation_payload.proto @@ -0,0 +1,51 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// Contains annotation information that is relevant to AutoML. +message AnnotationPayload { + // Output only . Additional information about the annotation + // specific to the AutoML solution. + oneof detail { + // Annotation details for translation. + TranslationAnnotation translation = 2; + + // Annotation details for content or image classification. + ClassificationAnnotation classification = 3; + } + + // Output only . The resource ID of the annotation spec that + // this annotation pertains to. The annotation spec comes from either an + // ancestor dataset, or the dataset that was used to train the model in use. + string annotation_spec_id = 1; + + // Output only. The value of [AnnotationSpec.display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] when the model + // was trained. Because this field returns a value at model training time, + // for different models trained using the same dataset, the returned value + // could be different as model owner could update the display_name between + // any two model training. + string display_name = 5; +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/classification.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/classification.proto new file mode 100644 index 000000000000..085096519733 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/classification.proto @@ -0,0 +1,118 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_outer_classname = "ClassificationProto"; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// Contains annotation details specific to classification. +message ClassificationAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence that the annotation is positive. If a user + // approves an annotation as negative or positive, the score value remains + // unchanged. If a user creates an annotation, the score is 0 for negative or + // 1 for positive. + float score = 1; +} + +// Model evaluation metrics for classification problems. +// Visible only to v1beta1 +message ClassificationEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 2; + + // Output only. Precision under the given confidence threshold. + float precision = 3; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + + // Output only. The recall when only considering the label that has the + // highest prediction score and not below the confidence threshold for each + // example. + float recall_at1 = 5; + + // Output only. The precision when only considering the label that has the + // highest predictionscore and not below the confidence threshold for each + // example. + float precision_at1 = 6; + + // Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + float f1_score_at1 = 7; + } + + // Confusion matrix of the model running the classification. + message ConfusionMatrix { + // Output only. A row in the confusion matrix. + message Row { + // Output only. Value of the specific cell in the confusion matrix. + // The number of values each row is equal to the size of + // annotatin_spec_id. + repeated int32 example_count = 1; + } + + // Output only. IDs of the annotation specs used in the confusion matrix. + repeated string annotation_spec_id = 1; + + // Output only. Rows in the confusion matrix. The number of rows is equal to + // the size of `annotation_spec_id`. + // `row[i].value[j]` is the number of examples that have ground truth of the + // `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by + // the model being evaluated. + repeated Row row = 2; + } + + // Output only. The Area under precision recall curve metric. + float au_prc = 1; + + // Output only. The Area under precision recall curve metric based on priors. + float base_au_prc = 2; + + // Output only. Metrics that have confidence thresholds. + // Precision-recall curve can be derived from it. + repeated ConfidenceMetricsEntry confidence_metrics_entry = 3; + + // Output only. Confusion matrix of the evaluation. + // Only set for MULTICLASS classification problems where number + // of labels is no more than 10. + // Only set for model level evaluation, not for evaluation per label. + ConfusionMatrix confusion_matrix = 4; + + // Output only. The annotation spec ids used for this evaluation. + repeated string annotation_spec_id = 5; +} + +// Type of the classification problem. +enum ClassificationType { + // Should not be used, an un-set enum has this value by default. + CLASSIFICATION_TYPE_UNSPECIFIED = 0; + + // At most one label is allowed per example. + MULTICLASS = 1; + + // Multiple labels are allowed for one example. + MULTILABEL = 2; +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto new file mode 100644 index 000000000000..9dd97c1f2345 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto @@ -0,0 +1,73 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/io.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// A representation of an image. +message Image { + // Input only. The data representing the image. + // For Predict calls [image_bytes][] must be set, as other options are not + // currently supported by prediction API. You can read the contents of an + // uploaded image by using the [content_uri][] field. + oneof data { + // Image content represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes image_bytes = 1; + + // An input config specifying the content of the image. + InputConfig input_config = 6; + } + + // Output only. HTTP URI to the thumbnail image. + string thumbnail_uri = 4; +} + +// A representation of a text snippet. +message TextSnippet { + // Required. The content of the text snippet as a string. Up to 250000 + // characters long. + string content = 1; + + // The format of the source text. For example, "text/html" or + // "text/plain". If left blank the format is automatically determined from + // the type of the uploaded content. The default is "text/html". Up to 25000 + // characters long. + 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 { + // An example image. + Image image = 1; + + // Example text. + TextSnippet text_snippet = 2; + } +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/dataset.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/dataset.proto new file mode 100644 index 000000000000..abc7d38fa297 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/dataset.proto @@ -0,0 +1,63 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/annotation_payload.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; +import "google/cloud/automl/v1beta1/image.proto"; +import "google/cloud/automl/v1beta1/text.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// 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; + + // Metadata for a dataset used for image classification. + ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + + // Metadata for a dataset used for text classification. + TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + } + + // 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; + + // 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; +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/image.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/image.proto new file mode 100644 index 000000000000..c3442482e875 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/image.proto @@ -0,0 +1,56 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_outer_classname = "ImageProto"; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// Dataset metadata that is specific to image classification. +message ImageClassificationDatasetMetadata { + // Required. + // Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Model metadata for image classification. +message ImageClassificationModelMetadata { + // Optional. The ID of the `base` model. If it is specified, the new model + // will be created based on the `base` model. Otherwise, the new model will be + // created from scratch. The `base` model is expected to be in the same + // `project` and `location` as the new model to create. + string base_model_id = 1; + + // Required. The train budget of creating this model. The actual + // `train_cost` will be equal or less than this value. + int64 train_budget = 2; + + // Output only. The actual train cost of creating this model. If this + // model is created from a `base` model, the train cost used to create the + // `base` model are not included. + int64 train_cost = 3; + + // Output only. The reason that this create model operation stopped, + // e.g. BUDGET_REACHED, CONVERGED. + string stop_reason = 5; +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto new file mode 100644 index 000000000000..08c9d93b3572 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto @@ -0,0 +1,61 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// Input configuration. +message InputConfig { + // Required. The source of the input. + oneof source { + // The GCS location for the input content. + GcsSource gcs_source = 1; + } +} + +// Output configuration. +message OutputConfig { + // Required. The destination of the output. + oneof destination { + // The GCS location where the output must be written to. + GcsDestination gcs_destination = 1; + } +} + +// The GCS 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: gs://bucket/directory/object.csv + repeated string input_uris = 1; +} + +// The GCS location where the output must 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/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/model.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/model.proto new file mode 100644 index 000000000000..b03a21112236 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/model.proto @@ -0,0 +1,85 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/image.proto"; +import "google/cloud/automl/v1beta1/text.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// 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 image classification models. + ImageClassificationModelMetadata image_classification_model_metadata = 13; + + // Metadata for text classification models. + TextClassificationModelMetadata text_classification_model_metadata = 14; + + // 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. + 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 this model was created. + 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. + DeploymentState deployment_state = 8; +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/model_evaluation.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/model_evaluation.proto new file mode 100644 index 000000000000..93f1ca9f1389 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/model_evaluation.proto @@ -0,0 +1,61 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// Evaluation results of a model. +message ModelEvaluation { + // Output only. Problem type specific evaluation metrics. + oneof metrics { + // Evaluation metrics for models on classification problems models. + ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + + // Evaluation metrics for models on translation models. + 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 + // ID is empty for overall model evaluation. + // NOTE: Currently there is no way to obtain the display_name of the + // annotation spec from its ID. To see the display_names, review the model + // evaluations in the UI. + 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. + int32 evaluated_example_count = 6; +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/operations.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/operations.proto new file mode 100644 index 000000000000..ae911eff36d3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/operations.proto @@ -0,0 +1,59 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/model.proto"; +import "google/cloud/automl/v1beta1/model_evaluation.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// 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 CreateModel operation. + CreateModelOperationMetadata create_model_details = 10; + } + + // Output only. Progress of operation. Range: [0, 100]. + 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 CreateModel operation. +message CreateModelOperationMetadata { + +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/prediction_service.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/prediction_service.proto new file mode 100644 index 000000000000..6d9c1ef0771d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/prediction_service.proto @@ -0,0 +1,73 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/annotation_payload.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// AutoML Prediction API. +service PredictionService { + // Perform a prediction. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:predict" + body: "*" + }; + } +} + +// Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.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. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an + // image, it will only produce results that have at least this confidence + // score threshold. The default is 0.5. + map params = 3; +} + +// Response message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. +// +// Currently, this is only +// used to return an image recognition prediction result. More prediction +// output metadata might be introduced in the future. +message PredictResponse { + // Prediction result. + repeated AnnotationPayload payload = 1; + + // Additional domain-specific prediction response metadata. + map metadata = 2; +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/service.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/service.proto new file mode 100644 index 000000000000..8fb916d9a0c1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/service.proto @@ -0,0 +1,365 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/annotation_payload.proto"; +import "google/cloud/automl/v1beta1/dataset.proto"; +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/model.proto"; +import "google/cloud/automl/v1beta1/model_evaluation.proto"; +import "google/cloud/automl/v1beta1/operations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_outer_classname = "AutoMlProto"; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// 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}`. +// +service AutoMl { + // Creates a dataset. + rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/datasets" + body: "dataset" + }; + } + + // Gets a dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*}" + }; + } + + // Lists datasets in a project. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/datasets" + }; + } + + // 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: "/v1beta1/{name=projects/*/locations/*/datasets/*}" + }; + } + + // Imports data into a dataset. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:importData" + body: "*" + }; + } + + // Exports dataset's data to a Google Cloud Storage bucket. + // 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: "/v1beta1/{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: "/v1beta1/{parent=projects/*/locations/*}/models" + body: "model" + }; + } + + // Gets a model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*}" + }; + } + + // Lists models. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/models" + }; + } + + // Deletes a model. + // If a model is already deployed, this only deletes the model in AutoML BE, + // and does not change the status of the deployed model in the production + // environment. + // 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: "/v1beta1/{name=projects/*/locations/*/models/*}" + }; + } + + // Deploys model. + // Returns a [DeployModelResponse][] in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:deploy" + body: "*" + }; + } + + // Undeploys model. + // Returns an `UndeployModelResponse` in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:undeploy" + body: "*" + }; + } + + // Gets a model evaluation. + rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + }; + } + + // Lists model evaluations. + rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + }; + } +} + +// Request message for [AutoMl.CreateDataset][google.cloud.automl.v1beta1.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.v1beta1.AutoMl.GetDataset]. +message GetDatasetRequest { + // The resource name of the dataset to retrieve. + string name = 1; +} + +// Request message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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. + // + // An example of using the filter is: + // + // * `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.v1beta1.ListDatasetsResponse.next_page_token] of the previous + // [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.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.v1beta1.ListDatasetsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1beta1.AutoMl.DeleteDataset]. +message DeleteDatasetRequest { + // The resource name of the dataset to delete. + string name = 1; +} + +// Request message for [AutoMl.ImportData][google.cloud.automl.v1beta1.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. + InputConfig input_config = 3; +} + +// Request message for [AutoMl.ExportData][google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.AutoMl.GetModel]. +message GetModelRequest { + // Resource name of the model. + string name = 1; +} + +// Request message for [AutoMl.ListModels][google.cloud.automl.v1beta1.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. + // * `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 sibling 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.v1beta1.ListModelsResponse.next_page_token] of the previous + // [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModels][google.cloud.automl.v1beta1.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 [ListModels.page_token][] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.DeleteModel][google.cloud.automl.v1beta1.AutoMl.DeleteModel]. +message DeleteModelRequest { + // Resource name of the model being deleted. + string name = 1; +} + +// Request message for [AutoMl.DeployModel][google.cloud.automl.v1beta1.AutoMl.DeployModel]. +message DeployModelRequest { + // Resource name of the model to deploy. + string name = 1; +} + +// Request message for [AutoMl.UndeployModel][google.cloud.automl.v1beta1.AutoMl.UndeployModel]. +message UndeployModelRequest { + // Resource name of the model to undeploy. + string name = 1; +} + +// Request message for [AutoMl.GetModelEvaluation][google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation]. +message GetModelEvaluationRequest { + // Resource name for the model evaluation. + string name = 1; +} + +// Request message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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` of the previous + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.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 [ListModelEvaluations.page_token][] to obtain that page. + string next_page_token = 2; +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/text.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/text.proto new file mode 100644 index 000000000000..44d7311e02db --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/text.proto @@ -0,0 +1,38 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// Dataset metadata for classification. +message TextClassificationDatasetMetadata { + // Required. + // Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Model metadata that is specific to text classification. +message TextClassificationModelMetadata { + +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/translation.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/translation.proto new file mode 100644 index 000000000000..8ee3ae8c6034 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/translation.proto @@ -0,0 +1,67 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; +option java_multiple_files = true; +option java_outer_classname = "TranslationProto"; +option java_package = "com.google.cloud.automl.v1beta1"; + + +// 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/google-api-grpc/proto-google-cloud-vision-v1p3beta1/pom.xml b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/pom.xml new file mode 100644 index 000000000000..4cec4bf9fc58 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + proto-google-cloud-vision-v1p3beta1 + 0.19.1-SNAPSHOT + proto-google-cloud-vision-v1p3beta1 + PROTO library for proto-google-cloud-vision-v1p3beta1 + + com.google.api.grpc + google-api-grpc + 0.19.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AddProductToProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AddProductToProductSetRequest.java new file mode 100644 index 000000000000..18135f81912a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AddProductToProductSetRequest.java @@ -0,0 +1,735 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `AddProductToProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AddProductToProductSetRequest} + */ +public final class AddProductToProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) + AddProductToProductSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use AddProductToProductSetRequest.newBuilder() to construct. + private AddProductToProductSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AddProductToProductSetRequest() { + name_ = ""; + product_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AddProductToProductSetRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + product_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.class, com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name for the ProductSet to modify.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+   * The resource name for the ProductSet to modify.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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 PRODUCT_FIELD_NUMBER = 2; + private volatile java.lang.Object product_; + /** + *
+   * The resource name for the Product to be added to this ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string product = 2; + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + *
+   * The resource name for the Product to be added to this ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string product = 2; + */ + public com.google.protobuf.ByteString + getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getProductBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, product_); + } + unknownFields.writeTo(output); + } + + 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 (!getProductBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, product_); + } + 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.vision.v1p3beta1.AddProductToProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest other = (com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getProduct() + .equals(other.getProduct()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest 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.vision.v1p3beta1.AddProductToProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest 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.vision.v1p3beta1.AddProductToProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest 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.vision.v1p3beta1.AddProductToProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest 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.vision.v1p3beta1.AddProductToProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `AddProductToProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AddProductToProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.class, com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + product_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest build() { + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest result = new com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest(this); + result.name_ = name_; + result.product_ = product_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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 product_ = ""; + /** + *
+     * The resource name for the Product to be added to this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name for the Product to be added to this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public com.google.protobuf.ByteString + getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name for the Product to be added to this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public Builder setProduct( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name for the Product to be added to this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + *
+     * The resource name for the Product to be added to this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public Builder setProductBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) + private static final com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AddProductToProductSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddProductToProductSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AddProductToProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AddProductToProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..cece9301503e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AddProductToProductSetRequestOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface AddProductToProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name for the ProductSet to modify.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The resource name for the ProductSet to modify.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The resource name for the Product to be added to this ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string product = 2; + */ + java.lang.String getProduct(); + /** + *
+   * The resource name for the Product to be added to this ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string product = 2; + */ + com.google.protobuf.ByteString + getProductBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateFileResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateFileResponse.java new file mode 100644 index 000000000000..5dc7f142608a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateFileResponse.java @@ -0,0 +1,1068 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response to a single file annotation request. A file may contain one or more
+ * images, which individually have their own responses.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AnnotateFileResponse} + */ +public final class AnnotateFileResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.AnnotateFileResponse) + AnnotateFileResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use AnnotateFileResponse.newBuilder() to construct. + private AnnotateFileResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AnnotateFileResponse() { + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AnnotateFileResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = input.readMessage(com.google.cloud.vision.v1p3beta1.InputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + responses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + responses_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.parser(), extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AnnotateFileResponse.class, com.google.cloud.vision.v1p3beta1.AnnotateFileResponse.Builder.class); + } + + private int bitField0_; + public static final int INPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.InputConfig inputConfig_; + /** + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfig getInputConfig() { + return inputConfig_ == null ? com.google.cloud.vision.v1p3beta1.InputConfig.getDefaultInstance() : inputConfig_; + } + /** + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int RESPONSES_FIELD_NUMBER = 2; + private java.util.List responses_; + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List getResponsesList() { + return responses_; + } + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public int getResponsesCount() { + return responses_.size(); + } + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getResponses(int index) { + return responses_.get(index); + } + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (inputConfig_ != null) { + output.writeMessage(1, getInputConfig()); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(2, responses_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getInputConfig()); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, responses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.AnnotateFileResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.AnnotateFileResponse other = (com.google.cloud.vision.v1p3beta1.AnnotateFileResponse) obj; + + boolean result = true; + result = result && (hasInputConfig() == other.hasInputConfig()); + if (hasInputConfig()) { + result = result && getInputConfig() + .equals(other.getInputConfig()); + } + result = result && getResponsesList() + .equals(other.getResponsesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse 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.vision.v1p3beta1.AnnotateFileResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse 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.vision.v1p3beta1.AnnotateFileResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse 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.vision.v1p3beta1.AnnotateFileResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse 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.vision.v1p3beta1.AnnotateFileResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.AnnotateFileResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 to a single file annotation request. A file may contain one or more
+   * images, which individually have their own responses.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AnnotateFileResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.AnnotateFileResponse) + com.google.cloud.vision.v1p3beta1.AnnotateFileResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AnnotateFileResponse.class, com.google.cloud.vision.v1p3beta1.AnnotateFileResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.AnnotateFileResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + responsesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateFileResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.AnnotateFileResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.AnnotateFileResponse build() { + com.google.cloud.vision.v1p3beta1.AnnotateFileResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateFileResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.AnnotateFileResponse result = new com.google.cloud.vision.v1p3beta1.AnnotateFileResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.AnnotateFileResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.AnnotateFileResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.AnnotateFileResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.AnnotateFileResponse.getDefaultInstance()) return this; + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000002); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResponsesFieldBuilder() : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.AnnotateFileResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.AnnotateFileResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.InputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.InputConfig, com.google.cloud.vision.v1p3beta1.InputConfig.Builder, com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder> inputConfigBuilder_; + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null ? com.google.cloud.vision.v1p3beta1.InputConfig.getDefaultInstance() : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig(com.google.cloud.vision.v1p3beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1p3beta1.InputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public Builder mergeInputConfig(com.google.cloud.vision.v1p3beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.vision.v1p3beta1.InputConfig.newBuilder(inputConfig_).mergeFrom(value).buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null ? + com.google.cloud.vision.v1p3beta1.InputConfig.getDefaultInstance() : inputConfig_; + } + } + /** + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.InputConfig, com.google.cloud.vision.v1p3beta1.InputConfig.Builder, com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.InputConfig, com.google.cloud.vision.v1p3beta1.InputConfig.Builder, com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder>( + getInputConfig(), + getParentForChildren(), + isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private java.util.List responses_ = + java.util.Collections.emptyList(); + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder> responsesBuilder_; + + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder addResponses(com.google.cloud.vision.v1p3beta1.AnnotateImageResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder addResponses( + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.getDefaultInstance()); + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.getDefaultInstance()); + } + /** + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.AnnotateFileResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AnnotateFileResponse) + private static final com.google.cloud.vision.v1p3beta1.AnnotateFileResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.AnnotateFileResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.AnnotateFileResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AnnotateFileResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateFileResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateFileResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateFileResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateFileResponseOrBuilder.java new file mode 100644 index 000000000000..a4a5bea3b3ed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateFileResponseOrBuilder.java @@ -0,0 +1,78 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface AnnotateFileResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.AnnotateFileResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + boolean hasInputConfig(); + /** + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p3beta1.InputConfig getInputConfig(); + /** + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + java.util.List + getResponsesList(); + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getResponses(int index); + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + int getResponsesCount(); + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + java.util.List + getResponsesOrBuilderList(); + /** + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 2; + */ + com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageRequest.java new file mode 100644 index 000000000000..dea451f46bc1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageRequest.java @@ -0,0 +1,1297 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request for performing Google Cloud Vision API tasks over a user-provided
+ * image, with user-requested features.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AnnotateImageRequest} + */ +public final class AnnotateImageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.AnnotateImageRequest) + AnnotateImageRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use AnnotateImageRequest.newBuilder() to construct. + private AnnotateImageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AnnotateImageRequest() { + features_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AnnotateImageRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.Image.Builder subBuilder = null; + if (image_ != null) { + subBuilder = image_.toBuilder(); + } + image_ = input.readMessage(com.google.cloud.vision.v1p3beta1.Image.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(image_); + image_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + features_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + features_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Feature.parser(), extensionRegistry)); + break; + } + case 26: { + com.google.cloud.vision.v1p3beta1.ImageContext.Builder subBuilder = null; + if (imageContext_ != null) { + subBuilder = imageContext_.toBuilder(); + } + imageContext_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ImageContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(imageContext_); + imageContext_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + features_ = java.util.Collections.unmodifiableList(features_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.class, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder.class); + } + + private int bitField0_; + public static final int IMAGE_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.Image image_; + /** + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public boolean hasImage() { + return image_ != null; + } + /** + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p3beta1.Image getImage() { + return image_ == null ? com.google.cloud.vision.v1p3beta1.Image.getDefaultInstance() : image_; + } + /** + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p3beta1.ImageOrBuilder getImageOrBuilder() { + return getImage(); + } + + public static final int FEATURES_FIELD_NUMBER = 2; + private java.util.List features_; + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + return features_; + } + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List + getFeaturesOrBuilderList() { + return features_; + } + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public int getFeaturesCount() { + return features_.size(); + } + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature getFeatures(int index) { + return features_.get(index); + } + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.FeatureOrBuilder getFeaturesOrBuilder( + int index) { + return features_.get(index); + } + + public static final int IMAGE_CONTEXT_FIELD_NUMBER = 3; + private com.google.cloud.vision.v1p3beta1.ImageContext imageContext_; + /** + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public boolean hasImageContext() { + return imageContext_ != null; + } + /** + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContext getImageContext() { + return imageContext_ == null ? com.google.cloud.vision.v1p3beta1.ImageContext.getDefaultInstance() : imageContext_; + } + /** + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder getImageContextOrBuilder() { + return getImageContext(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (image_ != null) { + output.writeMessage(1, getImage()); + } + for (int i = 0; i < features_.size(); i++) { + output.writeMessage(2, features_.get(i)); + } + if (imageContext_ != null) { + output.writeMessage(3, getImageContext()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (image_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getImage()); + } + for (int i = 0; i < features_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, features_.get(i)); + } + if (imageContext_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getImageContext()); + } + 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.vision.v1p3beta1.AnnotateImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest other = (com.google.cloud.vision.v1p3beta1.AnnotateImageRequest) obj; + + boolean result = true; + result = result && (hasImage() == other.hasImage()); + if (hasImage()) { + result = result && getImage() + .equals(other.getImage()); + } + result = result && getFeaturesList() + .equals(other.getFeaturesList()); + result = result && (hasImageContext() == other.hasImageContext()); + if (hasImageContext()) { + result = result && getImageContext() + .equals(other.getImageContext()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasImage()) { + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + } + if (getFeaturesCount() > 0) { + hash = (37 * hash) + FEATURES_FIELD_NUMBER; + hash = (53 * hash) + getFeaturesList().hashCode(); + } + if (hasImageContext()) { + hash = (37 * hash) + IMAGE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getImageContext().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest 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.vision.v1p3beta1.AnnotateImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest 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.vision.v1p3beta1.AnnotateImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest 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.vision.v1p3beta1.AnnotateImageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest 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.vision.v1p3beta1.AnnotateImageRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.AnnotateImageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 for performing Google Cloud Vision API tasks over a user-provided
+   * image, with user-requested features.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AnnotateImageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.AnnotateImageRequest) + com.google.cloud.vision.v1p3beta1.AnnotateImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.class, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFeaturesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (imageBuilder_ == null) { + image_ = null; + } else { + image_ = null; + imageBuilder_ = null; + } + if (featuresBuilder_ == null) { + features_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + featuresBuilder_.clear(); + } + if (imageContextBuilder_ == null) { + imageContext_ = null; + } else { + imageContext_ = null; + imageContextBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest build() { + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest result = new com.google.cloud.vision.v1p3beta1.AnnotateImageRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (imageBuilder_ == null) { + result.image_ = image_; + } else { + result.image_ = imageBuilder_.build(); + } + if (featuresBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + features_ = java.util.Collections.unmodifiableList(features_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.features_ = features_; + } else { + result.features_ = featuresBuilder_.build(); + } + if (imageContextBuilder_ == null) { + result.imageContext_ = imageContext_; + } else { + result.imageContext_ = imageContextBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.AnnotateImageRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.AnnotateImageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.AnnotateImageRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.getDefaultInstance()) return this; + if (other.hasImage()) { + mergeImage(other.getImage()); + } + if (featuresBuilder_ == null) { + if (!other.features_.isEmpty()) { + if (features_.isEmpty()) { + features_ = other.features_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFeaturesIsMutable(); + features_.addAll(other.features_); + } + onChanged(); + } + } else { + if (!other.features_.isEmpty()) { + if (featuresBuilder_.isEmpty()) { + featuresBuilder_.dispose(); + featuresBuilder_ = null; + features_ = other.features_; + bitField0_ = (bitField0_ & ~0x00000002); + featuresBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFeaturesFieldBuilder() : null; + } else { + featuresBuilder_.addAllMessages(other.features_); + } + } + } + if (other.hasImageContext()) { + mergeImageContext(other.getImageContext()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.AnnotateImageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.Image image_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Image, com.google.cloud.vision.v1p3beta1.Image.Builder, com.google.cloud.vision.v1p3beta1.ImageOrBuilder> imageBuilder_; + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public boolean hasImage() { + return imageBuilder_ != null || image_ != null; + } + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p3beta1.Image getImage() { + if (imageBuilder_ == null) { + return image_ == null ? com.google.cloud.vision.v1p3beta1.Image.getDefaultInstance() : image_; + } else { + return imageBuilder_.getMessage(); + } + } + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public Builder setImage(com.google.cloud.vision.v1p3beta1.Image value) { + if (imageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + image_ = value; + onChanged(); + } else { + imageBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public Builder setImage( + com.google.cloud.vision.v1p3beta1.Image.Builder builderForValue) { + if (imageBuilder_ == null) { + image_ = builderForValue.build(); + onChanged(); + } else { + imageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public Builder mergeImage(com.google.cloud.vision.v1p3beta1.Image value) { + if (imageBuilder_ == null) { + if (image_ != null) { + image_ = + com.google.cloud.vision.v1p3beta1.Image.newBuilder(image_).mergeFrom(value).buildPartial(); + } else { + image_ = value; + } + onChanged(); + } else { + imageBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public Builder clearImage() { + if (imageBuilder_ == null) { + image_ = null; + onChanged(); + } else { + image_ = null; + imageBuilder_ = null; + } + + return this; + } + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p3beta1.Image.Builder getImageBuilder() { + + onChanged(); + return getImageFieldBuilder().getBuilder(); + } + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p3beta1.ImageOrBuilder getImageOrBuilder() { + if (imageBuilder_ != null) { + return imageBuilder_.getMessageOrBuilder(); + } else { + return image_ == null ? + com.google.cloud.vision.v1p3beta1.Image.getDefaultInstance() : image_; + } + } + /** + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Image, com.google.cloud.vision.v1p3beta1.Image.Builder, com.google.cloud.vision.v1p3beta1.ImageOrBuilder> + getImageFieldBuilder() { + if (imageBuilder_ == null) { + imageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Image, com.google.cloud.vision.v1p3beta1.Image.Builder, com.google.cloud.vision.v1p3beta1.ImageOrBuilder>( + getImage(), + getParentForChildren(), + isClean()); + image_ = null; + } + return imageBuilder_; + } + + private java.util.List features_ = + java.util.Collections.emptyList(); + private void ensureFeaturesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + features_ = new java.util.ArrayList(features_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Feature, com.google.cloud.vision.v1p3beta1.Feature.Builder, com.google.cloud.vision.v1p3beta1.FeatureOrBuilder> featuresBuilder_; + + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + if (featuresBuilder_ == null) { + return java.util.Collections.unmodifiableList(features_); + } else { + return featuresBuilder_.getMessageList(); + } + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public int getFeaturesCount() { + if (featuresBuilder_ == null) { + return features_.size(); + } else { + return featuresBuilder_.getCount(); + } + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature getFeatures(int index) { + if (featuresBuilder_ == null) { + return features_.get(index); + } else { + return featuresBuilder_.getMessage(index); + } + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder setFeatures( + int index, com.google.cloud.vision.v1p3beta1.Feature value) { + if (featuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeaturesIsMutable(); + features_.set(index, value); + onChanged(); + } else { + featuresBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder setFeatures( + int index, com.google.cloud.vision.v1p3beta1.Feature.Builder builderForValue) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + features_.set(index, builderForValue.build()); + onChanged(); + } else { + featuresBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.vision.v1p3beta1.Feature value) { + if (featuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeaturesIsMutable(); + features_.add(value); + onChanged(); + } else { + featuresBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addFeatures( + int index, com.google.cloud.vision.v1p3beta1.Feature value) { + if (featuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeaturesIsMutable(); + features_.add(index, value); + onChanged(); + } else { + featuresBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addFeatures( + com.google.cloud.vision.v1p3beta1.Feature.Builder builderForValue) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + features_.add(builderForValue.build()); + onChanged(); + } else { + featuresBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addFeatures( + int index, com.google.cloud.vision.v1p3beta1.Feature.Builder builderForValue) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + features_.add(index, builderForValue.build()); + onChanged(); + } else { + featuresBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addAllFeatures( + java.lang.Iterable values) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, features_); + onChanged(); + } else { + featuresBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder clearFeatures() { + if (featuresBuilder_ == null) { + features_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + featuresBuilder_.clear(); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder removeFeatures(int index) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + features_.remove(index); + onChanged(); + } else { + featuresBuilder_.remove(index); + } + return this; + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature.Builder getFeaturesBuilder( + int index) { + return getFeaturesFieldBuilder().getBuilder(index); + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.FeatureOrBuilder getFeaturesOrBuilder( + int index) { + if (featuresBuilder_ == null) { + return features_.get(index); } else { + return featuresBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List + getFeaturesOrBuilderList() { + if (featuresBuilder_ != null) { + return featuresBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(features_); + } + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature.Builder addFeaturesBuilder() { + return getFeaturesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Feature.getDefaultInstance()); + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature.Builder addFeaturesBuilder( + int index) { + return getFeaturesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Feature.getDefaultInstance()); + } + /** + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List + getFeaturesBuilderList() { + return getFeaturesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Feature, com.google.cloud.vision.v1p3beta1.Feature.Builder, com.google.cloud.vision.v1p3beta1.FeatureOrBuilder> + getFeaturesFieldBuilder() { + if (featuresBuilder_ == null) { + featuresBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Feature, com.google.cloud.vision.v1p3beta1.Feature.Builder, com.google.cloud.vision.v1p3beta1.FeatureOrBuilder>( + features_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + features_ = null; + } + return featuresBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.ImageContext imageContext_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageContext, com.google.cloud.vision.v1p3beta1.ImageContext.Builder, com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder> imageContextBuilder_; + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public boolean hasImageContext() { + return imageContextBuilder_ != null || imageContext_ != null; + } + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContext getImageContext() { + if (imageContextBuilder_ == null) { + return imageContext_ == null ? com.google.cloud.vision.v1p3beta1.ImageContext.getDefaultInstance() : imageContext_; + } else { + return imageContextBuilder_.getMessage(); + } + } + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public Builder setImageContext(com.google.cloud.vision.v1p3beta1.ImageContext value) { + if (imageContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imageContext_ = value; + onChanged(); + } else { + imageContextBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public Builder setImageContext( + com.google.cloud.vision.v1p3beta1.ImageContext.Builder builderForValue) { + if (imageContextBuilder_ == null) { + imageContext_ = builderForValue.build(); + onChanged(); + } else { + imageContextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public Builder mergeImageContext(com.google.cloud.vision.v1p3beta1.ImageContext value) { + if (imageContextBuilder_ == null) { + if (imageContext_ != null) { + imageContext_ = + com.google.cloud.vision.v1p3beta1.ImageContext.newBuilder(imageContext_).mergeFrom(value).buildPartial(); + } else { + imageContext_ = value; + } + onChanged(); + } else { + imageContextBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public Builder clearImageContext() { + if (imageContextBuilder_ == null) { + imageContext_ = null; + onChanged(); + } else { + imageContext_ = null; + imageContextBuilder_ = null; + } + + return this; + } + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContext.Builder getImageContextBuilder() { + + onChanged(); + return getImageContextFieldBuilder().getBuilder(); + } + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder getImageContextOrBuilder() { + if (imageContextBuilder_ != null) { + return imageContextBuilder_.getMessageOrBuilder(); + } else { + return imageContext_ == null ? + com.google.cloud.vision.v1p3beta1.ImageContext.getDefaultInstance() : imageContext_; + } + } + /** + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageContext, com.google.cloud.vision.v1p3beta1.ImageContext.Builder, com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder> + getImageContextFieldBuilder() { + if (imageContextBuilder_ == null) { + imageContextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageContext, com.google.cloud.vision.v1p3beta1.ImageContext.Builder, com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder>( + getImageContext(), + getParentForChildren(), + isClean()); + imageContext_ = null; + } + return imageContextBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.AnnotateImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AnnotateImageRequest) + private static final com.google.cloud.vision.v1p3beta1.AnnotateImageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.AnnotateImageRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.AnnotateImageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AnnotateImageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateImageRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageRequestOrBuilder.java new file mode 100644 index 000000000000..ffecc574a8cb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageRequestOrBuilder.java @@ -0,0 +1,103 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface AnnotateImageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.AnnotateImageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + boolean hasImage(); + /** + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + com.google.cloud.vision.v1p3beta1.Image getImage(); + /** + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Image image = 1; + */ + com.google.cloud.vision.v1p3beta1.ImageOrBuilder getImageOrBuilder(); + + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + java.util.List + getFeaturesList(); + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p3beta1.Feature getFeatures(int index); + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + int getFeaturesCount(); + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + java.util.List + getFeaturesOrBuilderList(); + /** + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p3beta1.FeatureOrBuilder getFeaturesOrBuilder( + int index); + + /** + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + boolean hasImageContext(); + /** + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p3beta1.ImageContext getImageContext(); + /** + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder getImageContextOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageResponse.java new file mode 100644 index 000000000000..6bdb306855af --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageResponse.java @@ -0,0 +1,4939 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response to an image annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AnnotateImageResponse} + */ +public final class AnnotateImageResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.AnnotateImageResponse) + AnnotateImageResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use AnnotateImageResponse.newBuilder() to construct. + private AnnotateImageResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AnnotateImageResponse() { + faceAnnotations_ = java.util.Collections.emptyList(); + landmarkAnnotations_ = java.util.Collections.emptyList(); + logoAnnotations_ = java.util.Collections.emptyList(); + labelAnnotations_ = java.util.Collections.emptyList(); + localizedObjectAnnotations_ = java.util.Collections.emptyList(); + textAnnotations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AnnotateImageResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + faceAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + faceAnnotations_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.FaceAnnotation.parser(), extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + landmarkAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + landmarkAnnotations_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.EntityAnnotation.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + logoAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + logoAnnotations_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.EntityAnnotation.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + labelAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + labelAnnotations_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.EntityAnnotation.parser(), extensionRegistry)); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + textAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + textAnnotations_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.EntityAnnotation.parser(), extensionRegistry)); + break; + } + case 50: { + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.Builder subBuilder = null; + if (safeSearchAnnotation_ != null) { + subBuilder = safeSearchAnnotation_.toBuilder(); + } + safeSearchAnnotation_ = input.readMessage(com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(safeSearchAnnotation_); + safeSearchAnnotation_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + com.google.cloud.vision.v1p3beta1.ImageProperties.Builder subBuilder = null; + if (imagePropertiesAnnotation_ != null) { + subBuilder = imagePropertiesAnnotation_.toBuilder(); + } + imagePropertiesAnnotation_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ImageProperties.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(imagePropertiesAnnotation_); + imagePropertiesAnnotation_ = subBuilder.buildPartial(); + } + + break; + } + case 74: { + com.google.rpc.Status.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + case 90: { + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.Builder subBuilder = null; + if (cropHintsAnnotation_ != null) { + subBuilder = cropHintsAnnotation_.toBuilder(); + } + cropHintsAnnotation_ = input.readMessage(com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cropHintsAnnotation_); + cropHintsAnnotation_ = subBuilder.buildPartial(); + } + + break; + } + case 98: { + com.google.cloud.vision.v1p3beta1.TextAnnotation.Builder subBuilder = null; + if (fullTextAnnotation_ != null) { + subBuilder = fullTextAnnotation_.toBuilder(); + } + fullTextAnnotation_ = input.readMessage(com.google.cloud.vision.v1p3beta1.TextAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fullTextAnnotation_); + fullTextAnnotation_ = subBuilder.buildPartial(); + } + + break; + } + case 106: { + com.google.cloud.vision.v1p3beta1.WebDetection.Builder subBuilder = null; + if (webDetection_ != null) { + subBuilder = webDetection_.toBuilder(); + } + webDetection_ = input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(webDetection_); + webDetection_ = subBuilder.buildPartial(); + } + + break; + } + case 114: { + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Builder subBuilder = null; + if (productSearchResults_ != null) { + subBuilder = productSearchResults_.toBuilder(); + } + productSearchResults_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ProductSearchResults.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productSearchResults_); + productSearchResults_ = subBuilder.buildPartial(); + } + + break; + } + case 170: { + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.Builder subBuilder = null; + if (context_ != null) { + subBuilder = context_.toBuilder(); + } + context_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(context_); + context_ = subBuilder.buildPartial(); + } + + break; + } + case 178: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + localizedObjectAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + localizedObjectAnnotations_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.parser(), extensionRegistry)); + 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) == 0x00000001)) { + faceAnnotations_ = java.util.Collections.unmodifiableList(faceAnnotations_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + landmarkAnnotations_ = java.util.Collections.unmodifiableList(landmarkAnnotations_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + logoAnnotations_ = java.util.Collections.unmodifiableList(logoAnnotations_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + labelAnnotations_ = java.util.Collections.unmodifiableList(labelAnnotations_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + textAnnotations_ = java.util.Collections.unmodifiableList(textAnnotations_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + localizedObjectAnnotations_ = java.util.Collections.unmodifiableList(localizedObjectAnnotations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.class, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder.class); + } + + private int bitField0_; + public static final int FACE_ANNOTATIONS_FIELD_NUMBER = 1; + private java.util.List faceAnnotations_; + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public java.util.List getFaceAnnotationsList() { + return faceAnnotations_; + } + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public java.util.List + getFaceAnnotationsOrBuilderList() { + return faceAnnotations_; + } + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public int getFaceAnnotationsCount() { + return faceAnnotations_.size(); + } + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation getFaceAnnotations(int index) { + return faceAnnotations_.get(index); + } + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotationOrBuilder getFaceAnnotationsOrBuilder( + int index) { + return faceAnnotations_.get(index); + } + + public static final int LANDMARK_ANNOTATIONS_FIELD_NUMBER = 2; + private java.util.List landmarkAnnotations_; + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public java.util.List getLandmarkAnnotationsList() { + return landmarkAnnotations_; + } + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public java.util.List + getLandmarkAnnotationsOrBuilderList() { + return landmarkAnnotations_; + } + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public int getLandmarkAnnotationsCount() { + return landmarkAnnotations_.size(); + } + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getLandmarkAnnotations(int index) { + return landmarkAnnotations_.get(index); + } + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLandmarkAnnotationsOrBuilder( + int index) { + return landmarkAnnotations_.get(index); + } + + public static final int LOGO_ANNOTATIONS_FIELD_NUMBER = 3; + private java.util.List logoAnnotations_; + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public java.util.List getLogoAnnotationsList() { + return logoAnnotations_; + } + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public java.util.List + getLogoAnnotationsOrBuilderList() { + return logoAnnotations_; + } + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public int getLogoAnnotationsCount() { + return logoAnnotations_.size(); + } + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getLogoAnnotations(int index) { + return logoAnnotations_.get(index); + } + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLogoAnnotationsOrBuilder( + int index) { + return logoAnnotations_.get(index); + } + + public static final int LABEL_ANNOTATIONS_FIELD_NUMBER = 4; + private java.util.List labelAnnotations_; + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public java.util.List getLabelAnnotationsList() { + return labelAnnotations_; + } + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public java.util.List + getLabelAnnotationsOrBuilderList() { + return labelAnnotations_; + } + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public int getLabelAnnotationsCount() { + return labelAnnotations_.size(); + } + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getLabelAnnotations(int index) { + return labelAnnotations_.get(index); + } + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLabelAnnotationsOrBuilder( + int index) { + return labelAnnotations_.get(index); + } + + public static final int LOCALIZED_OBJECT_ANNOTATIONS_FIELD_NUMBER = 22; + private java.util.List localizedObjectAnnotations_; + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public java.util.List getLocalizedObjectAnnotationsList() { + return localizedObjectAnnotations_; + } + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public java.util.List + getLocalizedObjectAnnotationsOrBuilderList() { + return localizedObjectAnnotations_; + } + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public int getLocalizedObjectAnnotationsCount() { + return localizedObjectAnnotations_.size(); + } + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation getLocalizedObjectAnnotations(int index) { + return localizedObjectAnnotations_.get(index); + } + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotationOrBuilder getLocalizedObjectAnnotationsOrBuilder( + int index) { + return localizedObjectAnnotations_.get(index); + } + + public static final int TEXT_ANNOTATIONS_FIELD_NUMBER = 5; + private java.util.List textAnnotations_; + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public java.util.List getTextAnnotationsList() { + return textAnnotations_; + } + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public java.util.List + getTextAnnotationsOrBuilderList() { + return textAnnotations_; + } + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public int getTextAnnotationsCount() { + return textAnnotations_.size(); + } + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getTextAnnotations(int index) { + return textAnnotations_.get(index); + } + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getTextAnnotationsOrBuilder( + int index) { + return textAnnotations_.get(index); + } + + public static final int FULL_TEXT_ANNOTATION_FIELD_NUMBER = 12; + private com.google.cloud.vision.v1p3beta1.TextAnnotation fullTextAnnotation_; + /** + *
+   * If present, text (OCR) detection or document (OCR) text detection has
+   * completed successfully.
+   * This annotation provides the structural hierarchy for the OCR detected
+   * text.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public boolean hasFullTextAnnotation() { + return fullTextAnnotation_ != null; + } + /** + *
+   * If present, text (OCR) detection or document (OCR) text detection has
+   * completed successfully.
+   * This annotation provides the structural hierarchy for the OCR detected
+   * text.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation getFullTextAnnotation() { + return fullTextAnnotation_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.getDefaultInstance() : fullTextAnnotation_; + } + /** + *
+   * If present, text (OCR) detection or document (OCR) text detection has
+   * completed successfully.
+   * This annotation provides the structural hierarchy for the OCR detected
+   * text.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotationOrBuilder getFullTextAnnotationOrBuilder() { + return getFullTextAnnotation(); + } + + public static final int SAFE_SEARCH_ANNOTATION_FIELD_NUMBER = 6; + private com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation safeSearchAnnotation_; + /** + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public boolean hasSafeSearchAnnotation() { + return safeSearchAnnotation_ != null; + } + /** + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation getSafeSearchAnnotation() { + return safeSearchAnnotation_ == null ? com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.getDefaultInstance() : safeSearchAnnotation_; + } + /** + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotationOrBuilder getSafeSearchAnnotationOrBuilder() { + return getSafeSearchAnnotation(); + } + + public static final int IMAGE_PROPERTIES_ANNOTATION_FIELD_NUMBER = 8; + private com.google.cloud.vision.v1p3beta1.ImageProperties imagePropertiesAnnotation_; + /** + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public boolean hasImagePropertiesAnnotation() { + return imagePropertiesAnnotation_ != null; + } + /** + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p3beta1.ImageProperties getImagePropertiesAnnotation() { + return imagePropertiesAnnotation_ == null ? com.google.cloud.vision.v1p3beta1.ImageProperties.getDefaultInstance() : imagePropertiesAnnotation_; + } + /** + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p3beta1.ImagePropertiesOrBuilder getImagePropertiesAnnotationOrBuilder() { + return getImagePropertiesAnnotation(); + } + + public static final int CROP_HINTS_ANNOTATION_FIELD_NUMBER = 11; + private com.google.cloud.vision.v1p3beta1.CropHintsAnnotation cropHintsAnnotation_; + /** + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public boolean hasCropHintsAnnotation() { + return cropHintsAnnotation_ != null; + } + /** + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotation getCropHintsAnnotation() { + return cropHintsAnnotation_ == null ? com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.getDefaultInstance() : cropHintsAnnotation_; + } + /** + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotationOrBuilder getCropHintsAnnotationOrBuilder() { + return getCropHintsAnnotation(); + } + + public static final int WEB_DETECTION_FIELD_NUMBER = 13; + private com.google.cloud.vision.v1p3beta1.WebDetection webDetection_; + /** + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public boolean hasWebDetection() { + return webDetection_ != null; + } + /** + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection getWebDetection() { + return webDetection_ == null ? com.google.cloud.vision.v1p3beta1.WebDetection.getDefaultInstance() : webDetection_; + } + /** + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p3beta1.WebDetectionOrBuilder getWebDetectionOrBuilder() { + return getWebDetection(); + } + + public static final int PRODUCT_SEARCH_RESULTS_FIELD_NUMBER = 14; + private com.google.cloud.vision.v1p3beta1.ProductSearchResults productSearchResults_; + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public boolean hasProductSearchResults() { + return productSearchResults_ != null; + } + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults getProductSearchResults() { + return productSearchResults_ == null ? com.google.cloud.vision.v1p3beta1.ProductSearchResults.getDefaultInstance() : productSearchResults_; + } + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResultsOrBuilder getProductSearchResultsOrBuilder() { + return getProductSearchResults(); + } + + public static final int ERROR_FIELD_NUMBER = 9; + private com.google.rpc.Status error_; + /** + *
+   * If set, represents the error message for the operation.
+   * Note that filled-in image annotations are guaranteed to be
+   * correct, even when `error` is set.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + public boolean hasError() { + return error_ != null; + } + /** + *
+   * If set, represents the error message for the operation.
+   * Note that filled-in image annotations are guaranteed to be
+   * correct, even when `error` is set.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + *
+   * If set, represents the error message for the operation.
+   * Note that filled-in image annotations are guaranteed to be
+   * correct, even when `error` is set.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return getError(); + } + + public static final int CONTEXT_FIELD_NUMBER = 21; + private com.google.cloud.vision.v1p3beta1.ImageAnnotationContext context_; + /** + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public boolean hasContext() { + return context_ != null; + } + /** + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContext getContext() { + return context_ == null ? com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.getDefaultInstance() : context_; + } + /** + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContextOrBuilder getContextOrBuilder() { + return getContext(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < faceAnnotations_.size(); i++) { + output.writeMessage(1, faceAnnotations_.get(i)); + } + for (int i = 0; i < landmarkAnnotations_.size(); i++) { + output.writeMessage(2, landmarkAnnotations_.get(i)); + } + for (int i = 0; i < logoAnnotations_.size(); i++) { + output.writeMessage(3, logoAnnotations_.get(i)); + } + for (int i = 0; i < labelAnnotations_.size(); i++) { + output.writeMessage(4, labelAnnotations_.get(i)); + } + for (int i = 0; i < textAnnotations_.size(); i++) { + output.writeMessage(5, textAnnotations_.get(i)); + } + if (safeSearchAnnotation_ != null) { + output.writeMessage(6, getSafeSearchAnnotation()); + } + if (imagePropertiesAnnotation_ != null) { + output.writeMessage(8, getImagePropertiesAnnotation()); + } + if (error_ != null) { + output.writeMessage(9, getError()); + } + if (cropHintsAnnotation_ != null) { + output.writeMessage(11, getCropHintsAnnotation()); + } + if (fullTextAnnotation_ != null) { + output.writeMessage(12, getFullTextAnnotation()); + } + if (webDetection_ != null) { + output.writeMessage(13, getWebDetection()); + } + if (productSearchResults_ != null) { + output.writeMessage(14, getProductSearchResults()); + } + if (context_ != null) { + output.writeMessage(21, getContext()); + } + for (int i = 0; i < localizedObjectAnnotations_.size(); i++) { + output.writeMessage(22, localizedObjectAnnotations_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < faceAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, faceAnnotations_.get(i)); + } + for (int i = 0; i < landmarkAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, landmarkAnnotations_.get(i)); + } + for (int i = 0; i < logoAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, logoAnnotations_.get(i)); + } + for (int i = 0; i < labelAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, labelAnnotations_.get(i)); + } + for (int i = 0; i < textAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, textAnnotations_.get(i)); + } + if (safeSearchAnnotation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSafeSearchAnnotation()); + } + if (imagePropertiesAnnotation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getImagePropertiesAnnotation()); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getError()); + } + if (cropHintsAnnotation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getCropHintsAnnotation()); + } + if (fullTextAnnotation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, getFullTextAnnotation()); + } + if (webDetection_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, getWebDetection()); + } + if (productSearchResults_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, getProductSearchResults()); + } + if (context_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(21, getContext()); + } + for (int i = 0; i < localizedObjectAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(22, localizedObjectAnnotations_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.AnnotateImageResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse other = (com.google.cloud.vision.v1p3beta1.AnnotateImageResponse) obj; + + boolean result = true; + result = result && getFaceAnnotationsList() + .equals(other.getFaceAnnotationsList()); + result = result && getLandmarkAnnotationsList() + .equals(other.getLandmarkAnnotationsList()); + result = result && getLogoAnnotationsList() + .equals(other.getLogoAnnotationsList()); + result = result && getLabelAnnotationsList() + .equals(other.getLabelAnnotationsList()); + result = result && getLocalizedObjectAnnotationsList() + .equals(other.getLocalizedObjectAnnotationsList()); + result = result && getTextAnnotationsList() + .equals(other.getTextAnnotationsList()); + result = result && (hasFullTextAnnotation() == other.hasFullTextAnnotation()); + if (hasFullTextAnnotation()) { + result = result && getFullTextAnnotation() + .equals(other.getFullTextAnnotation()); + } + result = result && (hasSafeSearchAnnotation() == other.hasSafeSearchAnnotation()); + if (hasSafeSearchAnnotation()) { + result = result && getSafeSearchAnnotation() + .equals(other.getSafeSearchAnnotation()); + } + result = result && (hasImagePropertiesAnnotation() == other.hasImagePropertiesAnnotation()); + if (hasImagePropertiesAnnotation()) { + result = result && getImagePropertiesAnnotation() + .equals(other.getImagePropertiesAnnotation()); + } + result = result && (hasCropHintsAnnotation() == other.hasCropHintsAnnotation()); + if (hasCropHintsAnnotation()) { + result = result && getCropHintsAnnotation() + .equals(other.getCropHintsAnnotation()); + } + result = result && (hasWebDetection() == other.hasWebDetection()); + if (hasWebDetection()) { + result = result && getWebDetection() + .equals(other.getWebDetection()); + } + result = result && (hasProductSearchResults() == other.hasProductSearchResults()); + if (hasProductSearchResults()) { + result = result && getProductSearchResults() + .equals(other.getProductSearchResults()); + } + result = result && (hasError() == other.hasError()); + if (hasError()) { + result = result && getError() + .equals(other.getError()); + } + result = result && (hasContext() == other.hasContext()); + if (hasContext()) { + result = result && getContext() + .equals(other.getContext()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFaceAnnotationsCount() > 0) { + hash = (37 * hash) + FACE_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFaceAnnotationsList().hashCode(); + } + if (getLandmarkAnnotationsCount() > 0) { + hash = (37 * hash) + LANDMARK_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getLandmarkAnnotationsList().hashCode(); + } + if (getLogoAnnotationsCount() > 0) { + hash = (37 * hash) + LOGO_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getLogoAnnotationsList().hashCode(); + } + if (getLabelAnnotationsCount() > 0) { + hash = (37 * hash) + LABEL_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getLabelAnnotationsList().hashCode(); + } + if (getLocalizedObjectAnnotationsCount() > 0) { + hash = (37 * hash) + LOCALIZED_OBJECT_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getLocalizedObjectAnnotationsList().hashCode(); + } + if (getTextAnnotationsCount() > 0) { + hash = (37 * hash) + TEXT_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getTextAnnotationsList().hashCode(); + } + if (hasFullTextAnnotation()) { + hash = (37 * hash) + FULL_TEXT_ANNOTATION_FIELD_NUMBER; + hash = (53 * hash) + getFullTextAnnotation().hashCode(); + } + if (hasSafeSearchAnnotation()) { + hash = (37 * hash) + SAFE_SEARCH_ANNOTATION_FIELD_NUMBER; + hash = (53 * hash) + getSafeSearchAnnotation().hashCode(); + } + if (hasImagePropertiesAnnotation()) { + hash = (37 * hash) + IMAGE_PROPERTIES_ANNOTATION_FIELD_NUMBER; + hash = (53 * hash) + getImagePropertiesAnnotation().hashCode(); + } + if (hasCropHintsAnnotation()) { + hash = (37 * hash) + CROP_HINTS_ANNOTATION_FIELD_NUMBER; + hash = (53 * hash) + getCropHintsAnnotation().hashCode(); + } + if (hasWebDetection()) { + hash = (37 * hash) + WEB_DETECTION_FIELD_NUMBER; + hash = (53 * hash) + getWebDetection().hashCode(); + } + if (hasProductSearchResults()) { + hash = (37 * hash) + PRODUCT_SEARCH_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getProductSearchResults().hashCode(); + } + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse 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.vision.v1p3beta1.AnnotateImageResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse 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.vision.v1p3beta1.AnnotateImageResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse 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.vision.v1p3beta1.AnnotateImageResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse 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.vision.v1p3beta1.AnnotateImageResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.AnnotateImageResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 to an image annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AnnotateImageResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.AnnotateImageResponse) + com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.class, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFaceAnnotationsFieldBuilder(); + getLandmarkAnnotationsFieldBuilder(); + getLogoAnnotationsFieldBuilder(); + getLabelAnnotationsFieldBuilder(); + getLocalizedObjectAnnotationsFieldBuilder(); + getTextAnnotationsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (faceAnnotationsBuilder_ == null) { + faceAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + faceAnnotationsBuilder_.clear(); + } + if (landmarkAnnotationsBuilder_ == null) { + landmarkAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + landmarkAnnotationsBuilder_.clear(); + } + if (logoAnnotationsBuilder_ == null) { + logoAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + logoAnnotationsBuilder_.clear(); + } + if (labelAnnotationsBuilder_ == null) { + labelAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + labelAnnotationsBuilder_.clear(); + } + if (localizedObjectAnnotationsBuilder_ == null) { + localizedObjectAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + localizedObjectAnnotationsBuilder_.clear(); + } + if (textAnnotationsBuilder_ == null) { + textAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + textAnnotationsBuilder_.clear(); + } + if (fullTextAnnotationBuilder_ == null) { + fullTextAnnotation_ = null; + } else { + fullTextAnnotation_ = null; + fullTextAnnotationBuilder_ = null; + } + if (safeSearchAnnotationBuilder_ == null) { + safeSearchAnnotation_ = null; + } else { + safeSearchAnnotation_ = null; + safeSearchAnnotationBuilder_ = null; + } + if (imagePropertiesAnnotationBuilder_ == null) { + imagePropertiesAnnotation_ = null; + } else { + imagePropertiesAnnotation_ = null; + imagePropertiesAnnotationBuilder_ = null; + } + if (cropHintsAnnotationBuilder_ == null) { + cropHintsAnnotation_ = null; + } else { + cropHintsAnnotation_ = null; + cropHintsAnnotationBuilder_ = null; + } + if (webDetectionBuilder_ == null) { + webDetection_ = null; + } else { + webDetection_ = null; + webDetectionBuilder_ = null; + } + if (productSearchResultsBuilder_ == null) { + productSearchResults_ = null; + } else { + productSearchResults_ = null; + productSearchResultsBuilder_ = null; + } + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + if (contextBuilder_ == null) { + context_ = null; + } else { + context_ = null; + contextBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse build() { + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse result = new com.google.cloud.vision.v1p3beta1.AnnotateImageResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (faceAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + faceAnnotations_ = java.util.Collections.unmodifiableList(faceAnnotations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.faceAnnotations_ = faceAnnotations_; + } else { + result.faceAnnotations_ = faceAnnotationsBuilder_.build(); + } + if (landmarkAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + landmarkAnnotations_ = java.util.Collections.unmodifiableList(landmarkAnnotations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.landmarkAnnotations_ = landmarkAnnotations_; + } else { + result.landmarkAnnotations_ = landmarkAnnotationsBuilder_.build(); + } + if (logoAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + logoAnnotations_ = java.util.Collections.unmodifiableList(logoAnnotations_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.logoAnnotations_ = logoAnnotations_; + } else { + result.logoAnnotations_ = logoAnnotationsBuilder_.build(); + } + if (labelAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + labelAnnotations_ = java.util.Collections.unmodifiableList(labelAnnotations_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.labelAnnotations_ = labelAnnotations_; + } else { + result.labelAnnotations_ = labelAnnotationsBuilder_.build(); + } + if (localizedObjectAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + localizedObjectAnnotations_ = java.util.Collections.unmodifiableList(localizedObjectAnnotations_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.localizedObjectAnnotations_ = localizedObjectAnnotations_; + } else { + result.localizedObjectAnnotations_ = localizedObjectAnnotationsBuilder_.build(); + } + if (textAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { + textAnnotations_ = java.util.Collections.unmodifiableList(textAnnotations_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.textAnnotations_ = textAnnotations_; + } else { + result.textAnnotations_ = textAnnotationsBuilder_.build(); + } + if (fullTextAnnotationBuilder_ == null) { + result.fullTextAnnotation_ = fullTextAnnotation_; + } else { + result.fullTextAnnotation_ = fullTextAnnotationBuilder_.build(); + } + if (safeSearchAnnotationBuilder_ == null) { + result.safeSearchAnnotation_ = safeSearchAnnotation_; + } else { + result.safeSearchAnnotation_ = safeSearchAnnotationBuilder_.build(); + } + if (imagePropertiesAnnotationBuilder_ == null) { + result.imagePropertiesAnnotation_ = imagePropertiesAnnotation_; + } else { + result.imagePropertiesAnnotation_ = imagePropertiesAnnotationBuilder_.build(); + } + if (cropHintsAnnotationBuilder_ == null) { + result.cropHintsAnnotation_ = cropHintsAnnotation_; + } else { + result.cropHintsAnnotation_ = cropHintsAnnotationBuilder_.build(); + } + if (webDetectionBuilder_ == null) { + result.webDetection_ = webDetection_; + } else { + result.webDetection_ = webDetectionBuilder_.build(); + } + if (productSearchResultsBuilder_ == null) { + result.productSearchResults_ = productSearchResults_; + } else { + result.productSearchResults_ = productSearchResultsBuilder_.build(); + } + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + if (contextBuilder_ == null) { + result.context_ = context_; + } else { + result.context_ = contextBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.AnnotateImageResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.AnnotateImageResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.AnnotateImageResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.getDefaultInstance()) return this; + if (faceAnnotationsBuilder_ == null) { + if (!other.faceAnnotations_.isEmpty()) { + if (faceAnnotations_.isEmpty()) { + faceAnnotations_ = other.faceAnnotations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFaceAnnotationsIsMutable(); + faceAnnotations_.addAll(other.faceAnnotations_); + } + onChanged(); + } + } else { + if (!other.faceAnnotations_.isEmpty()) { + if (faceAnnotationsBuilder_.isEmpty()) { + faceAnnotationsBuilder_.dispose(); + faceAnnotationsBuilder_ = null; + faceAnnotations_ = other.faceAnnotations_; + bitField0_ = (bitField0_ & ~0x00000001); + faceAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFaceAnnotationsFieldBuilder() : null; + } else { + faceAnnotationsBuilder_.addAllMessages(other.faceAnnotations_); + } + } + } + if (landmarkAnnotationsBuilder_ == null) { + if (!other.landmarkAnnotations_.isEmpty()) { + if (landmarkAnnotations_.isEmpty()) { + landmarkAnnotations_ = other.landmarkAnnotations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLandmarkAnnotationsIsMutable(); + landmarkAnnotations_.addAll(other.landmarkAnnotations_); + } + onChanged(); + } + } else { + if (!other.landmarkAnnotations_.isEmpty()) { + if (landmarkAnnotationsBuilder_.isEmpty()) { + landmarkAnnotationsBuilder_.dispose(); + landmarkAnnotationsBuilder_ = null; + landmarkAnnotations_ = other.landmarkAnnotations_; + bitField0_ = (bitField0_ & ~0x00000002); + landmarkAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLandmarkAnnotationsFieldBuilder() : null; + } else { + landmarkAnnotationsBuilder_.addAllMessages(other.landmarkAnnotations_); + } + } + } + if (logoAnnotationsBuilder_ == null) { + if (!other.logoAnnotations_.isEmpty()) { + if (logoAnnotations_.isEmpty()) { + logoAnnotations_ = other.logoAnnotations_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureLogoAnnotationsIsMutable(); + logoAnnotations_.addAll(other.logoAnnotations_); + } + onChanged(); + } + } else { + if (!other.logoAnnotations_.isEmpty()) { + if (logoAnnotationsBuilder_.isEmpty()) { + logoAnnotationsBuilder_.dispose(); + logoAnnotationsBuilder_ = null; + logoAnnotations_ = other.logoAnnotations_; + bitField0_ = (bitField0_ & ~0x00000004); + logoAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLogoAnnotationsFieldBuilder() : null; + } else { + logoAnnotationsBuilder_.addAllMessages(other.logoAnnotations_); + } + } + } + if (labelAnnotationsBuilder_ == null) { + if (!other.labelAnnotations_.isEmpty()) { + if (labelAnnotations_.isEmpty()) { + labelAnnotations_ = other.labelAnnotations_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureLabelAnnotationsIsMutable(); + labelAnnotations_.addAll(other.labelAnnotations_); + } + onChanged(); + } + } else { + if (!other.labelAnnotations_.isEmpty()) { + if (labelAnnotationsBuilder_.isEmpty()) { + labelAnnotationsBuilder_.dispose(); + labelAnnotationsBuilder_ = null; + labelAnnotations_ = other.labelAnnotations_; + bitField0_ = (bitField0_ & ~0x00000008); + labelAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLabelAnnotationsFieldBuilder() : null; + } else { + labelAnnotationsBuilder_.addAllMessages(other.labelAnnotations_); + } + } + } + if (localizedObjectAnnotationsBuilder_ == null) { + if (!other.localizedObjectAnnotations_.isEmpty()) { + if (localizedObjectAnnotations_.isEmpty()) { + localizedObjectAnnotations_ = other.localizedObjectAnnotations_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureLocalizedObjectAnnotationsIsMutable(); + localizedObjectAnnotations_.addAll(other.localizedObjectAnnotations_); + } + onChanged(); + } + } else { + if (!other.localizedObjectAnnotations_.isEmpty()) { + if (localizedObjectAnnotationsBuilder_.isEmpty()) { + localizedObjectAnnotationsBuilder_.dispose(); + localizedObjectAnnotationsBuilder_ = null; + localizedObjectAnnotations_ = other.localizedObjectAnnotations_; + bitField0_ = (bitField0_ & ~0x00000010); + localizedObjectAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLocalizedObjectAnnotationsFieldBuilder() : null; + } else { + localizedObjectAnnotationsBuilder_.addAllMessages(other.localizedObjectAnnotations_); + } + } + } + if (textAnnotationsBuilder_ == null) { + if (!other.textAnnotations_.isEmpty()) { + if (textAnnotations_.isEmpty()) { + textAnnotations_ = other.textAnnotations_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTextAnnotationsIsMutable(); + textAnnotations_.addAll(other.textAnnotations_); + } + onChanged(); + } + } else { + if (!other.textAnnotations_.isEmpty()) { + if (textAnnotationsBuilder_.isEmpty()) { + textAnnotationsBuilder_.dispose(); + textAnnotationsBuilder_ = null; + textAnnotations_ = other.textAnnotations_; + bitField0_ = (bitField0_ & ~0x00000020); + textAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTextAnnotationsFieldBuilder() : null; + } else { + textAnnotationsBuilder_.addAllMessages(other.textAnnotations_); + } + } + } + if (other.hasFullTextAnnotation()) { + mergeFullTextAnnotation(other.getFullTextAnnotation()); + } + if (other.hasSafeSearchAnnotation()) { + mergeSafeSearchAnnotation(other.getSafeSearchAnnotation()); + } + if (other.hasImagePropertiesAnnotation()) { + mergeImagePropertiesAnnotation(other.getImagePropertiesAnnotation()); + } + if (other.hasCropHintsAnnotation()) { + mergeCropHintsAnnotation(other.getCropHintsAnnotation()); + } + if (other.hasWebDetection()) { + mergeWebDetection(other.getWebDetection()); + } + if (other.hasProductSearchResults()) { + mergeProductSearchResults(other.getProductSearchResults()); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.hasContext()) { + mergeContext(other.getContext()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.AnnotateImageResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List faceAnnotations_ = + java.util.Collections.emptyList(); + private void ensureFaceAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + faceAnnotations_ = new java.util.ArrayList(faceAnnotations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.FaceAnnotation, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder, com.google.cloud.vision.v1p3beta1.FaceAnnotationOrBuilder> faceAnnotationsBuilder_; + + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public java.util.List getFaceAnnotationsList() { + if (faceAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(faceAnnotations_); + } else { + return faceAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public int getFaceAnnotationsCount() { + if (faceAnnotationsBuilder_ == null) { + return faceAnnotations_.size(); + } else { + return faceAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation getFaceAnnotations(int index) { + if (faceAnnotationsBuilder_ == null) { + return faceAnnotations_.get(index); + } else { + return faceAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder setFaceAnnotations( + int index, com.google.cloud.vision.v1p3beta1.FaceAnnotation value) { + if (faceAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFaceAnnotationsIsMutable(); + faceAnnotations_.set(index, value); + onChanged(); + } else { + faceAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder setFaceAnnotations( + int index, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder builderForValue) { + if (faceAnnotationsBuilder_ == null) { + ensureFaceAnnotationsIsMutable(); + faceAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + faceAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addFaceAnnotations(com.google.cloud.vision.v1p3beta1.FaceAnnotation value) { + if (faceAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFaceAnnotationsIsMutable(); + faceAnnotations_.add(value); + onChanged(); + } else { + faceAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addFaceAnnotations( + int index, com.google.cloud.vision.v1p3beta1.FaceAnnotation value) { + if (faceAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFaceAnnotationsIsMutable(); + faceAnnotations_.add(index, value); + onChanged(); + } else { + faceAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addFaceAnnotations( + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder builderForValue) { + if (faceAnnotationsBuilder_ == null) { + ensureFaceAnnotationsIsMutable(); + faceAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + faceAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addFaceAnnotations( + int index, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder builderForValue) { + if (faceAnnotationsBuilder_ == null) { + ensureFaceAnnotationsIsMutable(); + faceAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + faceAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addAllFaceAnnotations( + java.lang.Iterable values) { + if (faceAnnotationsBuilder_ == null) { + ensureFaceAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, faceAnnotations_); + onChanged(); + } else { + faceAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder clearFaceAnnotations() { + if (faceAnnotationsBuilder_ == null) { + faceAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + faceAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public Builder removeFaceAnnotations(int index) { + if (faceAnnotationsBuilder_ == null) { + ensureFaceAnnotationsIsMutable(); + faceAnnotations_.remove(index); + onChanged(); + } else { + faceAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder getFaceAnnotationsBuilder( + int index) { + return getFaceAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotationOrBuilder getFaceAnnotationsOrBuilder( + int index) { + if (faceAnnotationsBuilder_ == null) { + return faceAnnotations_.get(index); } else { + return faceAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public java.util.List + getFaceAnnotationsOrBuilderList() { + if (faceAnnotationsBuilder_ != null) { + return faceAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(faceAnnotations_); + } + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder addFaceAnnotationsBuilder() { + return getFaceAnnotationsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.FaceAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder addFaceAnnotationsBuilder( + int index) { + return getFaceAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.FaceAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + public java.util.List + getFaceAnnotationsBuilderList() { + return getFaceAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.FaceAnnotation, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder, com.google.cloud.vision.v1p3beta1.FaceAnnotationOrBuilder> + getFaceAnnotationsFieldBuilder() { + if (faceAnnotationsBuilder_ == null) { + faceAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.FaceAnnotation, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder, com.google.cloud.vision.v1p3beta1.FaceAnnotationOrBuilder>( + faceAnnotations_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + faceAnnotations_ = null; + } + return faceAnnotationsBuilder_; + } + + private java.util.List landmarkAnnotations_ = + java.util.Collections.emptyList(); + private void ensureLandmarkAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + landmarkAnnotations_ = new java.util.ArrayList(landmarkAnnotations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder> landmarkAnnotationsBuilder_; + + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public java.util.List getLandmarkAnnotationsList() { + if (landmarkAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(landmarkAnnotations_); + } else { + return landmarkAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public int getLandmarkAnnotationsCount() { + if (landmarkAnnotationsBuilder_ == null) { + return landmarkAnnotations_.size(); + } else { + return landmarkAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getLandmarkAnnotations(int index) { + if (landmarkAnnotationsBuilder_ == null) { + return landmarkAnnotations_.get(index); + } else { + return landmarkAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder setLandmarkAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (landmarkAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLandmarkAnnotationsIsMutable(); + landmarkAnnotations_.set(index, value); + onChanged(); + } else { + landmarkAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder setLandmarkAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (landmarkAnnotationsBuilder_ == null) { + ensureLandmarkAnnotationsIsMutable(); + landmarkAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + landmarkAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder addLandmarkAnnotations(com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (landmarkAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLandmarkAnnotationsIsMutable(); + landmarkAnnotations_.add(value); + onChanged(); + } else { + landmarkAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder addLandmarkAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (landmarkAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLandmarkAnnotationsIsMutable(); + landmarkAnnotations_.add(index, value); + onChanged(); + } else { + landmarkAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder addLandmarkAnnotations( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (landmarkAnnotationsBuilder_ == null) { + ensureLandmarkAnnotationsIsMutable(); + landmarkAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + landmarkAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder addLandmarkAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (landmarkAnnotationsBuilder_ == null) { + ensureLandmarkAnnotationsIsMutable(); + landmarkAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + landmarkAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder addAllLandmarkAnnotations( + java.lang.Iterable values) { + if (landmarkAnnotationsBuilder_ == null) { + ensureLandmarkAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, landmarkAnnotations_); + onChanged(); + } else { + landmarkAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder clearLandmarkAnnotations() { + if (landmarkAnnotationsBuilder_ == null) { + landmarkAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + landmarkAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public Builder removeLandmarkAnnotations(int index) { + if (landmarkAnnotationsBuilder_ == null) { + ensureLandmarkAnnotationsIsMutable(); + landmarkAnnotations_.remove(index); + onChanged(); + } else { + landmarkAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder getLandmarkAnnotationsBuilder( + int index) { + return getLandmarkAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLandmarkAnnotationsOrBuilder( + int index) { + if (landmarkAnnotationsBuilder_ == null) { + return landmarkAnnotations_.get(index); } else { + return landmarkAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public java.util.List + getLandmarkAnnotationsOrBuilderList() { + if (landmarkAnnotationsBuilder_ != null) { + return landmarkAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(landmarkAnnotations_); + } + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder addLandmarkAnnotationsBuilder() { + return getLandmarkAnnotationsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder addLandmarkAnnotationsBuilder( + int index) { + return getLandmarkAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + public java.util.List + getLandmarkAnnotationsBuilderList() { + return getLandmarkAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder> + getLandmarkAnnotationsFieldBuilder() { + if (landmarkAnnotationsBuilder_ == null) { + landmarkAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder>( + landmarkAnnotations_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + landmarkAnnotations_ = null; + } + return landmarkAnnotationsBuilder_; + } + + private java.util.List logoAnnotations_ = + java.util.Collections.emptyList(); + private void ensureLogoAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + logoAnnotations_ = new java.util.ArrayList(logoAnnotations_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder> logoAnnotationsBuilder_; + + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public java.util.List getLogoAnnotationsList() { + if (logoAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(logoAnnotations_); + } else { + return logoAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public int getLogoAnnotationsCount() { + if (logoAnnotationsBuilder_ == null) { + return logoAnnotations_.size(); + } else { + return logoAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getLogoAnnotations(int index) { + if (logoAnnotationsBuilder_ == null) { + return logoAnnotations_.get(index); + } else { + return logoAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder setLogoAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (logoAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogoAnnotationsIsMutable(); + logoAnnotations_.set(index, value); + onChanged(); + } else { + logoAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder setLogoAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (logoAnnotationsBuilder_ == null) { + ensureLogoAnnotationsIsMutable(); + logoAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + logoAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addLogoAnnotations(com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (logoAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogoAnnotationsIsMutable(); + logoAnnotations_.add(value); + onChanged(); + } else { + logoAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addLogoAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (logoAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogoAnnotationsIsMutable(); + logoAnnotations_.add(index, value); + onChanged(); + } else { + logoAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addLogoAnnotations( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (logoAnnotationsBuilder_ == null) { + ensureLogoAnnotationsIsMutable(); + logoAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + logoAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addLogoAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (logoAnnotationsBuilder_ == null) { + ensureLogoAnnotationsIsMutable(); + logoAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + logoAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addAllLogoAnnotations( + java.lang.Iterable values) { + if (logoAnnotationsBuilder_ == null) { + ensureLogoAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, logoAnnotations_); + onChanged(); + } else { + logoAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder clearLogoAnnotations() { + if (logoAnnotationsBuilder_ == null) { + logoAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + logoAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder removeLogoAnnotations(int index) { + if (logoAnnotationsBuilder_ == null) { + ensureLogoAnnotationsIsMutable(); + logoAnnotations_.remove(index); + onChanged(); + } else { + logoAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder getLogoAnnotationsBuilder( + int index) { + return getLogoAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLogoAnnotationsOrBuilder( + int index) { + if (logoAnnotationsBuilder_ == null) { + return logoAnnotations_.get(index); } else { + return logoAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public java.util.List + getLogoAnnotationsOrBuilderList() { + if (logoAnnotationsBuilder_ != null) { + return logoAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(logoAnnotations_); + } + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder addLogoAnnotationsBuilder() { + return getLogoAnnotationsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder addLogoAnnotationsBuilder( + int index) { + return getLogoAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + public java.util.List + getLogoAnnotationsBuilderList() { + return getLogoAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder> + getLogoAnnotationsFieldBuilder() { + if (logoAnnotationsBuilder_ == null) { + logoAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder>( + logoAnnotations_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + logoAnnotations_ = null; + } + return logoAnnotationsBuilder_; + } + + private java.util.List labelAnnotations_ = + java.util.Collections.emptyList(); + private void ensureLabelAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + labelAnnotations_ = new java.util.ArrayList(labelAnnotations_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder> labelAnnotationsBuilder_; + + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public java.util.List getLabelAnnotationsList() { + if (labelAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(labelAnnotations_); + } else { + return labelAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public int getLabelAnnotationsCount() { + if (labelAnnotationsBuilder_ == null) { + return labelAnnotations_.size(); + } else { + return labelAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getLabelAnnotations(int index) { + if (labelAnnotationsBuilder_ == null) { + return labelAnnotations_.get(index); + } else { + return labelAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder setLabelAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (labelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelAnnotationsIsMutable(); + labelAnnotations_.set(index, value); + onChanged(); + } else { + labelAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder setLabelAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (labelAnnotationsBuilder_ == null) { + ensureLabelAnnotationsIsMutable(); + labelAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + labelAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addLabelAnnotations(com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (labelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelAnnotationsIsMutable(); + labelAnnotations_.add(value); + onChanged(); + } else { + labelAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addLabelAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (labelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelAnnotationsIsMutable(); + labelAnnotations_.add(index, value); + onChanged(); + } else { + labelAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addLabelAnnotations( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (labelAnnotationsBuilder_ == null) { + ensureLabelAnnotationsIsMutable(); + labelAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + labelAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addLabelAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (labelAnnotationsBuilder_ == null) { + ensureLabelAnnotationsIsMutable(); + labelAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + labelAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addAllLabelAnnotations( + java.lang.Iterable values) { + if (labelAnnotationsBuilder_ == null) { + ensureLabelAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, labelAnnotations_); + onChanged(); + } else { + labelAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder clearLabelAnnotations() { + if (labelAnnotationsBuilder_ == null) { + labelAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + labelAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public Builder removeLabelAnnotations(int index) { + if (labelAnnotationsBuilder_ == null) { + ensureLabelAnnotationsIsMutable(); + labelAnnotations_.remove(index); + onChanged(); + } else { + labelAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder getLabelAnnotationsBuilder( + int index) { + return getLabelAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLabelAnnotationsOrBuilder( + int index) { + if (labelAnnotationsBuilder_ == null) { + return labelAnnotations_.get(index); } else { + return labelAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public java.util.List + getLabelAnnotationsOrBuilderList() { + if (labelAnnotationsBuilder_ != null) { + return labelAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(labelAnnotations_); + } + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder addLabelAnnotationsBuilder() { + return getLabelAnnotationsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder addLabelAnnotationsBuilder( + int index) { + return getLabelAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + public java.util.List + getLabelAnnotationsBuilderList() { + return getLabelAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder> + getLabelAnnotationsFieldBuilder() { + if (labelAnnotationsBuilder_ == null) { + labelAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder>( + labelAnnotations_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + labelAnnotations_ = null; + } + return labelAnnotationsBuilder_; + } + + private java.util.List localizedObjectAnnotations_ = + java.util.Collections.emptyList(); + private void ensureLocalizedObjectAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + localizedObjectAnnotations_ = new java.util.ArrayList(localizedObjectAnnotations_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotationOrBuilder> localizedObjectAnnotationsBuilder_; + + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public java.util.List getLocalizedObjectAnnotationsList() { + if (localizedObjectAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(localizedObjectAnnotations_); + } else { + return localizedObjectAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public int getLocalizedObjectAnnotationsCount() { + if (localizedObjectAnnotationsBuilder_ == null) { + return localizedObjectAnnotations_.size(); + } else { + return localizedObjectAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation getLocalizedObjectAnnotations(int index) { + if (localizedObjectAnnotationsBuilder_ == null) { + return localizedObjectAnnotations_.get(index); + } else { + return localizedObjectAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder setLocalizedObjectAnnotations( + int index, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation value) { + if (localizedObjectAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalizedObjectAnnotationsIsMutable(); + localizedObjectAnnotations_.set(index, value); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder setLocalizedObjectAnnotations( + int index, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder builderForValue) { + if (localizedObjectAnnotationsBuilder_ == null) { + ensureLocalizedObjectAnnotationsIsMutable(); + localizedObjectAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder addLocalizedObjectAnnotations(com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation value) { + if (localizedObjectAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalizedObjectAnnotationsIsMutable(); + localizedObjectAnnotations_.add(value); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder addLocalizedObjectAnnotations( + int index, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation value) { + if (localizedObjectAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalizedObjectAnnotationsIsMutable(); + localizedObjectAnnotations_.add(index, value); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder addLocalizedObjectAnnotations( + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder builderForValue) { + if (localizedObjectAnnotationsBuilder_ == null) { + ensureLocalizedObjectAnnotationsIsMutable(); + localizedObjectAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder addLocalizedObjectAnnotations( + int index, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder builderForValue) { + if (localizedObjectAnnotationsBuilder_ == null) { + ensureLocalizedObjectAnnotationsIsMutable(); + localizedObjectAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder addAllLocalizedObjectAnnotations( + java.lang.Iterable values) { + if (localizedObjectAnnotationsBuilder_ == null) { + ensureLocalizedObjectAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, localizedObjectAnnotations_); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder clearLocalizedObjectAnnotations() { + if (localizedObjectAnnotationsBuilder_ == null) { + localizedObjectAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public Builder removeLocalizedObjectAnnotations(int index) { + if (localizedObjectAnnotationsBuilder_ == null) { + ensureLocalizedObjectAnnotationsIsMutable(); + localizedObjectAnnotations_.remove(index); + onChanged(); + } else { + localizedObjectAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder getLocalizedObjectAnnotationsBuilder( + int index) { + return getLocalizedObjectAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotationOrBuilder getLocalizedObjectAnnotationsOrBuilder( + int index) { + if (localizedObjectAnnotationsBuilder_ == null) { + return localizedObjectAnnotations_.get(index); } else { + return localizedObjectAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public java.util.List + getLocalizedObjectAnnotationsOrBuilderList() { + if (localizedObjectAnnotationsBuilder_ != null) { + return localizedObjectAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(localizedObjectAnnotations_); + } + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder addLocalizedObjectAnnotationsBuilder() { + return getLocalizedObjectAnnotationsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder addLocalizedObjectAnnotationsBuilder( + int index) { + return getLocalizedObjectAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + public java.util.List + getLocalizedObjectAnnotationsBuilderList() { + return getLocalizedObjectAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotationOrBuilder> + getLocalizedObjectAnnotationsFieldBuilder() { + if (localizedObjectAnnotationsBuilder_ == null) { + localizedObjectAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotationOrBuilder>( + localizedObjectAnnotations_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + localizedObjectAnnotations_ = null; + } + return localizedObjectAnnotationsBuilder_; + } + + private java.util.List textAnnotations_ = + java.util.Collections.emptyList(); + private void ensureTextAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + textAnnotations_ = new java.util.ArrayList(textAnnotations_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder> textAnnotationsBuilder_; + + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public java.util.List getTextAnnotationsList() { + if (textAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(textAnnotations_); + } else { + return textAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public int getTextAnnotationsCount() { + if (textAnnotationsBuilder_ == null) { + return textAnnotations_.size(); + } else { + return textAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getTextAnnotations(int index) { + if (textAnnotationsBuilder_ == null) { + return textAnnotations_.get(index); + } else { + return textAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder setTextAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (textAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextAnnotationsIsMutable(); + textAnnotations_.set(index, value); + onChanged(); + } else { + textAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder setTextAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + textAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + textAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addTextAnnotations(com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (textAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextAnnotationsIsMutable(); + textAnnotations_.add(value); + onChanged(); + } else { + textAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addTextAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation value) { + if (textAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextAnnotationsIsMutable(); + textAnnotations_.add(index, value); + onChanged(); + } else { + textAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addTextAnnotations( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + textAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + textAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addTextAnnotations( + int index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder builderForValue) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + textAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + textAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addAllTextAnnotations( + java.lang.Iterable values) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, textAnnotations_); + onChanged(); + } else { + textAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder clearTextAnnotations() { + if (textAnnotationsBuilder_ == null) { + textAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + textAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public Builder removeTextAnnotations(int index) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + textAnnotations_.remove(index); + onChanged(); + } else { + textAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder getTextAnnotationsBuilder( + int index) { + return getTextAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getTextAnnotationsOrBuilder( + int index) { + if (textAnnotationsBuilder_ == null) { + return textAnnotations_.get(index); } else { + return textAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public java.util.List + getTextAnnotationsOrBuilderList() { + if (textAnnotationsBuilder_ != null) { + return textAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(textAnnotations_); + } + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder addTextAnnotationsBuilder() { + return getTextAnnotationsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder addTextAnnotationsBuilder( + int index) { + return getTextAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()); + } + /** + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + public java.util.List + getTextAnnotationsBuilderList() { + return getTextAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder> + getTextAnnotationsFieldBuilder() { + if (textAnnotationsBuilder_ == null) { + textAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.EntityAnnotation, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder, com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder>( + textAnnotations_, + ((bitField0_ & 0x00000020) == 0x00000020), + getParentForChildren(), + isClean()); + textAnnotations_ = null; + } + return textAnnotationsBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.TextAnnotation fullTextAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation, com.google.cloud.vision.v1p3beta1.TextAnnotation.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotationOrBuilder> fullTextAnnotationBuilder_; + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public boolean hasFullTextAnnotation() { + return fullTextAnnotationBuilder_ != null || fullTextAnnotation_ != null; + } + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation getFullTextAnnotation() { + if (fullTextAnnotationBuilder_ == null) { + return fullTextAnnotation_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.getDefaultInstance() : fullTextAnnotation_; + } else { + return fullTextAnnotationBuilder_.getMessage(); + } + } + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public Builder setFullTextAnnotation(com.google.cloud.vision.v1p3beta1.TextAnnotation value) { + if (fullTextAnnotationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fullTextAnnotation_ = value; + onChanged(); + } else { + fullTextAnnotationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public Builder setFullTextAnnotation( + com.google.cloud.vision.v1p3beta1.TextAnnotation.Builder builderForValue) { + if (fullTextAnnotationBuilder_ == null) { + fullTextAnnotation_ = builderForValue.build(); + onChanged(); + } else { + fullTextAnnotationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public Builder mergeFullTextAnnotation(com.google.cloud.vision.v1p3beta1.TextAnnotation value) { + if (fullTextAnnotationBuilder_ == null) { + if (fullTextAnnotation_ != null) { + fullTextAnnotation_ = + com.google.cloud.vision.v1p3beta1.TextAnnotation.newBuilder(fullTextAnnotation_).mergeFrom(value).buildPartial(); + } else { + fullTextAnnotation_ = value; + } + onChanged(); + } else { + fullTextAnnotationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public Builder clearFullTextAnnotation() { + if (fullTextAnnotationBuilder_ == null) { + fullTextAnnotation_ = null; + onChanged(); + } else { + fullTextAnnotation_ = null; + fullTextAnnotationBuilder_ = null; + } + + return this; + } + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.Builder getFullTextAnnotationBuilder() { + + onChanged(); + return getFullTextAnnotationFieldBuilder().getBuilder(); + } + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotationOrBuilder getFullTextAnnotationOrBuilder() { + if (fullTextAnnotationBuilder_ != null) { + return fullTextAnnotationBuilder_.getMessageOrBuilder(); + } else { + return fullTextAnnotation_ == null ? + com.google.cloud.vision.v1p3beta1.TextAnnotation.getDefaultInstance() : fullTextAnnotation_; + } + } + /** + *
+     * If present, text (OCR) detection or document (OCR) text detection has
+     * completed successfully.
+     * This annotation provides the structural hierarchy for the OCR detected
+     * text.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation, com.google.cloud.vision.v1p3beta1.TextAnnotation.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotationOrBuilder> + getFullTextAnnotationFieldBuilder() { + if (fullTextAnnotationBuilder_ == null) { + fullTextAnnotationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation, com.google.cloud.vision.v1p3beta1.TextAnnotation.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotationOrBuilder>( + getFullTextAnnotation(), + getParentForChildren(), + isClean()); + fullTextAnnotation_ = null; + } + return fullTextAnnotationBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation safeSearchAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation, com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.Builder, com.google.cloud.vision.v1p3beta1.SafeSearchAnnotationOrBuilder> safeSearchAnnotationBuilder_; + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public boolean hasSafeSearchAnnotation() { + return safeSearchAnnotationBuilder_ != null || safeSearchAnnotation_ != null; + } + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation getSafeSearchAnnotation() { + if (safeSearchAnnotationBuilder_ == null) { + return safeSearchAnnotation_ == null ? com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.getDefaultInstance() : safeSearchAnnotation_; + } else { + return safeSearchAnnotationBuilder_.getMessage(); + } + } + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public Builder setSafeSearchAnnotation(com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation value) { + if (safeSearchAnnotationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + safeSearchAnnotation_ = value; + onChanged(); + } else { + safeSearchAnnotationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public Builder setSafeSearchAnnotation( + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.Builder builderForValue) { + if (safeSearchAnnotationBuilder_ == null) { + safeSearchAnnotation_ = builderForValue.build(); + onChanged(); + } else { + safeSearchAnnotationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public Builder mergeSafeSearchAnnotation(com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation value) { + if (safeSearchAnnotationBuilder_ == null) { + if (safeSearchAnnotation_ != null) { + safeSearchAnnotation_ = + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.newBuilder(safeSearchAnnotation_).mergeFrom(value).buildPartial(); + } else { + safeSearchAnnotation_ = value; + } + onChanged(); + } else { + safeSearchAnnotationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public Builder clearSafeSearchAnnotation() { + if (safeSearchAnnotationBuilder_ == null) { + safeSearchAnnotation_ = null; + onChanged(); + } else { + safeSearchAnnotation_ = null; + safeSearchAnnotationBuilder_ = null; + } + + return this; + } + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.Builder getSafeSearchAnnotationBuilder() { + + onChanged(); + return getSafeSearchAnnotationFieldBuilder().getBuilder(); + } + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotationOrBuilder getSafeSearchAnnotationOrBuilder() { + if (safeSearchAnnotationBuilder_ != null) { + return safeSearchAnnotationBuilder_.getMessageOrBuilder(); + } else { + return safeSearchAnnotation_ == null ? + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.getDefaultInstance() : safeSearchAnnotation_; + } + } + /** + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation, com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.Builder, com.google.cloud.vision.v1p3beta1.SafeSearchAnnotationOrBuilder> + getSafeSearchAnnotationFieldBuilder() { + if (safeSearchAnnotationBuilder_ == null) { + safeSearchAnnotationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation, com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.Builder, com.google.cloud.vision.v1p3beta1.SafeSearchAnnotationOrBuilder>( + getSafeSearchAnnotation(), + getParentForChildren(), + isClean()); + safeSearchAnnotation_ = null; + } + return safeSearchAnnotationBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.ImageProperties imagePropertiesAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageProperties, com.google.cloud.vision.v1p3beta1.ImageProperties.Builder, com.google.cloud.vision.v1p3beta1.ImagePropertiesOrBuilder> imagePropertiesAnnotationBuilder_; + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public boolean hasImagePropertiesAnnotation() { + return imagePropertiesAnnotationBuilder_ != null || imagePropertiesAnnotation_ != null; + } + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p3beta1.ImageProperties getImagePropertiesAnnotation() { + if (imagePropertiesAnnotationBuilder_ == null) { + return imagePropertiesAnnotation_ == null ? com.google.cloud.vision.v1p3beta1.ImageProperties.getDefaultInstance() : imagePropertiesAnnotation_; + } else { + return imagePropertiesAnnotationBuilder_.getMessage(); + } + } + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public Builder setImagePropertiesAnnotation(com.google.cloud.vision.v1p3beta1.ImageProperties value) { + if (imagePropertiesAnnotationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imagePropertiesAnnotation_ = value; + onChanged(); + } else { + imagePropertiesAnnotationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public Builder setImagePropertiesAnnotation( + com.google.cloud.vision.v1p3beta1.ImageProperties.Builder builderForValue) { + if (imagePropertiesAnnotationBuilder_ == null) { + imagePropertiesAnnotation_ = builderForValue.build(); + onChanged(); + } else { + imagePropertiesAnnotationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public Builder mergeImagePropertiesAnnotation(com.google.cloud.vision.v1p3beta1.ImageProperties value) { + if (imagePropertiesAnnotationBuilder_ == null) { + if (imagePropertiesAnnotation_ != null) { + imagePropertiesAnnotation_ = + com.google.cloud.vision.v1p3beta1.ImageProperties.newBuilder(imagePropertiesAnnotation_).mergeFrom(value).buildPartial(); + } else { + imagePropertiesAnnotation_ = value; + } + onChanged(); + } else { + imagePropertiesAnnotationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public Builder clearImagePropertiesAnnotation() { + if (imagePropertiesAnnotationBuilder_ == null) { + imagePropertiesAnnotation_ = null; + onChanged(); + } else { + imagePropertiesAnnotation_ = null; + imagePropertiesAnnotationBuilder_ = null; + } + + return this; + } + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p3beta1.ImageProperties.Builder getImagePropertiesAnnotationBuilder() { + + onChanged(); + return getImagePropertiesAnnotationFieldBuilder().getBuilder(); + } + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p3beta1.ImagePropertiesOrBuilder getImagePropertiesAnnotationOrBuilder() { + if (imagePropertiesAnnotationBuilder_ != null) { + return imagePropertiesAnnotationBuilder_.getMessageOrBuilder(); + } else { + return imagePropertiesAnnotation_ == null ? + com.google.cloud.vision.v1p3beta1.ImageProperties.getDefaultInstance() : imagePropertiesAnnotation_; + } + } + /** + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageProperties, com.google.cloud.vision.v1p3beta1.ImageProperties.Builder, com.google.cloud.vision.v1p3beta1.ImagePropertiesOrBuilder> + getImagePropertiesAnnotationFieldBuilder() { + if (imagePropertiesAnnotationBuilder_ == null) { + imagePropertiesAnnotationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageProperties, com.google.cloud.vision.v1p3beta1.ImageProperties.Builder, com.google.cloud.vision.v1p3beta1.ImagePropertiesOrBuilder>( + getImagePropertiesAnnotation(), + getParentForChildren(), + isClean()); + imagePropertiesAnnotation_ = null; + } + return imagePropertiesAnnotationBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.CropHintsAnnotation cropHintsAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation, com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.Builder, com.google.cloud.vision.v1p3beta1.CropHintsAnnotationOrBuilder> cropHintsAnnotationBuilder_; + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public boolean hasCropHintsAnnotation() { + return cropHintsAnnotationBuilder_ != null || cropHintsAnnotation_ != null; + } + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotation getCropHintsAnnotation() { + if (cropHintsAnnotationBuilder_ == null) { + return cropHintsAnnotation_ == null ? com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.getDefaultInstance() : cropHintsAnnotation_; + } else { + return cropHintsAnnotationBuilder_.getMessage(); + } + } + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public Builder setCropHintsAnnotation(com.google.cloud.vision.v1p3beta1.CropHintsAnnotation value) { + if (cropHintsAnnotationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cropHintsAnnotation_ = value; + onChanged(); + } else { + cropHintsAnnotationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public Builder setCropHintsAnnotation( + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.Builder builderForValue) { + if (cropHintsAnnotationBuilder_ == null) { + cropHintsAnnotation_ = builderForValue.build(); + onChanged(); + } else { + cropHintsAnnotationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public Builder mergeCropHintsAnnotation(com.google.cloud.vision.v1p3beta1.CropHintsAnnotation value) { + if (cropHintsAnnotationBuilder_ == null) { + if (cropHintsAnnotation_ != null) { + cropHintsAnnotation_ = + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.newBuilder(cropHintsAnnotation_).mergeFrom(value).buildPartial(); + } else { + cropHintsAnnotation_ = value; + } + onChanged(); + } else { + cropHintsAnnotationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public Builder clearCropHintsAnnotation() { + if (cropHintsAnnotationBuilder_ == null) { + cropHintsAnnotation_ = null; + onChanged(); + } else { + cropHintsAnnotation_ = null; + cropHintsAnnotationBuilder_ = null; + } + + return this; + } + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.Builder getCropHintsAnnotationBuilder() { + + onChanged(); + return getCropHintsAnnotationFieldBuilder().getBuilder(); + } + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotationOrBuilder getCropHintsAnnotationOrBuilder() { + if (cropHintsAnnotationBuilder_ != null) { + return cropHintsAnnotationBuilder_.getMessageOrBuilder(); + } else { + return cropHintsAnnotation_ == null ? + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.getDefaultInstance() : cropHintsAnnotation_; + } + } + /** + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation, com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.Builder, com.google.cloud.vision.v1p3beta1.CropHintsAnnotationOrBuilder> + getCropHintsAnnotationFieldBuilder() { + if (cropHintsAnnotationBuilder_ == null) { + cropHintsAnnotationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation, com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.Builder, com.google.cloud.vision.v1p3beta1.CropHintsAnnotationOrBuilder>( + getCropHintsAnnotation(), + getParentForChildren(), + isClean()); + cropHintsAnnotation_ = null; + } + return cropHintsAnnotationBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.WebDetection webDetection_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection, com.google.cloud.vision.v1p3beta1.WebDetection.Builder, com.google.cloud.vision.v1p3beta1.WebDetectionOrBuilder> webDetectionBuilder_; + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public boolean hasWebDetection() { + return webDetectionBuilder_ != null || webDetection_ != null; + } + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection getWebDetection() { + if (webDetectionBuilder_ == null) { + return webDetection_ == null ? com.google.cloud.vision.v1p3beta1.WebDetection.getDefaultInstance() : webDetection_; + } else { + return webDetectionBuilder_.getMessage(); + } + } + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public Builder setWebDetection(com.google.cloud.vision.v1p3beta1.WebDetection value) { + if (webDetectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + webDetection_ = value; + onChanged(); + } else { + webDetectionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public Builder setWebDetection( + com.google.cloud.vision.v1p3beta1.WebDetection.Builder builderForValue) { + if (webDetectionBuilder_ == null) { + webDetection_ = builderForValue.build(); + onChanged(); + } else { + webDetectionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public Builder mergeWebDetection(com.google.cloud.vision.v1p3beta1.WebDetection value) { + if (webDetectionBuilder_ == null) { + if (webDetection_ != null) { + webDetection_ = + com.google.cloud.vision.v1p3beta1.WebDetection.newBuilder(webDetection_).mergeFrom(value).buildPartial(); + } else { + webDetection_ = value; + } + onChanged(); + } else { + webDetectionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public Builder clearWebDetection() { + if (webDetectionBuilder_ == null) { + webDetection_ = null; + onChanged(); + } else { + webDetection_ = null; + webDetectionBuilder_ = null; + } + + return this; + } + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.Builder getWebDetectionBuilder() { + + onChanged(); + return getWebDetectionFieldBuilder().getBuilder(); + } + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p3beta1.WebDetectionOrBuilder getWebDetectionOrBuilder() { + if (webDetectionBuilder_ != null) { + return webDetectionBuilder_.getMessageOrBuilder(); + } else { + return webDetection_ == null ? + com.google.cloud.vision.v1p3beta1.WebDetection.getDefaultInstance() : webDetection_; + } + } + /** + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection, com.google.cloud.vision.v1p3beta1.WebDetection.Builder, com.google.cloud.vision.v1p3beta1.WebDetectionOrBuilder> + getWebDetectionFieldBuilder() { + if (webDetectionBuilder_ == null) { + webDetectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection, com.google.cloud.vision.v1p3beta1.WebDetection.Builder, com.google.cloud.vision.v1p3beta1.WebDetectionOrBuilder>( + getWebDetection(), + getParentForChildren(), + isClean()); + webDetection_ = null; + } + return webDetectionBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.ProductSearchResults productSearchResults_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResultsOrBuilder> productSearchResultsBuilder_; + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public boolean hasProductSearchResults() { + return productSearchResultsBuilder_ != null || productSearchResults_ != null; + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults getProductSearchResults() { + if (productSearchResultsBuilder_ == null) { + return productSearchResults_ == null ? com.google.cloud.vision.v1p3beta1.ProductSearchResults.getDefaultInstance() : productSearchResults_; + } else { + return productSearchResultsBuilder_.getMessage(); + } + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public Builder setProductSearchResults(com.google.cloud.vision.v1p3beta1.ProductSearchResults value) { + if (productSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productSearchResults_ = value; + onChanged(); + } else { + productSearchResultsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public Builder setProductSearchResults( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Builder builderForValue) { + if (productSearchResultsBuilder_ == null) { + productSearchResults_ = builderForValue.build(); + onChanged(); + } else { + productSearchResultsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public Builder mergeProductSearchResults(com.google.cloud.vision.v1p3beta1.ProductSearchResults value) { + if (productSearchResultsBuilder_ == null) { + if (productSearchResults_ != null) { + productSearchResults_ = + com.google.cloud.vision.v1p3beta1.ProductSearchResults.newBuilder(productSearchResults_).mergeFrom(value).buildPartial(); + } else { + productSearchResults_ = value; + } + onChanged(); + } else { + productSearchResultsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public Builder clearProductSearchResults() { + if (productSearchResultsBuilder_ == null) { + productSearchResults_ = null; + onChanged(); + } else { + productSearchResults_ = null; + productSearchResultsBuilder_ = null; + } + + return this; + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Builder getProductSearchResultsBuilder() { + + onChanged(); + return getProductSearchResultsFieldBuilder().getBuilder(); + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResultsOrBuilder getProductSearchResultsOrBuilder() { + if (productSearchResultsBuilder_ != null) { + return productSearchResultsBuilder_.getMessageOrBuilder(); + } else { + return productSearchResults_ == null ? + com.google.cloud.vision.v1p3beta1.ProductSearchResults.getDefaultInstance() : productSearchResults_; + } + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResultsOrBuilder> + getProductSearchResultsFieldBuilder() { + if (productSearchResultsBuilder_ == null) { + productSearchResultsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResultsOrBuilder>( + getProductSearchResults(), + getParentForChildren(), + isClean()); + productSearchResults_ = null; + } + return productSearchResultsBuilder_; + } + + private com.google.rpc.Status error_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public Builder setError( + com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? + com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + *
+     * If set, represents the error message for the operation.
+     * Note that filled-in image annotations are guaranteed to be
+     * correct, even when `error` is set.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getError(), + getParentForChildren(), + isClean()); + error_ = null; + } + return errorBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.ImageAnnotationContext context_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext, com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.Builder, com.google.cloud.vision.v1p3beta1.ImageAnnotationContextOrBuilder> contextBuilder_; + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public boolean hasContext() { + return contextBuilder_ != null || context_ != null; + } + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContext getContext() { + if (contextBuilder_ == null) { + return context_ == null ? com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.getDefaultInstance() : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public Builder setContext(com.google.cloud.vision.v1p3beta1.ImageAnnotationContext value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + contextBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public Builder setContext( + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public Builder mergeContext(com.google.cloud.vision.v1p3beta1.ImageAnnotationContext value) { + if (contextBuilder_ == null) { + if (context_ != null) { + context_ = + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.newBuilder(context_).mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + contextBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public Builder clearContext() { + if (contextBuilder_ == null) { + context_ = null; + onChanged(); + } else { + context_ = null; + contextBuilder_ = null; + } + + return this; + } + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.Builder getContextBuilder() { + + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContextOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null ? + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.getDefaultInstance() : context_; + } + } + /** + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext, com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.Builder, com.google.cloud.vision.v1p3beta1.ImageAnnotationContextOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext, com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.Builder, com.google.cloud.vision.v1p3beta1.ImageAnnotationContextOrBuilder>( + getContext(), + getParentForChildren(), + isClean()); + context_ = null; + } + return contextBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.AnnotateImageResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AnnotateImageResponse) + private static final com.google.cloud.vision.v1p3beta1.AnnotateImageResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.AnnotateImageResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AnnotateImageResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateImageResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageResponseOrBuilder.java new file mode 100644 index 000000000000..016b9c36db12 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AnnotateImageResponseOrBuilder.java @@ -0,0 +1,496 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface AnnotateImageResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.AnnotateImageResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + java.util.List + getFaceAnnotationsList(); + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + com.google.cloud.vision.v1p3beta1.FaceAnnotation getFaceAnnotations(int index); + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + int getFaceAnnotationsCount(); + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + java.util.List + getFaceAnnotationsOrBuilderList(); + /** + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation face_annotations = 1; + */ + com.google.cloud.vision.v1p3beta1.FaceAnnotationOrBuilder getFaceAnnotationsOrBuilder( + int index); + + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + java.util.List + getLandmarkAnnotationsList(); + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + com.google.cloud.vision.v1p3beta1.EntityAnnotation getLandmarkAnnotations(int index); + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + int getLandmarkAnnotationsCount(); + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + java.util.List + getLandmarkAnnotationsOrBuilderList(); + /** + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation landmark_annotations = 2; + */ + com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLandmarkAnnotationsOrBuilder( + int index); + + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + java.util.List + getLogoAnnotationsList(); + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + com.google.cloud.vision.v1p3beta1.EntityAnnotation getLogoAnnotations(int index); + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + int getLogoAnnotationsCount(); + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + java.util.List + getLogoAnnotationsOrBuilderList(); + /** + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation logo_annotations = 3; + */ + com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLogoAnnotationsOrBuilder( + int index); + + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + java.util.List + getLabelAnnotationsList(); + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + com.google.cloud.vision.v1p3beta1.EntityAnnotation getLabelAnnotations(int index); + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + int getLabelAnnotationsCount(); + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + java.util.List + getLabelAnnotationsOrBuilderList(); + /** + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation label_annotations = 4; + */ + com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getLabelAnnotationsOrBuilder( + int index); + + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + java.util.List + getLocalizedObjectAnnotationsList(); + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation getLocalizedObjectAnnotations(int index); + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + int getLocalizedObjectAnnotationsCount(); + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + java.util.List + getLocalizedObjectAnnotationsOrBuilderList(); + /** + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + */ + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotationOrBuilder getLocalizedObjectAnnotationsOrBuilder( + int index); + + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + java.util.List + getTextAnnotationsList(); + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + com.google.cloud.vision.v1p3beta1.EntityAnnotation getTextAnnotations(int index); + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + int getTextAnnotationsCount(); + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + java.util.List + getTextAnnotationsOrBuilderList(); + /** + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.EntityAnnotation text_annotations = 5; + */ + com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder getTextAnnotationsOrBuilder( + int index); + + /** + *
+   * If present, text (OCR) detection or document (OCR) text detection has
+   * completed successfully.
+   * This annotation provides the structural hierarchy for the OCR detected
+   * text.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + boolean hasFullTextAnnotation(); + /** + *
+   * If present, text (OCR) detection or document (OCR) text detection has
+   * completed successfully.
+   * This annotation provides the structural hierarchy for the OCR detected
+   * text.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation getFullTextAnnotation(); + /** + *
+   * If present, text (OCR) detection or document (OCR) text detection has
+   * completed successfully.
+   * This annotation provides the structural hierarchy for the OCR detected
+   * text.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation full_text_annotation = 12; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotationOrBuilder getFullTextAnnotationOrBuilder(); + + /** + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + boolean hasSafeSearchAnnotation(); + /** + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation getSafeSearchAnnotation(); + /** + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotationOrBuilder getSafeSearchAnnotationOrBuilder(); + + /** + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + boolean hasImagePropertiesAnnotation(); + /** + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + com.google.cloud.vision.v1p3beta1.ImageProperties getImagePropertiesAnnotation(); + /** + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageProperties image_properties_annotation = 8; + */ + com.google.cloud.vision.v1p3beta1.ImagePropertiesOrBuilder getImagePropertiesAnnotationOrBuilder(); + + /** + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + boolean hasCropHintsAnnotation(); + /** + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation getCropHintsAnnotation(); + /** + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + com.google.cloud.vision.v1p3beta1.CropHintsAnnotationOrBuilder getCropHintsAnnotationOrBuilder(); + + /** + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + boolean hasWebDetection(); + /** + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + com.google.cloud.vision.v1p3beta1.WebDetection getWebDetection(); + /** + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetection web_detection = 13; + */ + com.google.cloud.vision.v1p3beta1.WebDetectionOrBuilder getWebDetectionOrBuilder(); + + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + boolean hasProductSearchResults(); + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchResults getProductSearchResults(); + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchResultsOrBuilder getProductSearchResultsOrBuilder(); + + /** + *
+   * If set, represents the error message for the operation.
+   * Note that filled-in image annotations are guaranteed to be
+   * correct, even when `error` is set.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + boolean hasError(); + /** + *
+   * If set, represents the error message for the operation.
+   * Note that filled-in image annotations are guaranteed to be
+   * correct, even when `error` is set.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + com.google.rpc.Status getError(); + /** + *
+   * If set, represents the error message for the operation.
+   * Note that filled-in image annotations are guaranteed to be
+   * correct, even when `error` is set.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + boolean hasContext(); + /** + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext getContext(); + /** + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageAnnotationContext context = 21; + */ + com.google.cloud.vision.v1p3beta1.ImageAnnotationContextOrBuilder getContextOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileRequest.java new file mode 100644 index 000000000000..eb1389dcbf75 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileRequest.java @@ -0,0 +1,1524 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * An offline file annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest} + */ +public final class AsyncAnnotateFileRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) + AsyncAnnotateFileRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use AsyncAnnotateFileRequest.newBuilder() to construct. + private AsyncAnnotateFileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AsyncAnnotateFileRequest() { + features_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AsyncAnnotateFileRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = input.readMessage(com.google.cloud.vision.v1p3beta1.InputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + features_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + features_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Feature.parser(), extensionRegistry)); + break; + } + case 26: { + com.google.cloud.vision.v1p3beta1.ImageContext.Builder subBuilder = null; + if (imageContext_ != null) { + subBuilder = imageContext_.toBuilder(); + } + imageContext_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ImageContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(imageContext_); + imageContext_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.cloud.vision.v1p3beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.vision.v1p3beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + features_ = java.util.Collections.unmodifiableList(features_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.class, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder.class); + } + + private int bitField0_; + public static final int INPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.InputConfig inputConfig_; + /** + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfig getInputConfig() { + return inputConfig_ == null ? com.google.cloud.vision.v1p3beta1.InputConfig.getDefaultInstance() : inputConfig_; + } + /** + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int FEATURES_FIELD_NUMBER = 2; + private java.util.List features_; + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + return features_; + } + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List + getFeaturesOrBuilderList() { + return features_; + } + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public int getFeaturesCount() { + return features_.size(); + } + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature getFeatures(int index) { + return features_.get(index); + } + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.FeatureOrBuilder getFeaturesOrBuilder( + int index) { + return features_.get(index); + } + + public static final int IMAGE_CONTEXT_FIELD_NUMBER = 3; + private com.google.cloud.vision.v1p3beta1.ImageContext imageContext_; + /** + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public boolean hasImageContext() { + return imageContext_ != null; + } + /** + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContext getImageContext() { + return imageContext_ == null ? com.google.cloud.vision.v1p3beta1.ImageContext.getDefaultInstance() : imageContext_; + } + /** + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder getImageContextOrBuilder() { + return getImageContext(); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.vision.v1p3beta1.OutputConfig outputConfig_; + /** + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null ? com.google.cloud.vision.v1p3beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } + /** + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (inputConfig_ != null) { + output.writeMessage(1, getInputConfig()); + } + for (int i = 0; i < features_.size(); i++) { + output.writeMessage(2, features_.get(i)); + } + if (imageContext_ != null) { + output.writeMessage(3, getImageContext()); + } + if (outputConfig_ != null) { + output.writeMessage(4, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getInputConfig()); + } + for (int i = 0; i < features_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, features_.get(i)); + } + if (imageContext_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getImageContext()); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, 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.vision.v1p3beta1.AsyncAnnotateFileRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest other = (com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) obj; + + boolean result = true; + result = result && (hasInputConfig() == other.hasInputConfig()); + if (hasInputConfig()) { + result = result && getInputConfig() + .equals(other.getInputConfig()); + } + result = result && getFeaturesList() + .equals(other.getFeaturesList()); + result = result && (hasImageContext() == other.hasImageContext()); + if (hasImageContext()) { + result = result && getImageContext() + .equals(other.getImageContext()); + } + result = result && (hasOutputConfig() == other.hasOutputConfig()); + if (hasOutputConfig()) { + result = result && getOutputConfig() + .equals(other.getOutputConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (getFeaturesCount() > 0) { + hash = (37 * hash) + FEATURES_FIELD_NUMBER; + hash = (53 * hash) + getFeaturesList().hashCode(); + } + if (hasImageContext()) { + hash = (37 * hash) + IMAGE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getImageContext().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.vision.v1p3beta1.AsyncAnnotateFileRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest 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.vision.v1p3beta1.AsyncAnnotateFileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest 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.vision.v1p3beta1.AsyncAnnotateFileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest 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.vision.v1p3beta1.AsyncAnnotateFileRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest 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.vision.v1p3beta1.AsyncAnnotateFileRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * An offline file annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.class, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFeaturesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (featuresBuilder_ == null) { + features_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + featuresBuilder_.clear(); + } + if (imageContextBuilder_ == null) { + imageContext_ = null; + } else { + imageContext_ = null; + imageContextBuilder_ = null; + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest build() { + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest result = new com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (featuresBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + features_ = java.util.Collections.unmodifiableList(features_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.features_ = features_; + } else { + result.features_ = featuresBuilder_.build(); + } + if (imageContextBuilder_ == null) { + result.imageContext_ = imageContext_; + } else { + result.imageContext_ = imageContextBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.getDefaultInstance()) return this; + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (featuresBuilder_ == null) { + if (!other.features_.isEmpty()) { + if (features_.isEmpty()) { + features_ = other.features_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFeaturesIsMutable(); + features_.addAll(other.features_); + } + onChanged(); + } + } else { + if (!other.features_.isEmpty()) { + if (featuresBuilder_.isEmpty()) { + featuresBuilder_.dispose(); + featuresBuilder_ = null; + features_ = other.features_; + bitField0_ = (bitField0_ & ~0x00000002); + featuresBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFeaturesFieldBuilder() : null; + } else { + featuresBuilder_.addAllMessages(other.features_); + } + } + } + if (other.hasImageContext()) { + mergeImageContext(other.getImageContext()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.InputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.InputConfig, com.google.cloud.vision.v1p3beta1.InputConfig.Builder, com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder> inputConfigBuilder_; + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null ? com.google.cloud.vision.v1p3beta1.InputConfig.getDefaultInstance() : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig(com.google.cloud.vision.v1p3beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1p3beta1.InputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public Builder mergeInputConfig(com.google.cloud.vision.v1p3beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.vision.v1p3beta1.InputConfig.newBuilder(inputConfig_).mergeFrom(value).buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null ? + com.google.cloud.vision.v1p3beta1.InputConfig.getDefaultInstance() : inputConfig_; + } + } + /** + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.InputConfig, com.google.cloud.vision.v1p3beta1.InputConfig.Builder, com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.InputConfig, com.google.cloud.vision.v1p3beta1.InputConfig.Builder, com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder>( + getInputConfig(), + getParentForChildren(), + isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private java.util.List features_ = + java.util.Collections.emptyList(); + private void ensureFeaturesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + features_ = new java.util.ArrayList(features_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Feature, com.google.cloud.vision.v1p3beta1.Feature.Builder, com.google.cloud.vision.v1p3beta1.FeatureOrBuilder> featuresBuilder_; + + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + if (featuresBuilder_ == null) { + return java.util.Collections.unmodifiableList(features_); + } else { + return featuresBuilder_.getMessageList(); + } + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public int getFeaturesCount() { + if (featuresBuilder_ == null) { + return features_.size(); + } else { + return featuresBuilder_.getCount(); + } + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature getFeatures(int index) { + if (featuresBuilder_ == null) { + return features_.get(index); + } else { + return featuresBuilder_.getMessage(index); + } + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder setFeatures( + int index, com.google.cloud.vision.v1p3beta1.Feature value) { + if (featuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeaturesIsMutable(); + features_.set(index, value); + onChanged(); + } else { + featuresBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder setFeatures( + int index, com.google.cloud.vision.v1p3beta1.Feature.Builder builderForValue) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + features_.set(index, builderForValue.build()); + onChanged(); + } else { + featuresBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.vision.v1p3beta1.Feature value) { + if (featuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeaturesIsMutable(); + features_.add(value); + onChanged(); + } else { + featuresBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addFeatures( + int index, com.google.cloud.vision.v1p3beta1.Feature value) { + if (featuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeaturesIsMutable(); + features_.add(index, value); + onChanged(); + } else { + featuresBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addFeatures( + com.google.cloud.vision.v1p3beta1.Feature.Builder builderForValue) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + features_.add(builderForValue.build()); + onChanged(); + } else { + featuresBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addFeatures( + int index, com.google.cloud.vision.v1p3beta1.Feature.Builder builderForValue) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + features_.add(index, builderForValue.build()); + onChanged(); + } else { + featuresBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder addAllFeatures( + java.lang.Iterable values) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, features_); + onChanged(); + } else { + featuresBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder clearFeatures() { + if (featuresBuilder_ == null) { + features_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + featuresBuilder_.clear(); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public Builder removeFeatures(int index) { + if (featuresBuilder_ == null) { + ensureFeaturesIsMutable(); + features_.remove(index); + onChanged(); + } else { + featuresBuilder_.remove(index); + } + return this; + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature.Builder getFeaturesBuilder( + int index) { + return getFeaturesFieldBuilder().getBuilder(index); + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.FeatureOrBuilder getFeaturesOrBuilder( + int index) { + if (featuresBuilder_ == null) { + return features_.get(index); } else { + return featuresBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List + getFeaturesOrBuilderList() { + if (featuresBuilder_ != null) { + return featuresBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(features_); + } + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature.Builder addFeaturesBuilder() { + return getFeaturesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Feature.getDefaultInstance()); + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p3beta1.Feature.Builder addFeaturesBuilder( + int index) { + return getFeaturesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Feature.getDefaultInstance()); + } + /** + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + public java.util.List + getFeaturesBuilderList() { + return getFeaturesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Feature, com.google.cloud.vision.v1p3beta1.Feature.Builder, com.google.cloud.vision.v1p3beta1.FeatureOrBuilder> + getFeaturesFieldBuilder() { + if (featuresBuilder_ == null) { + featuresBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Feature, com.google.cloud.vision.v1p3beta1.Feature.Builder, com.google.cloud.vision.v1p3beta1.FeatureOrBuilder>( + features_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + features_ = null; + } + return featuresBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.ImageContext imageContext_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageContext, com.google.cloud.vision.v1p3beta1.ImageContext.Builder, com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder> imageContextBuilder_; + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public boolean hasImageContext() { + return imageContextBuilder_ != null || imageContext_ != null; + } + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContext getImageContext() { + if (imageContextBuilder_ == null) { + return imageContext_ == null ? com.google.cloud.vision.v1p3beta1.ImageContext.getDefaultInstance() : imageContext_; + } else { + return imageContextBuilder_.getMessage(); + } + } + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public Builder setImageContext(com.google.cloud.vision.v1p3beta1.ImageContext value) { + if (imageContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imageContext_ = value; + onChanged(); + } else { + imageContextBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public Builder setImageContext( + com.google.cloud.vision.v1p3beta1.ImageContext.Builder builderForValue) { + if (imageContextBuilder_ == null) { + imageContext_ = builderForValue.build(); + onChanged(); + } else { + imageContextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public Builder mergeImageContext(com.google.cloud.vision.v1p3beta1.ImageContext value) { + if (imageContextBuilder_ == null) { + if (imageContext_ != null) { + imageContext_ = + com.google.cloud.vision.v1p3beta1.ImageContext.newBuilder(imageContext_).mergeFrom(value).buildPartial(); + } else { + imageContext_ = value; + } + onChanged(); + } else { + imageContextBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public Builder clearImageContext() { + if (imageContextBuilder_ == null) { + imageContext_ = null; + onChanged(); + } else { + imageContext_ = null; + imageContextBuilder_ = null; + } + + return this; + } + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContext.Builder getImageContextBuilder() { + + onChanged(); + return getImageContextFieldBuilder().getBuilder(); + } + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder getImageContextOrBuilder() { + if (imageContextBuilder_ != null) { + return imageContextBuilder_.getMessageOrBuilder(); + } else { + return imageContext_ == null ? + com.google.cloud.vision.v1p3beta1.ImageContext.getDefaultInstance() : imageContext_; + } + } + /** + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageContext, com.google.cloud.vision.v1p3beta1.ImageContext.Builder, com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder> + getImageContextFieldBuilder() { + if (imageContextBuilder_ == null) { + imageContextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageContext, com.google.cloud.vision.v1p3beta1.ImageContext.Builder, com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder>( + getImageContext(), + getParentForChildren(), + isClean()); + imageContext_ = null; + } + return imageContextBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.OutputConfig outputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.OutputConfig, com.google.cloud.vision.v1p3beta1.OutputConfig.Builder, com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder> outputConfigBuilder_; + /** + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null ? com.google.cloud.vision.v1p3beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public Builder setOutputConfig(com.google.cloud.vision.v1p3beta1.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 and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public Builder setOutputConfig( + com.google.cloud.vision.v1p3beta1.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public Builder mergeOutputConfig(com.google.cloud.vision.v1p3beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.vision.v1p3beta1.OutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null ? + com.google.cloud.vision.v1p3beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } + } + /** + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.OutputConfig, com.google.cloud.vision.v1p3beta1.OutputConfig.Builder, com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.OutputConfig, com.google.cloud.vision.v1p3beta1.OutputConfig.Builder, com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder>( + getOutputConfig(), + getParentForChildren(), + isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) + private static final com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AsyncAnnotateFileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsyncAnnotateFileRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileRequestOrBuilder.java new file mode 100644 index 000000000000..d80babb444df --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileRequestOrBuilder.java @@ -0,0 +1,128 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface AsyncAnnotateFileRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + boolean hasInputConfig(); + /** + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p3beta1.InputConfig getInputConfig(); + /** + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + java.util.List + getFeaturesList(); + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p3beta1.Feature getFeatures(int index); + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + int getFeaturesCount(); + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + java.util.List + getFeaturesOrBuilderList(); + /** + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p3beta1.FeatureOrBuilder getFeaturesOrBuilder( + int index); + + /** + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + boolean hasImageContext(); + /** + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p3beta1.ImageContext getImageContext(); + /** + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder getImageContextOrBuilder(); + + /** + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + boolean hasOutputConfig(); + /** + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + com.google.cloud.vision.v1p3beta1.OutputConfig getOutputConfig(); + /** + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 4; + */ + com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileResponse.java new file mode 100644 index 000000000000..c96ec4167f04 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileResponse.java @@ -0,0 +1,626 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * The response for a single offline file annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse} + */ +public final class AsyncAnnotateFileResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) + AsyncAnnotateFileResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use AsyncAnnotateFileResponse.newBuilder() to construct. + private AsyncAnnotateFileResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AsyncAnnotateFileResponse() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AsyncAnnotateFileResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.vision.v1p3beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.class, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder.class); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.OutputConfig outputConfig_; + /** + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null ? com.google.cloud.vision.v1p3beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } + /** + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (outputConfig_ != null) { + output.writeMessage(1, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, 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.vision.v1p3beta1.AsyncAnnotateFileResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse other = (com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) obj; + + boolean result = true; + result = result && (hasOutputConfig() == other.hasOutputConfig()); + if (hasOutputConfig()) { + result = result && getOutputConfig() + .equals(other.getOutputConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().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.vision.v1p3beta1.AsyncAnnotateFileResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse 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.vision.v1p3beta1.AsyncAnnotateFileResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse 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.vision.v1p3beta1.AsyncAnnotateFileResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse 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.vision.v1p3beta1.AsyncAnnotateFileResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse 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.vision.v1p3beta1.AsyncAnnotateFileResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The response for a single offline file annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.class, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse build() { + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse result = new com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse(this); + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.getDefaultInstance()) return this; + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.OutputConfig outputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.OutputConfig, com.google.cloud.vision.v1p3beta1.OutputConfig.Builder, com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder> outputConfigBuilder_; + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null ? com.google.cloud.vision.v1p3beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public Builder setOutputConfig(com.google.cloud.vision.v1p3beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public Builder setOutputConfig( + com.google.cloud.vision.v1p3beta1.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public Builder mergeOutputConfig(com.google.cloud.vision.v1p3beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.vision.v1p3beta1.OutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null ? + com.google.cloud.vision.v1p3beta1.OutputConfig.getDefaultInstance() : outputConfig_; + } + } + /** + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.OutputConfig, com.google.cloud.vision.v1p3beta1.OutputConfig.Builder, com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.OutputConfig, com.google.cloud.vision.v1p3beta1.OutputConfig.Builder, com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder>( + getOutputConfig(), + getParentForChildren(), + isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) + private static final com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AsyncAnnotateFileResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsyncAnnotateFileResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileResponseOrBuilder.java new file mode 100644 index 000000000000..f0dc579404d7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncAnnotateFileResponseOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface AsyncAnnotateFileResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + boolean hasOutputConfig(); + /** + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + com.google.cloud.vision.v1p3beta1.OutputConfig getOutputConfig(); + /** + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OutputConfig output_config = 1; + */ + com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesRequest.java new file mode 100644 index 000000000000..680d8f5e467a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesRequest.java @@ -0,0 +1,836 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Multiple async file annotation requests are batched into a single service
+ * call.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest} + */ +public final class AsyncBatchAnnotateFilesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) + AsyncBatchAnnotateFilesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use AsyncBatchAnnotateFilesRequest.newBuilder() to construct. + private AsyncBatchAnnotateFilesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AsyncBatchAnnotateFilesRequest() { + requests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AsyncBatchAnnotateFilesRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + requests_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.parser(), extensionRegistry)); + 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) == 0x00000001)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.class, com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.Builder.class); + } + + public static final int REQUESTS_FIELD_NUMBER = 1; + private java.util.List requests_; + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List getRequestsList() { + return requests_; + } + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public int getRequestsCount() { + return requests_.size(); + } + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest getRequests(int index) { + return requests_.get(index); + } + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(1, requests_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < requests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, requests_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest other = (com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) obj; + + boolean result = true; + result = result && getRequestsList() + .equals(other.getRequestsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest 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.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest 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.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest 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.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest 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.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Multiple async file annotation requests are batched into a single service
+   * call.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.class, com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getRequestsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + requestsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest build() { + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest result = new com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest(this); + int from_bitField0_ = bitField0_; + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.getDefaultInstance()) return this; + if (requestsBuilder_ == null) { + if (!other.requests_.isEmpty()) { + if (requests_.isEmpty()) { + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRequestsIsMutable(); + requests_.addAll(other.requests_); + } + onChanged(); + } + } else { + if (!other.requests_.isEmpty()) { + if (requestsBuilder_.isEmpty()) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000001); + requestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRequestsFieldBuilder() : null; + } else { + requestsBuilder_.addAllMessages(other.requests_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List requests_ = + java.util.Collections.emptyList(); + private void ensureRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = new java.util.ArrayList(requests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestOrBuilder> requestsBuilder_; + + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addRequests(com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addRequests( + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addAllRequests( + java.lang.Iterable values) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, requests_); + onChanged(); + } else { + requestsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestOrBuilder getRequestsOrBuilder( + int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.getDefaultInstance()); + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.getDefaultInstance()); + } + /** + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.Builder, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestOrBuilder>( + requests_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + requests_ = null; + } + return requestsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) + private static final com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AsyncBatchAnnotateFilesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsyncBatchAnnotateFilesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesRequestOrBuilder.java new file mode 100644 index 000000000000..30195885fa70 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesRequestOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface AsyncBatchAnnotateFilesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + java.util.List + getRequestsList(); + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest getRequests(int index); + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + int getRequestsCount(); + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + java.util.List + getRequestsOrBuilderList(); + /** + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest requests = 1; + */ + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestOrBuilder getRequestsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesResponse.java new file mode 100644 index 000000000000..7d420e3bd8b2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesResponse.java @@ -0,0 +1,857 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response to an async batch file annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse} + */ +public final class AsyncBatchAnnotateFilesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) + AsyncBatchAnnotateFilesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use AsyncBatchAnnotateFilesResponse.newBuilder() to construct. + private AsyncBatchAnnotateFilesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AsyncBatchAnnotateFilesResponse() { + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AsyncBatchAnnotateFilesResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.parser(), extensionRegistry)); + 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) == 0x00000001)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.class, com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.Builder.class); + } + + public static final int RESPONSES_FIELD_NUMBER = 1; + private java.util.List responses_; + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public java.util.List getResponsesList() { + return responses_; + } + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public int getResponsesCount() { + return responses_.size(); + } + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse getResponses(int index) { + return responses_.get(index); + } + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, responses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse other = (com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) obj; + + boolean result = true; + result = result && getResponsesList() + .equals(other.getResponsesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse 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.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse 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.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse 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.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse 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.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 to an async batch file annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.class, com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse build() { + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse result = new com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse(this); + int from_bitField0_ = bitField0_; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.getDefaultInstance()) return this; + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResponsesFieldBuilder() : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List responses_ = + java.util.Collections.emptyList(); + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponseOrBuilder> responsesBuilder_; + + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addResponses(com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addResponses( + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.getDefaultInstance()); + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.getDefaultInstance()); + } + /** + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.Builder, com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) + private static final com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public AsyncBatchAnnotateFilesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsyncBatchAnnotateFilesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesResponseOrBuilder.java new file mode 100644 index 000000000000..67cf67b372aa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/AsyncBatchAnnotateFilesResponseOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface AsyncBatchAnnotateFilesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + java.util.List + getResponsesList(); + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse getResponses(int index); + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + int getResponsesCount(); + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + /** + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse responses = 1; + */ + com.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponseOrBuilder getResponsesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesRequest.java new file mode 100644 index 000000000000..e85ec646c1f7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesRequest.java @@ -0,0 +1,834 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Multiple image annotation requests are batched into a single service call.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest} + */ +public final class BatchAnnotateImagesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) + BatchAnnotateImagesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchAnnotateImagesRequest.newBuilder() to construct. + private BatchAnnotateImagesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BatchAnnotateImagesRequest() { + requests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchAnnotateImagesRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + requests_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.parser(), extensionRegistry)); + 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) == 0x00000001)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.class, com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.Builder.class); + } + + public static final int REQUESTS_FIELD_NUMBER = 1; + private java.util.List requests_; + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List getRequestsList() { + return requests_; + } + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public int getRequestsCount() { + return requests_.size(); + } + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest getRequests(int index) { + return requests_.get(index); + } + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(1, requests_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < requests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, requests_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest other = (com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) obj; + + boolean result = true; + result = result && getRequestsList() + .equals(other.getRequestsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest 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.vision.v1p3beta1.BatchAnnotateImagesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest 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.vision.v1p3beta1.BatchAnnotateImagesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest 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.vision.v1p3beta1.BatchAnnotateImagesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest 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.vision.v1p3beta1.BatchAnnotateImagesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Multiple image annotation requests are batched into a single service call.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.class, com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getRequestsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + requestsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest build() { + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest result = new com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest(this); + int from_bitField0_ = bitField0_; + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.getDefaultInstance()) return this; + if (requestsBuilder_ == null) { + if (!other.requests_.isEmpty()) { + if (requests_.isEmpty()) { + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRequestsIsMutable(); + requests_.addAll(other.requests_); + } + onChanged(); + } + } else { + if (!other.requests_.isEmpty()) { + if (requestsBuilder_.isEmpty()) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000001); + requestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRequestsFieldBuilder() : null; + } else { + requestsBuilder_.addAllMessages(other.requests_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List requests_ = + java.util.Collections.emptyList(); + private void ensureRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = new java.util.ArrayList(requests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageRequestOrBuilder> requestsBuilder_; + + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests(com.google.cloud.vision.v1p3beta1.AnnotateImageRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder addAllRequests( + java.lang.Iterable values) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, requests_); + onChanged(); + } else { + requestsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequestOrBuilder getRequestsOrBuilder( + int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.getDefaultInstance()); + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.getDefaultInstance()); + } + /** + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest, com.google.cloud.vision.v1p3beta1.AnnotateImageRequest.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageRequestOrBuilder>( + requests_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + requests_ = null; + } + return requestsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) + private static final com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public BatchAnnotateImagesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchAnnotateImagesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesRequestOrBuilder.java new file mode 100644 index 000000000000..d34fabeaa1f8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesRequestOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface BatchAnnotateImagesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + java.util.List + getRequestsList(); + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + com.google.cloud.vision.v1p3beta1.AnnotateImageRequest getRequests(int index); + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + int getRequestsCount(); + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + java.util.List + getRequestsOrBuilderList(); + /** + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageRequest requests = 1; + */ + com.google.cloud.vision.v1p3beta1.AnnotateImageRequestOrBuilder getRequestsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesResponse.java new file mode 100644 index 000000000000..6c0e3a0bdac3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesResponse.java @@ -0,0 +1,834 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response to a batch image annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse} + */ +public final class BatchAnnotateImagesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) + BatchAnnotateImagesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchAnnotateImagesResponse.newBuilder() to construct. + private BatchAnnotateImagesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BatchAnnotateImagesResponse() { + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchAnnotateImagesResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.parser(), extensionRegistry)); + 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) == 0x00000001)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.class, com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.Builder.class); + } + + public static final int RESPONSES_FIELD_NUMBER = 1; + private java.util.List responses_; + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List getResponsesList() { + return responses_; + } + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public int getResponsesCount() { + return responses_.size(); + } + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getResponses(int index) { + return responses_.get(index); + } + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, responses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse other = (com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) obj; + + boolean result = true; + result = result && getResponsesList() + .equals(other.getResponsesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse 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.vision.v1p3beta1.BatchAnnotateImagesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse 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.vision.v1p3beta1.BatchAnnotateImagesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse 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.vision.v1p3beta1.BatchAnnotateImagesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse 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.vision.v1p3beta1.BatchAnnotateImagesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 to a batch image annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.class, com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse build() { + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse result = new com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse(this); + int from_bitField0_ = bitField0_; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.getDefaultInstance()) return this; + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResponsesFieldBuilder() : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List responses_ = + java.util.Collections.emptyList(); + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder> responsesBuilder_; + + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder addResponses(com.google.cloud.vision.v1p3beta1.AnnotateImageResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder addResponses( + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.getDefaultInstance()); + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.getDefaultInstance()); + } + /** + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse, com.google.cloud.vision.v1p3beta1.AnnotateImageResponse.Builder, com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) + private static final com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public BatchAnnotateImagesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchAnnotateImagesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesResponseOrBuilder.java new file mode 100644 index 000000000000..7b145922c2f6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchAnnotateImagesResponseOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface BatchAnnotateImagesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + java.util.List + getResponsesList(); + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + com.google.cloud.vision.v1p3beta1.AnnotateImageResponse getResponses(int index); + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + int getResponsesCount(); + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + /** + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.AnnotateImageResponse responses = 1; + */ + com.google.cloud.vision.v1p3beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchOperationMetadata.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchOperationMetadata.java new file mode 100644 index 000000000000..647874964bd0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchOperationMetadata.java @@ -0,0 +1,1157 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Metadata for the batch operations such as the current state.
+ * This is included in the `metadata` field of the `Operation` returned by the
+ * `GetOperation` call of the `google::longrunning::Operations` service.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.BatchOperationMetadata} + */ +public final class BatchOperationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.BatchOperationMetadata) + BatchOperationMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchOperationMetadata.newBuilder() to construct. + private BatchOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BatchOperationMetadata() { + state_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchOperationMetadata( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (submitTime_ != null) { + subBuilder = submitTime_.toBuilder(); + } + submitTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(submitTime_); + submitTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.class, com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.Builder.class); + } + + /** + *
+   * Enumerates the possible states that the batch request can be in.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.BatchOperationMetadata.State} + */ + public enum State + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Invalid.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + *
+     * Request is actively being processed.
+     * 
+ * + * PROCESSING = 1; + */ + PROCESSING(1), + /** + *
+     * The request is done and at least one item has been successfully
+     * processed.
+     * 
+ * + * SUCCESSFUL = 2; + */ + SUCCESSFUL(2), + /** + *
+     * The request is done and no item has been successfully processed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + *
+     * The request is done after the longrunning.Operations.CancelOperation has
+     * been called by the user.  Any records that were processed before the
+     * cancel command are output as specified in the request.
+     * 
+ * + * CANCELLED = 4; + */ + CANCELLED(4), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Invalid.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Request is actively being processed.
+     * 
+ * + * PROCESSING = 1; + */ + public static final int PROCESSING_VALUE = 1; + /** + *
+     * The request is done and at least one item has been successfully
+     * processed.
+     * 
+ * + * SUCCESSFUL = 2; + */ + public static final int SUCCESSFUL_VALUE = 2; + /** + *
+     * The request is done and no item has been successfully processed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + *
+     * The request is done after the longrunning.Operations.CancelOperation has
+     * been called by the user.  Any records that were processed before the
+     * cancel command are output as specified in the request.
+     * 
+ * + * CANCELLED = 4; + */ + public static final int CANCELLED_VALUE = 4; + + + 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 State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNSPECIFIED; + case 1: return PROCESSING; + case 2: return SUCCESSFUL; + case 3: return FAILED; + case 4: return CANCELLED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.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.vision.v1p3beta1.BatchOperationMetadata.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.BatchOperationMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State getState() { + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State result = com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State.valueOf(state_); + return result == null ? com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State.UNRECOGNIZED : result; + } + + public static final int SUBMIT_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp submitTime_; + /** + *
+   * The time when the batch request was submitted to the server.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public boolean hasSubmitTime() { + return submitTime_ != null; + } + /** + *
+   * The time when the batch request was submitted to the server.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public com.google.protobuf.Timestamp getSubmitTime() { + return submitTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : submitTime_; + } + /** + *
+   * The time when the batch request was submitted to the server.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder() { + return getSubmitTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + /** + *
+   * The time when the batch request is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * The time when the batch request is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + *
+   * The time when the batch request is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (state_ != com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, state_); + } + if (submitTime_ != null) { + output.writeMessage(2, getSubmitTime()); + } + if (endTime_ != null) { + output.writeMessage(3, getEndTime()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ != com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, state_); + } + if (submitTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSubmitTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getEndTime()); + } + 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.vision.v1p3beta1.BatchOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata other = (com.google.cloud.vision.v1p3beta1.BatchOperationMetadata) obj; + + boolean result = true; + result = result && state_ == other.state_; + result = result && (hasSubmitTime() == other.hasSubmitTime()); + if (hasSubmitTime()) { + result = result && getSubmitTime() + .equals(other.getSubmitTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime() + .equals(other.getEndTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasSubmitTime()) { + hash = (37 * hash) + SUBMIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSubmitTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata 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.vision.v1p3beta1.BatchOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata 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.vision.v1p3beta1.BatchOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata 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.vision.v1p3beta1.BatchOperationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata 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.vision.v1p3beta1.BatchOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.BatchOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 for the batch operations such as the current state.
+   * This is included in the `metadata` field of the `Operation` returned by the
+   * `GetOperation` call of the `google::longrunning::Operations` service.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.BatchOperationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.BatchOperationMetadata) + com.google.cloud.vision.v1p3beta1.BatchOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.class, com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + state_ = 0; + + if (submitTimeBuilder_ == null) { + submitTime_ = null; + } else { + submitTime_ = null; + submitTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.BatchOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.BatchOperationMetadata build() { + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.BatchOperationMetadata buildPartial() { + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata result = new com.google.cloud.vision.v1p3beta1.BatchOperationMetadata(this); + result.state_ = state_; + if (submitTimeBuilder_ == null) { + result.submitTime_ = submitTime_; + } else { + result.submitTime_ = submitTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.BatchOperationMetadata) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.BatchOperationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.BatchOperationMetadata other) { + if (other == com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.getDefaultInstance()) return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasSubmitTime()) { + mergeSubmitTime(other.getSubmitTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.BatchOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int state_ = 0; + /** + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State getState() { + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State result = com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State.valueOf(state_); + return result == null ? com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State.UNRECOGNIZED : result; + } + /** + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + public Builder setState(com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp submitTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> submitTimeBuilder_; + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public boolean hasSubmitTime() { + return submitTimeBuilder_ != null || submitTime_ != null; + } + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public com.google.protobuf.Timestamp getSubmitTime() { + if (submitTimeBuilder_ == null) { + return submitTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : submitTime_; + } else { + return submitTimeBuilder_.getMessage(); + } + } + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public Builder setSubmitTime(com.google.protobuf.Timestamp value) { + if (submitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + submitTime_ = value; + onChanged(); + } else { + submitTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public Builder setSubmitTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (submitTimeBuilder_ == null) { + submitTime_ = builderForValue.build(); + onChanged(); + } else { + submitTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public Builder mergeSubmitTime(com.google.protobuf.Timestamp value) { + if (submitTimeBuilder_ == null) { + if (submitTime_ != null) { + submitTime_ = + com.google.protobuf.Timestamp.newBuilder(submitTime_).mergeFrom(value).buildPartial(); + } else { + submitTime_ = value; + } + onChanged(); + } else { + submitTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public Builder clearSubmitTime() { + if (submitTimeBuilder_ == null) { + submitTime_ = null; + onChanged(); + } else { + submitTime_ = null; + submitTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getSubmitTimeBuilder() { + + onChanged(); + return getSubmitTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder() { + if (submitTimeBuilder_ != null) { + return submitTimeBuilder_.getMessageOrBuilder(); + } else { + return submitTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : submitTime_; + } + } + /** + *
+     * The time when the batch request was submitted to the server.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getSubmitTimeFieldBuilder() { + if (submitTimeBuilder_ == null) { + submitTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getSubmitTime(), + getParentForChildren(), + isClean()); + submitTime_ = null; + } + return submitTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + *
+     * The time when the batch request is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getEndTime(), + getParentForChildren(), + isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.BatchOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.BatchOperationMetadata) + private static final com.google.cloud.vision.v1p3beta1.BatchOperationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.BatchOperationMetadata(); + } + + public static com.google.cloud.vision.v1p3beta1.BatchOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public BatchOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.BatchOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchOperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..f7b2bb780800 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BatchOperationMetadataOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface BatchOperationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.BatchOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + int getStateValue(); + /** + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BatchOperationMetadata.State state = 1; + */ + com.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State getState(); + + /** + *
+   * The time when the batch request was submitted to the server.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + boolean hasSubmitTime(); + /** + *
+   * The time when the batch request was submitted to the server.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + com.google.protobuf.Timestamp getSubmitTime(); + /** + *
+   * The time when the batch request was submitted to the server.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder(); + + /** + *
+   * The time when the batch request is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + boolean hasEndTime(); + /** + *
+   * The time when the batch request is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + *
+   * The time when the batch request is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Block.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Block.java new file mode 100644 index 000000000000..8b644a846999 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Block.java @@ -0,0 +1,1837 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Logical element on the page.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Block} + */ +public final class Block extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Block) + BlockOrBuilder { +private static final long serialVersionUID = 0L; + // Use Block.newBuilder() to construct. + private Block(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Block() { + paragraphs_ = java.util.Collections.emptyList(); + blockType_ = 0; + confidence_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Block( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder subBuilder = null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = input.readMessage(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingBox_); + boundingBox_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + paragraphs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + paragraphs_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Paragraph.parser(), extensionRegistry)); + break; + } + case 32: { + int rawValue = input.readEnum(); + + blockType_ = rawValue; + break; + } + case 45: { + + confidence_ = input.readFloat(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + paragraphs_ = java.util.Collections.unmodifiableList(paragraphs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Block_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Block_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Block.class, com.google.cloud.vision.v1p3beta1.Block.Builder.class); + } + + /** + *
+   * Type of a block (text, image etc) as identified by OCR.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.Block.BlockType} + */ + public enum BlockType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown block type.
+     * 
+ * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + *
+     * Regular text block.
+     * 
+ * + * TEXT = 1; + */ + TEXT(1), + /** + *
+     * Table block.
+     * 
+ * + * TABLE = 2; + */ + TABLE(2), + /** + *
+     * Image block.
+     * 
+ * + * PICTURE = 3; + */ + PICTURE(3), + /** + *
+     * Horizontal/vertical line box.
+     * 
+ * + * RULER = 4; + */ + RULER(4), + /** + *
+     * Barcode block.
+     * 
+ * + * BARCODE = 5; + */ + BARCODE(5), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown block type.
+     * 
+ * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + *
+     * Regular text block.
+     * 
+ * + * TEXT = 1; + */ + public static final int TEXT_VALUE = 1; + /** + *
+     * Table block.
+     * 
+ * + * TABLE = 2; + */ + public static final int TABLE_VALUE = 2; + /** + *
+     * Image block.
+     * 
+ * + * PICTURE = 3; + */ + public static final int PICTURE_VALUE = 3; + /** + *
+     * Horizontal/vertical line box.
+     * 
+ * + * RULER = 4; + */ + public static final int RULER_VALUE = 4; + /** + *
+     * Barcode block.
+     * 
+ * + * BARCODE = 5; + */ + public static final int BARCODE_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BlockType valueOf(int value) { + return forNumber(value); + } + + public static BlockType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return TEXT; + case 2: return TABLE; + case 3: return PICTURE; + case 4: return RULER; + case 5: return BARCODE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BlockType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BlockType findValueByNumber(int number) { + return BlockType.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.vision.v1p3beta1.Block.getDescriptor().getEnumTypes().get(0); + } + + private static final BlockType[] VALUES = values(); + + public static BlockType 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 BlockType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.Block.BlockType) + } + + private int bitField0_; + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_; + /** + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + /** + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + return getProperty(); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_; + /** + *
+   * The bounding box for the block.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   * * when the text is horizontal it might look like:
+   *         0----1
+   *         |    |
+   *         3----2
+   * * when it's rotated 180 degrees around the top-left corner it becomes:
+   *         2----3
+   *         |    |
+   *         1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public boolean hasBoundingBox() { + return boundingBox_ != null; + } + /** + *
+   * The bounding box for the block.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   * * when the text is horizontal it might look like:
+   *         0----1
+   *         |    |
+   *         3----2
+   * * when it's rotated 180 degrees around the top-left corner it becomes:
+   *         2----3
+   *         |    |
+   *         1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() { + return boundingBox_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } + /** + *
+   * The bounding box for the block.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   * * when the text is horizontal it might look like:
+   *         0----1
+   *         |    |
+   *         3----2
+   * * when it's rotated 180 degrees around the top-left corner it becomes:
+   *         2----3
+   *         |    |
+   *         1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + return getBoundingBox(); + } + + public static final int PARAGRAPHS_FIELD_NUMBER = 3; + private java.util.List paragraphs_; + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public java.util.List getParagraphsList() { + return paragraphs_; + } + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public java.util.List + getParagraphsOrBuilderList() { + return paragraphs_; + } + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public int getParagraphsCount() { + return paragraphs_.size(); + } + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p3beta1.Paragraph getParagraphs(int index) { + return paragraphs_.get(index); + } + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p3beta1.ParagraphOrBuilder getParagraphsOrBuilder( + int index) { + return paragraphs_.get(index); + } + + public static final int BLOCK_TYPE_FIELD_NUMBER = 4; + private int blockType_; + /** + *
+   * Detected block type (text, image etc) for this block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + public int getBlockTypeValue() { + return blockType_; + } + /** + *
+   * Detected block type (text, image etc) for this block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + public com.google.cloud.vision.v1p3beta1.Block.BlockType getBlockType() { + com.google.cloud.vision.v1p3beta1.Block.BlockType result = com.google.cloud.vision.v1p3beta1.Block.BlockType.valueOf(blockType_); + return result == null ? com.google.cloud.vision.v1p3beta1.Block.BlockType.UNRECOGNIZED : result; + } + + public static final int CONFIDENCE_FIELD_NUMBER = 5; + private float confidence_; + /** + *
+   * Confidence of the OCR results on the block. Range [0, 1].
+   * 
+ * + * float confidence = 5; + */ + public float getConfidence() { + return confidence_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (property_ != null) { + output.writeMessage(1, getProperty()); + } + if (boundingBox_ != null) { + output.writeMessage(2, getBoundingBox()); + } + for (int i = 0; i < paragraphs_.size(); i++) { + output.writeMessage(3, paragraphs_.get(i)); + } + if (blockType_ != com.google.cloud.vision.v1p3beta1.Block.BlockType.UNKNOWN.getNumber()) { + output.writeEnum(4, blockType_); + } + if (confidence_ != 0F) { + output.writeFloat(5, confidence_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (property_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProperty()); + } + if (boundingBox_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getBoundingBox()); + } + for (int i = 0; i < paragraphs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, paragraphs_.get(i)); + } + if (blockType_ != com.google.cloud.vision.v1p3beta1.Block.BlockType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, blockType_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(5, confidence_); + } + 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.vision.v1p3beta1.Block)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Block other = (com.google.cloud.vision.v1p3beta1.Block) obj; + + boolean result = true; + result = result && (hasProperty() == other.hasProperty()); + if (hasProperty()) { + result = result && getProperty() + .equals(other.getProperty()); + } + result = result && (hasBoundingBox() == other.hasBoundingBox()); + if (hasBoundingBox()) { + result = result && getBoundingBox() + .equals(other.getBoundingBox()); + } + result = result && getParagraphsList() + .equals(other.getParagraphsList()); + result = result && blockType_ == other.blockType_; + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProperty()) { + hash = (37 * hash) + PROPERTY_FIELD_NUMBER; + hash = (53 * hash) + getProperty().hashCode(); + } + if (hasBoundingBox()) { + hash = (37 * hash) + BOUNDING_BOX_FIELD_NUMBER; + hash = (53 * hash) + getBoundingBox().hashCode(); + } + if (getParagraphsCount() > 0) { + hash = (37 * hash) + PARAGRAPHS_FIELD_NUMBER; + hash = (53 * hash) + getParagraphsList().hashCode(); + } + hash = (37 * hash) + BLOCK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + blockType_; + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Block parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Block 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.vision.v1p3beta1.Block parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Block 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.vision.v1p3beta1.Block parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Block parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Block parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Block 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.vision.v1p3beta1.Block parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Block 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.vision.v1p3beta1.Block parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Block parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Block prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Logical element on the page.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Block} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Block) + com.google.cloud.vision.v1p3beta1.BlockOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Block_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Block_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Block.class, com.google.cloud.vision.v1p3beta1.Block.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Block.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getParagraphsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (propertyBuilder_ == null) { + property_ = null; + } else { + property_ = null; + propertyBuilder_ = null; + } + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + if (paragraphsBuilder_ == null) { + paragraphs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + paragraphsBuilder_.clear(); + } + blockType_ = 0; + + confidence_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Block_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Block getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Block.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Block build() { + com.google.cloud.vision.v1p3beta1.Block result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Block buildPartial() { + com.google.cloud.vision.v1p3beta1.Block result = new com.google.cloud.vision.v1p3beta1.Block(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (propertyBuilder_ == null) { + result.property_ = property_; + } else { + result.property_ = propertyBuilder_.build(); + } + if (boundingBoxBuilder_ == null) { + result.boundingBox_ = boundingBox_; + } else { + result.boundingBox_ = boundingBoxBuilder_.build(); + } + if (paragraphsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + paragraphs_ = java.util.Collections.unmodifiableList(paragraphs_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.paragraphs_ = paragraphs_; + } else { + result.paragraphs_ = paragraphsBuilder_.build(); + } + result.blockType_ = blockType_; + result.confidence_ = confidence_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Block) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Block)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Block other) { + if (other == com.google.cloud.vision.v1p3beta1.Block.getDefaultInstance()) return this; + if (other.hasProperty()) { + mergeProperty(other.getProperty()); + } + if (other.hasBoundingBox()) { + mergeBoundingBox(other.getBoundingBox()); + } + if (paragraphsBuilder_ == null) { + if (!other.paragraphs_.isEmpty()) { + if (paragraphs_.isEmpty()) { + paragraphs_ = other.paragraphs_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureParagraphsIsMutable(); + paragraphs_.addAll(other.paragraphs_); + } + onChanged(); + } + } else { + if (!other.paragraphs_.isEmpty()) { + if (paragraphsBuilder_.isEmpty()) { + paragraphsBuilder_.dispose(); + paragraphsBuilder_ = null; + paragraphs_ = other.paragraphs_; + bitField0_ = (bitField0_ & ~0x00000004); + paragraphsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getParagraphsFieldBuilder() : null; + } else { + paragraphsBuilder_.addAllMessages(other.paragraphs_); + } + } + } + if (other.blockType_ != 0) { + setBlockTypeValue(other.getBlockTypeValue()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Block parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Block) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> propertyBuilder_; + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + property_ = value; + onChanged(); + } else { + propertyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder builderForValue) { + if (propertyBuilder_ == null) { + property_ = builderForValue.build(); + onChanged(); + } else { + propertyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.newBuilder(property_).mergeFrom(value).buildPartial(); + } else { + property_ = value; + } + onChanged(); + } else { + propertyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder clearProperty() { + if (propertyBuilder_ == null) { + property_ = null; + onChanged(); + } else { + property_ = null; + propertyBuilder_ = null; + } + + return this; + } + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null ? + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + } + /** + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), + getParentForChildren(), + isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingBoxBuilder_; + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public boolean hasBoundingBox() { + return boundingBoxBuilder_ != null || boundingBox_ != null; + } + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } else { + return boundingBoxBuilder_.getMessage(); + } + } + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingBox_ = value; + onChanged(); + } else { + boundingBoxBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingBoxBuilder_ == null) { + boundingBox_ = builderForValue.build(); + onChanged(); + } else { + boundingBoxBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder mergeBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingBox_).mergeFrom(value).buildPartial(); + } else { + boundingBox_ = value; + } + onChanged(); + } else { + boundingBoxBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder clearBoundingBox() { + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + onChanged(); + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + + return this; + } + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingBoxBuilder() { + + onChanged(); + return getBoundingBoxFieldBuilder().getBuilder(); + } + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } + } + /** + *
+     * The bounding box for the block.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     * * when the text is horizontal it might look like:
+     *         0----1
+     *         |    |
+     *         3----2
+     * * when it's rotated 180 degrees around the top-left corner it becomes:
+     *         2----3
+     *         |    |
+     *         1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingBox(), + getParentForChildren(), + isClean()); + boundingBox_ = null; + } + return boundingBoxBuilder_; + } + + private java.util.List paragraphs_ = + java.util.Collections.emptyList(); + private void ensureParagraphsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + paragraphs_ = new java.util.ArrayList(paragraphs_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Paragraph, com.google.cloud.vision.v1p3beta1.Paragraph.Builder, com.google.cloud.vision.v1p3beta1.ParagraphOrBuilder> paragraphsBuilder_; + + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public java.util.List getParagraphsList() { + if (paragraphsBuilder_ == null) { + return java.util.Collections.unmodifiableList(paragraphs_); + } else { + return paragraphsBuilder_.getMessageList(); + } + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public int getParagraphsCount() { + if (paragraphsBuilder_ == null) { + return paragraphs_.size(); + } else { + return paragraphsBuilder_.getCount(); + } + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p3beta1.Paragraph getParagraphs(int index) { + if (paragraphsBuilder_ == null) { + return paragraphs_.get(index); + } else { + return paragraphsBuilder_.getMessage(index); + } + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder setParagraphs( + int index, com.google.cloud.vision.v1p3beta1.Paragraph value) { + if (paragraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParagraphsIsMutable(); + paragraphs_.set(index, value); + onChanged(); + } else { + paragraphsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder setParagraphs( + int index, com.google.cloud.vision.v1p3beta1.Paragraph.Builder builderForValue) { + if (paragraphsBuilder_ == null) { + ensureParagraphsIsMutable(); + paragraphs_.set(index, builderForValue.build()); + onChanged(); + } else { + paragraphsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder addParagraphs(com.google.cloud.vision.v1p3beta1.Paragraph value) { + if (paragraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParagraphsIsMutable(); + paragraphs_.add(value); + onChanged(); + } else { + paragraphsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder addParagraphs( + int index, com.google.cloud.vision.v1p3beta1.Paragraph value) { + if (paragraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParagraphsIsMutable(); + paragraphs_.add(index, value); + onChanged(); + } else { + paragraphsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder addParagraphs( + com.google.cloud.vision.v1p3beta1.Paragraph.Builder builderForValue) { + if (paragraphsBuilder_ == null) { + ensureParagraphsIsMutable(); + paragraphs_.add(builderForValue.build()); + onChanged(); + } else { + paragraphsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder addParagraphs( + int index, com.google.cloud.vision.v1p3beta1.Paragraph.Builder builderForValue) { + if (paragraphsBuilder_ == null) { + ensureParagraphsIsMutable(); + paragraphs_.add(index, builderForValue.build()); + onChanged(); + } else { + paragraphsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder addAllParagraphs( + java.lang.Iterable values) { + if (paragraphsBuilder_ == null) { + ensureParagraphsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, paragraphs_); + onChanged(); + } else { + paragraphsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder clearParagraphs() { + if (paragraphsBuilder_ == null) { + paragraphs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + paragraphsBuilder_.clear(); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public Builder removeParagraphs(int index) { + if (paragraphsBuilder_ == null) { + ensureParagraphsIsMutable(); + paragraphs_.remove(index); + onChanged(); + } else { + paragraphsBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p3beta1.Paragraph.Builder getParagraphsBuilder( + int index) { + return getParagraphsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p3beta1.ParagraphOrBuilder getParagraphsOrBuilder( + int index) { + if (paragraphsBuilder_ == null) { + return paragraphs_.get(index); } else { + return paragraphsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public java.util.List + getParagraphsOrBuilderList() { + if (paragraphsBuilder_ != null) { + return paragraphsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(paragraphs_); + } + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p3beta1.Paragraph.Builder addParagraphsBuilder() { + return getParagraphsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Paragraph.getDefaultInstance()); + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p3beta1.Paragraph.Builder addParagraphsBuilder( + int index) { + return getParagraphsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Paragraph.getDefaultInstance()); + } + /** + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + public java.util.List + getParagraphsBuilderList() { + return getParagraphsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Paragraph, com.google.cloud.vision.v1p3beta1.Paragraph.Builder, com.google.cloud.vision.v1p3beta1.ParagraphOrBuilder> + getParagraphsFieldBuilder() { + if (paragraphsBuilder_ == null) { + paragraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Paragraph, com.google.cloud.vision.v1p3beta1.Paragraph.Builder, com.google.cloud.vision.v1p3beta1.ParagraphOrBuilder>( + paragraphs_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + paragraphs_ = null; + } + return paragraphsBuilder_; + } + + private int blockType_ = 0; + /** + *
+     * Detected block type (text, image etc) for this block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + public int getBlockTypeValue() { + return blockType_; + } + /** + *
+     * Detected block type (text, image etc) for this block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + public Builder setBlockTypeValue(int value) { + blockType_ = value; + onChanged(); + return this; + } + /** + *
+     * Detected block type (text, image etc) for this block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + public com.google.cloud.vision.v1p3beta1.Block.BlockType getBlockType() { + com.google.cloud.vision.v1p3beta1.Block.BlockType result = com.google.cloud.vision.v1p3beta1.Block.BlockType.valueOf(blockType_); + return result == null ? com.google.cloud.vision.v1p3beta1.Block.BlockType.UNRECOGNIZED : result; + } + /** + *
+     * Detected block type (text, image etc) for this block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + public Builder setBlockType(com.google.cloud.vision.v1p3beta1.Block.BlockType value) { + if (value == null) { + throw new NullPointerException(); + } + + blockType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Detected block type (text, image etc) for this block.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + public Builder clearBlockType() { + + blockType_ = 0; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+     * Confidence of the OCR results on the block. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence of the OCR results on the block. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence of the OCR results on the block. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Block) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Block) + private static final com.google.cloud.vision.v1p3beta1.Block DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Block(); + } + + public static com.google.cloud.vision.v1p3beta1.Block getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Block parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Block(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Block getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BlockOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BlockOrBuilder.java new file mode 100644 index 000000000000..4a414c0b2ad0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BlockOrBuilder.java @@ -0,0 +1,171 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface BlockOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Block) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty(); + /** + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder(); + + /** + *
+   * The bounding box for the block.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   * * when the text is horizontal it might look like:
+   *         0----1
+   *         |    |
+   *         3----2
+   * * when it's rotated 180 degrees around the top-left corner it becomes:
+   *         2----3
+   *         |    |
+   *         1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + boolean hasBoundingBox(); + /** + *
+   * The bounding box for the block.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   * * when the text is horizontal it might look like:
+   *         0----1
+   *         |    |
+   *         3----2
+   * * when it's rotated 180 degrees around the top-left corner it becomes:
+   *         2----3
+   *         |    |
+   *         1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox(); + /** + *
+   * The bounding box for the block.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   * * when the text is horizontal it might look like:
+   *         0----1
+   *         |    |
+   *         3----2
+   * * when it's rotated 180 degrees around the top-left corner it becomes:
+   *         2----3
+   *         |    |
+   *         1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder(); + + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + java.util.List + getParagraphsList(); + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + com.google.cloud.vision.v1p3beta1.Paragraph getParagraphs(int index); + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + int getParagraphsCount(); + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + java.util.List + getParagraphsOrBuilderList(); + /** + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Paragraph paragraphs = 3; + */ + com.google.cloud.vision.v1p3beta1.ParagraphOrBuilder getParagraphsOrBuilder( + int index); + + /** + *
+   * Detected block type (text, image etc) for this block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + int getBlockTypeValue(); + /** + *
+   * Detected block type (text, image etc) for this block.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Block.BlockType block_type = 4; + */ + com.google.cloud.vision.v1p3beta1.Block.BlockType getBlockType(); + + /** + *
+   * Confidence of the OCR results on the block. Range [0, 1].
+   * 
+ * + * float confidence = 5; + */ + float getConfidence(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BoundingPoly.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BoundingPoly.java new file mode 100644 index 000000000000..3c4880f4e3a2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BoundingPoly.java @@ -0,0 +1,1269 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A bounding polygon for the detected image annotation.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.BoundingPoly} + */ +public final class BoundingPoly extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.BoundingPoly) + BoundingPolyOrBuilder { +private static final long serialVersionUID = 0L; + // Use BoundingPoly.newBuilder() to construct. + private BoundingPoly(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BoundingPoly() { + vertices_ = java.util.Collections.emptyList(); + normalizedVertices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BoundingPoly( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + vertices_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Vertex.parser(), extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + normalizedVertices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + normalizedVertices_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.NormalizedVertex.parser(), extensionRegistry)); + 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) == 0x00000001)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + normalizedVertices_ = java.util.Collections.unmodifiableList(normalizedVertices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.BoundingPoly.class, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder.class); + } + + public static final int VERTICES_FIELD_NUMBER = 1; + private java.util.List vertices_; + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public java.util.List getVerticesList() { + return vertices_; + } + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + return vertices_; + } + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public int getVerticesCount() { + return vertices_.size(); + } + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.Vertex getVertices(int index) { + return vertices_.get(index); + } + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.VertexOrBuilder getVerticesOrBuilder( + int index) { + return vertices_.get(index); + } + + public static final int NORMALIZED_VERTICES_FIELD_NUMBER = 2; + private java.util.List normalizedVertices_; + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List getNormalizedVerticesList() { + return normalizedVertices_; + } + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesOrBuilderList() { + return normalizedVertices_; + } + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public int getNormalizedVerticesCount() { + return normalizedVertices_.size(); + } + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex getNormalizedVertices(int index) { + return normalizedVertices_.get(index); + } + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index) { + return normalizedVertices_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < vertices_.size(); i++) { + output.writeMessage(1, vertices_.get(i)); + } + for (int i = 0; i < normalizedVertices_.size(); i++) { + output.writeMessage(2, normalizedVertices_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < vertices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, vertices_.get(i)); + } + for (int i = 0; i < normalizedVertices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, normalizedVertices_.get(i)); + } + size += 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.vision.v1p3beta1.BoundingPoly)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.BoundingPoly other = (com.google.cloud.vision.v1p3beta1.BoundingPoly) obj; + + boolean result = true; + result = result && getVerticesList() + .equals(other.getVerticesList()); + result = result && getNormalizedVerticesList() + .equals(other.getNormalizedVerticesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getVerticesCount() > 0) { + hash = (37 * hash) + VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getVerticesList().hashCode(); + } + if (getNormalizedVerticesCount() > 0) { + hash = (37 * hash) + NORMALIZED_VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getNormalizedVerticesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.BoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.BoundingPoly prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A bounding polygon for the detected image annotation.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.BoundingPoly} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.BoundingPoly) + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.BoundingPoly.class, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getVerticesFieldBuilder(); + getNormalizedVerticesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + verticesBuilder_.clear(); + } + if (normalizedVerticesBuilder_ == null) { + normalizedVertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + normalizedVerticesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.BoundingPoly getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.BoundingPoly build() { + com.google.cloud.vision.v1p3beta1.BoundingPoly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.BoundingPoly buildPartial() { + com.google.cloud.vision.v1p3beta1.BoundingPoly result = new com.google.cloud.vision.v1p3beta1.BoundingPoly(this); + int from_bitField0_ = bitField0_; + if (verticesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.vertices_ = vertices_; + } else { + result.vertices_ = verticesBuilder_.build(); + } + if (normalizedVerticesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + normalizedVertices_ = java.util.Collections.unmodifiableList(normalizedVertices_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.normalizedVertices_ = normalizedVertices_; + } else { + result.normalizedVertices_ = normalizedVerticesBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.BoundingPoly) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.BoundingPoly)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.BoundingPoly other) { + if (other == com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance()) return this; + if (verticesBuilder_ == null) { + if (!other.vertices_.isEmpty()) { + if (vertices_.isEmpty()) { + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVerticesIsMutable(); + vertices_.addAll(other.vertices_); + } + onChanged(); + } + } else { + if (!other.vertices_.isEmpty()) { + if (verticesBuilder_.isEmpty()) { + verticesBuilder_.dispose(); + verticesBuilder_ = null; + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + verticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getVerticesFieldBuilder() : null; + } else { + verticesBuilder_.addAllMessages(other.vertices_); + } + } + } + if (normalizedVerticesBuilder_ == null) { + if (!other.normalizedVertices_.isEmpty()) { + if (normalizedVertices_.isEmpty()) { + normalizedVertices_ = other.normalizedVertices_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.addAll(other.normalizedVertices_); + } + onChanged(); + } + } else { + if (!other.normalizedVertices_.isEmpty()) { + if (normalizedVerticesBuilder_.isEmpty()) { + normalizedVerticesBuilder_.dispose(); + normalizedVerticesBuilder_ = null; + normalizedVertices_ = other.normalizedVertices_; + bitField0_ = (bitField0_ & ~0x00000002); + normalizedVerticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNormalizedVerticesFieldBuilder() : null; + } else { + normalizedVerticesBuilder_.addAllMessages(other.normalizedVertices_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.BoundingPoly parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.BoundingPoly) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List vertices_ = + java.util.Collections.emptyList(); + private void ensureVerticesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = new java.util.ArrayList(vertices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Vertex, com.google.cloud.vision.v1p3beta1.Vertex.Builder, com.google.cloud.vision.v1p3beta1.VertexOrBuilder> verticesBuilder_; + + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public java.util.List getVerticesList() { + if (verticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(vertices_); + } else { + return verticesBuilder_.getMessageList(); + } + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public int getVerticesCount() { + if (verticesBuilder_ == null) { + return vertices_.size(); + } else { + return verticesBuilder_.getCount(); + } + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.Vertex getVertices(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessage(index); + } + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.vision.v1p3beta1.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.set(index, value); + onChanged(); + } else { + verticesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.vision.v1p3beta1.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.set(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.vision.v1p3beta1.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(value); + onChanged(); + } else { + verticesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.vision.v1p3beta1.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(index, value); + onChanged(); + } else { + verticesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder addVertices( + com.google.cloud.vision.v1p3beta1.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.vision.v1p3beta1.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder addAllVertices( + java.lang.Iterable values) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, vertices_); + onChanged(); + } else { + verticesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder clearVertices() { + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + verticesBuilder_.clear(); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public Builder removeVertices(int index) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.remove(index); + onChanged(); + } else { + verticesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.Vertex.Builder getVerticesBuilder( + int index) { + return getVerticesFieldBuilder().getBuilder(index); + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.VertexOrBuilder getVerticesOrBuilder( + int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); } else { + return verticesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + if (verticesBuilder_ != null) { + return verticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(vertices_); + } + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.Vertex.Builder addVerticesBuilder() { + return getVerticesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Vertex.getDefaultInstance()); + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.Vertex.Builder addVerticesBuilder( + int index) { + return getVerticesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Vertex.getDefaultInstance()); + } + /** + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + public java.util.List + getVerticesBuilderList() { + return getVerticesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Vertex, com.google.cloud.vision.v1p3beta1.Vertex.Builder, com.google.cloud.vision.v1p3beta1.VertexOrBuilder> + getVerticesFieldBuilder() { + if (verticesBuilder_ == null) { + verticesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Vertex, com.google.cloud.vision.v1p3beta1.Vertex.Builder, com.google.cloud.vision.v1p3beta1.VertexOrBuilder>( + vertices_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + vertices_ = null; + } + return verticesBuilder_; + } + + private java.util.List normalizedVertices_ = + java.util.Collections.emptyList(); + private void ensureNormalizedVerticesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + normalizedVertices_ = new java.util.ArrayList(normalizedVertices_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedVertex, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder> normalizedVerticesBuilder_; + + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List getNormalizedVerticesList() { + if (normalizedVerticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(normalizedVertices_); + } else { + return normalizedVerticesBuilder_.getMessageList(); + } + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public int getNormalizedVerticesCount() { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.size(); + } else { + return normalizedVerticesBuilder_.getCount(); + } + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex getNormalizedVertices(int index) { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.get(index); + } else { + return normalizedVerticesBuilder_.getMessage(index); + } + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.vision.v1p3beta1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.set(index, value); + onChanged(); + } else { + normalizedVerticesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.set(index, builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices(com.google.cloud.vision.v1p3beta1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(value); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.vision.v1p3beta1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(index, value); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(index, builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addAllNormalizedVertices( + java.lang.Iterable values) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, normalizedVertices_); + onChanged(); + } else { + normalizedVerticesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder clearNormalizedVertices() { + if (normalizedVerticesBuilder_ == null) { + normalizedVertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + normalizedVerticesBuilder_.clear(); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public Builder removeNormalizedVertices(int index) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.remove(index); + onChanged(); + } else { + normalizedVerticesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder getNormalizedVerticesBuilder( + int index) { + return getNormalizedVerticesFieldBuilder().getBuilder(index); + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index) { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.get(index); } else { + return normalizedVerticesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesOrBuilderList() { + if (normalizedVerticesBuilder_ != null) { + return normalizedVerticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(normalizedVertices_); + } + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder addNormalizedVerticesBuilder() { + return getNormalizedVerticesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.NormalizedVertex.getDefaultInstance()); + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder addNormalizedVerticesBuilder( + int index) { + return getNormalizedVerticesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.NormalizedVertex.getDefaultInstance()); + } + /** + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesBuilderList() { + return getNormalizedVerticesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedVertex, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder> + getNormalizedVerticesFieldBuilder() { + if (normalizedVerticesBuilder_ == null) { + normalizedVerticesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedVertex, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder>( + normalizedVertices_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + normalizedVertices_ = null; + } + return normalizedVerticesBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.BoundingPoly) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.BoundingPoly) + private static final com.google.cloud.vision.v1p3beta1.BoundingPoly DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.BoundingPoly(); + } + + public static com.google.cloud.vision.v1p3beta1.BoundingPoly getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public BoundingPoly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoundingPoly(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.BoundingPoly getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BoundingPolyOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BoundingPolyOrBuilder.java new file mode 100644 index 000000000000..8fa2aef81e73 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/BoundingPolyOrBuilder.java @@ -0,0 +1,97 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface BoundingPolyOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.BoundingPoly) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + java.util.List + getVerticesList(); + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + com.google.cloud.vision.v1p3beta1.Vertex getVertices(int index); + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + int getVerticesCount(); + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + java.util.List + getVerticesOrBuilderList(); + /** + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Vertex vertices = 1; + */ + com.google.cloud.vision.v1p3beta1.VertexOrBuilder getVerticesOrBuilder( + int index); + + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + java.util.List + getNormalizedVerticesList(); + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + com.google.cloud.vision.v1p3beta1.NormalizedVertex getNormalizedVertices(int index); + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + int getNormalizedVerticesCount(); + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + java.util.List + getNormalizedVerticesOrBuilderList(); + /** + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex normalized_vertices = 2; + */ + com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ColorInfo.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ColorInfo.java new file mode 100644 index 000000000000..b74af94161ab --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ColorInfo.java @@ -0,0 +1,786 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Color information consists of RGB channels, score, and the fraction of
+ * the image that the color occupies in the image.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ColorInfo} + */ +public final class ColorInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ColorInfo) + ColorInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use ColorInfo.newBuilder() to construct. + private ColorInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ColorInfo() { + score_ = 0F; + pixelFraction_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ColorInfo( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.type.Color.Builder subBuilder = null; + if (color_ != null) { + subBuilder = color_.toBuilder(); + } + color_ = input.readMessage(com.google.type.Color.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(color_); + color_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + score_ = input.readFloat(); + break; + } + case 29: { + + pixelFraction_ = input.readFloat(); + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ColorInfo_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ColorInfo.class, com.google.cloud.vision.v1p3beta1.ColorInfo.Builder.class); + } + + public static final int COLOR_FIELD_NUMBER = 1; + private com.google.type.Color color_; + /** + *
+   * RGB components of the color.
+   * 
+ * + * .google.type.Color color = 1; + */ + public boolean hasColor() { + return color_ != null; + } + /** + *
+   * RGB components of the color.
+   * 
+ * + * .google.type.Color color = 1; + */ + public com.google.type.Color getColor() { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + /** + *
+   * RGB components of the color.
+   * 
+ * + * .google.type.Color color = 1; + */ + public com.google.type.ColorOrBuilder getColorOrBuilder() { + return getColor(); + } + + public static final int SCORE_FIELD_NUMBER = 2; + private float score_; + /** + *
+   * Image-specific score for this color. Value in range [0, 1].
+   * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + + public static final int PIXEL_FRACTION_FIELD_NUMBER = 3; + private float pixelFraction_; + /** + *
+   * The fraction of pixels the color occupies in the image.
+   * Value in range [0, 1].
+   * 
+ * + * float pixel_fraction = 3; + */ + public float getPixelFraction() { + return pixelFraction_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (color_ != null) { + output.writeMessage(1, getColor()); + } + if (score_ != 0F) { + output.writeFloat(2, score_); + } + if (pixelFraction_ != 0F) { + output.writeFloat(3, pixelFraction_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (color_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getColor()); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, score_); + } + if (pixelFraction_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, pixelFraction_); + } + 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.vision.v1p3beta1.ColorInfo)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ColorInfo other = (com.google.cloud.vision.v1p3beta1.ColorInfo) obj; + + boolean result = true; + result = result && (hasColor() == other.hasColor()); + if (hasColor()) { + result = result && getColor() + .equals(other.getColor()); + } + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && ( + java.lang.Float.floatToIntBits(getPixelFraction()) + == java.lang.Float.floatToIntBits( + other.getPixelFraction())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasColor()) { + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + getColor().hashCode(); + } + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (37 * hash) + PIXEL_FRACTION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPixelFraction()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ColorInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ColorInfo 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.vision.v1p3beta1.ColorInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ColorInfo 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.vision.v1p3beta1.ColorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ColorInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ColorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ColorInfo 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.vision.v1p3beta1.ColorInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ColorInfo 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.vision.v1p3beta1.ColorInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ColorInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ColorInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Color information consists of RGB channels, score, and the fraction of
+   * the image that the color occupies in the image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ColorInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ColorInfo) + com.google.cloud.vision.v1p3beta1.ColorInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ColorInfo_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ColorInfo.class, com.google.cloud.vision.v1p3beta1.ColorInfo.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ColorInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (colorBuilder_ == null) { + color_ = null; + } else { + color_ = null; + colorBuilder_ = null; + } + score_ = 0F; + + pixelFraction_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ColorInfo_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ColorInfo getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ColorInfo.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ColorInfo build() { + com.google.cloud.vision.v1p3beta1.ColorInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ColorInfo buildPartial() { + com.google.cloud.vision.v1p3beta1.ColorInfo result = new com.google.cloud.vision.v1p3beta1.ColorInfo(this); + if (colorBuilder_ == null) { + result.color_ = color_; + } else { + result.color_ = colorBuilder_.build(); + } + result.score_ = score_; + result.pixelFraction_ = pixelFraction_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ColorInfo) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ColorInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ColorInfo other) { + if (other == com.google.cloud.vision.v1p3beta1.ColorInfo.getDefaultInstance()) return this; + if (other.hasColor()) { + mergeColor(other.getColor()); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + if (other.getPixelFraction() != 0F) { + setPixelFraction(other.getPixelFraction()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ColorInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ColorInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.type.Color color_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> colorBuilder_; + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + public boolean hasColor() { + return colorBuilder_ != null || color_ != null; + } + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + public com.google.type.Color getColor() { + if (colorBuilder_ == null) { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } else { + return colorBuilder_.getMessage(); + } + } + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + public Builder setColor(com.google.type.Color value) { + if (colorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + color_ = value; + onChanged(); + } else { + colorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + public Builder setColor( + com.google.type.Color.Builder builderForValue) { + if (colorBuilder_ == null) { + color_ = builderForValue.build(); + onChanged(); + } else { + colorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + public Builder mergeColor(com.google.type.Color value) { + if (colorBuilder_ == null) { + if (color_ != null) { + color_ = + com.google.type.Color.newBuilder(color_).mergeFrom(value).buildPartial(); + } else { + color_ = value; + } + onChanged(); + } else { + colorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + public Builder clearColor() { + if (colorBuilder_ == null) { + color_ = null; + onChanged(); + } else { + color_ = null; + colorBuilder_ = null; + } + + return this; + } + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + public com.google.type.Color.Builder getColorBuilder() { + + onChanged(); + return getColorFieldBuilder().getBuilder(); + } + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + public com.google.type.ColorOrBuilder getColorOrBuilder() { + if (colorBuilder_ != null) { + return colorBuilder_.getMessageOrBuilder(); + } else { + return color_ == null ? + com.google.type.Color.getDefaultInstance() : color_; + } + } + /** + *
+     * RGB components of the color.
+     * 
+ * + * .google.type.Color color = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + getColorFieldBuilder() { + if (colorBuilder_ == null) { + colorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder>( + getColor(), + getParentForChildren(), + isClean()); + color_ = null; + } + return colorBuilder_; + } + + private float score_ ; + /** + *
+     * Image-specific score for this color. Value in range [0, 1].
+     * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + /** + *
+     * Image-specific score for this color. Value in range [0, 1].
+     * 
+ * + * float score = 2; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+     * Image-specific score for this color. Value in range [0, 1].
+     * 
+ * + * float score = 2; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + + private float pixelFraction_ ; + /** + *
+     * The fraction of pixels the color occupies in the image.
+     * Value in range [0, 1].
+     * 
+ * + * float pixel_fraction = 3; + */ + public float getPixelFraction() { + return pixelFraction_; + } + /** + *
+     * The fraction of pixels the color occupies in the image.
+     * Value in range [0, 1].
+     * 
+ * + * float pixel_fraction = 3; + */ + public Builder setPixelFraction(float value) { + + pixelFraction_ = value; + onChanged(); + return this; + } + /** + *
+     * The fraction of pixels the color occupies in the image.
+     * Value in range [0, 1].
+     * 
+ * + * float pixel_fraction = 3; + */ + public Builder clearPixelFraction() { + + pixelFraction_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ColorInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ColorInfo) + private static final com.google.cloud.vision.v1p3beta1.ColorInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ColorInfo(); + } + + public static com.google.cloud.vision.v1p3beta1.ColorInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ColorInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ColorInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ColorInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ColorInfoOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ColorInfoOrBuilder.java new file mode 100644 index 000000000000..3f69dc0a6fb1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ColorInfoOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ColorInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ColorInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * RGB components of the color.
+   * 
+ * + * .google.type.Color color = 1; + */ + boolean hasColor(); + /** + *
+   * RGB components of the color.
+   * 
+ * + * .google.type.Color color = 1; + */ + com.google.type.Color getColor(); + /** + *
+   * RGB components of the color.
+   * 
+ * + * .google.type.Color color = 1; + */ + com.google.type.ColorOrBuilder getColorOrBuilder(); + + /** + *
+   * Image-specific score for this color. Value in range [0, 1].
+   * 
+ * + * float score = 2; + */ + float getScore(); + + /** + *
+   * The fraction of pixels the color occupies in the image.
+   * Value in range [0, 1].
+   * 
+ * + * float pixel_fraction = 3; + */ + float getPixelFraction(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductRequest.java new file mode 100644 index 000000000000..867172ce77b8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductRequest.java @@ -0,0 +1,971 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `CreateProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CreateProductRequest} + */ +public final class CreateProductRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.CreateProductRequest) + CreateProductRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateProductRequest.newBuilder() to construct. + private CreateProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateProductRequest() { + parent_ = ""; + productId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateProductRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = input.readMessage(com.google.cloud.vision.v1p3beta1.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + productId_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CreateProductRequest.class, com.google.cloud.vision.v1p3beta1.CreateProductRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The project in which the Product should be created.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * 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 project in which the Product should be created.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * 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 PRODUCT_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.Product product_; + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public boolean hasProduct() { + return product_ != null; + } + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p3beta1.Product getProduct() { + return product_ == null ? com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int PRODUCT_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object productId_; + /** + *
+   * A user-supplied resource id for this Product. If set, the server will
+   * attempt to use this value as the resource id. If it is already in use, an
+   * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+   * long. It cannot contain the character `/`.
+   * 
+ * + * string product_id = 3; + */ + public java.lang.String getProductId() { + java.lang.Object ref = productId_; + 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(); + productId_ = s; + return s; + } + } + /** + *
+   * A user-supplied resource id for this Product. If set, the server will
+   * attempt to use this value as the resource id. If it is already in use, an
+   * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+   * long. It cannot contain the character `/`.
+   * 
+ * + * string product_id = 3; + */ + public com.google.protobuf.ByteString + getProductIdBytes() { + java.lang.Object ref = productId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (product_ != null) { + output.writeMessage(2, getProduct()); + } + if (!getProductIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productId_); + } + unknownFields.writeTo(output); + } + + 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 (product_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getProduct()); + } + if (!getProductIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, productId_); + } + 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.vision.v1p3beta1.CreateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.CreateProductRequest other = (com.google.cloud.vision.v1p3beta1.CreateProductRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasProduct() == other.hasProduct()); + if (hasProduct()) { + result = result && getProduct() + .equals(other.getProduct()); + } + result = result && getProductId() + .equals(other.getProductId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + hash = (37 * hash) + PRODUCT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProductId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest 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.vision.v1p3beta1.CreateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest 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.vision.v1p3beta1.CreateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest 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.vision.v1p3beta1.CreateProductRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest 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.vision.v1p3beta1.CreateProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.CreateProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `CreateProduct` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CreateProductRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.CreateProductRequest) + com.google.cloud.vision.v1p3beta1.CreateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CreateProductRequest.class, com.google.cloud.vision.v1p3beta1.CreateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.CreateProductRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + productId_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.CreateProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.CreateProductRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.CreateProductRequest build() { + com.google.cloud.vision.v1p3beta1.CreateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.CreateProductRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.CreateProductRequest result = new com.google.cloud.vision.v1p3beta1.CreateProductRequest(this); + result.parent_ = parent_; + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.productId_ = productId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.CreateProductRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.CreateProductRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.CreateProductRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.CreateProductRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (!other.getProductId().isEmpty()) { + productId_ = other.productId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.CreateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.CreateProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The project in which the Product should be created.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 project in which the Product should be created.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 project in which the Product should be created.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The project in which the Product should be created.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The project in which the Product should be created.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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.vision.v1p3beta1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> productBuilder_; + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p3beta1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null ? com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public Builder setProduct(com.google.cloud.vision.v1p3beta1.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public Builder setProduct( + com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public Builder mergeProduct(com.google.cloud.vision.v1p3beta1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1p3beta1.Product.newBuilder(product_).mergeFrom(value).buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null ? + com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder>( + getProduct(), + getParentForChildren(), + isClean()); + product_ = null; + } + return productBuilder_; + } + + private java.lang.Object productId_ = ""; + /** + *
+     * A user-supplied resource id for this Product. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_id = 3; + */ + public java.lang.String getProductId() { + java.lang.Object ref = productId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A user-supplied resource id for this Product. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_id = 3; + */ + public com.google.protobuf.ByteString + getProductIdBytes() { + java.lang.Object ref = productId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A user-supplied resource id for this Product. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_id = 3; + */ + public Builder setProductId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productId_ = value; + onChanged(); + return this; + } + /** + *
+     * A user-supplied resource id for this Product. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_id = 3; + */ + public Builder clearProductId() { + + productId_ = getDefaultInstance().getProductId(); + onChanged(); + return this; + } + /** + *
+     * A user-supplied resource id for this Product. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_id = 3; + */ + public Builder setProductIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productId_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.CreateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CreateProductRequest) + private static final com.google.cloud.vision.v1p3beta1.CreateProductRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.CreateProductRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.CreateProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CreateProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateProductRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.CreateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductRequestOrBuilder.java new file mode 100644 index 000000000000..496421020e7f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductRequestOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface CreateProductRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.CreateProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The project in which the Product should be created.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The project in which the Product should be created.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + boolean hasProduct(); + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + com.google.cloud.vision.v1p3beta1.Product getProduct(); + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 2; + */ + com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder(); + + /** + *
+   * A user-supplied resource id for this Product. If set, the server will
+   * attempt to use this value as the resource id. If it is already in use, an
+   * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+   * long. It cannot contain the character `/`.
+   * 
+ * + * string product_id = 3; + */ + java.lang.String getProductId(); + /** + *
+   * A user-supplied resource id for this Product. If set, the server will
+   * attempt to use this value as the resource id. If it is already in use, an
+   * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+   * long. It cannot contain the character `/`.
+   * 
+ * + * string product_id = 3; + */ + com.google.protobuf.ByteString + getProductIdBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductSetRequest.java new file mode 100644 index 000000000000..2aa7f20454e3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductSetRequest.java @@ -0,0 +1,964 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `CreateProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CreateProductSetRequest} + */ +public final class CreateProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.CreateProductSetRequest) + CreateProductSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateProductSetRequest.newBuilder() to construct. + private CreateProductSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateProductSetRequest() { + parent_ = ""; + productSetId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateProductSetRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.ProductSet.Builder subBuilder = null; + if (productSet_ != null) { + subBuilder = productSet_.toBuilder(); + } + productSet_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ProductSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productSet_); + productSet_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + productSetId_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest.class, com.google.cloud.vision.v1p3beta1.CreateProductSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The project in which the ProductSet should be created.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * 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 project in which the ProductSet should be created.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * 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 PRODUCT_SET_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.ProductSet productSet_; + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public boolean hasProductSet() { + return productSet_ != null; + } + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet getProductSet() { + return productSet_ == null ? com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance() : productSet_; + } + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetOrBuilder() { + return getProductSet(); + } + + public static final int PRODUCT_SET_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object productSetId_; + /** + *
+   * A user-supplied resource id for this ProductSet. If set, the server will
+   * attempt to use this value as the resource id. If it is already in use, an
+   * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+   * long. It cannot contain the character `/`.
+   * 
+ * + * string product_set_id = 3; + */ + public java.lang.String getProductSetId() { + java.lang.Object ref = productSetId_; + 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(); + productSetId_ = s; + return s; + } + } + /** + *
+   * A user-supplied resource id for this ProductSet. If set, the server will
+   * attempt to use this value as the resource id. If it is already in use, an
+   * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+   * long. It cannot contain the character `/`.
+   * 
+ * + * string product_set_id = 3; + */ + public com.google.protobuf.ByteString + getProductSetIdBytes() { + java.lang.Object ref = productSetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productSetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (productSet_ != null) { + output.writeMessage(2, getProductSet()); + } + if (!getProductSetIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productSetId_); + } + unknownFields.writeTo(output); + } + + 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 (productSet_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getProductSet()); + } + if (!getProductSetIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, productSetId_); + } + 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.vision.v1p3beta1.CreateProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest other = (com.google.cloud.vision.v1p3beta1.CreateProductSetRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasProductSet() == other.hasProductSet()); + if (hasProductSet()) { + result = result && getProductSet() + .equals(other.getProductSet()); + } + result = result && getProductSetId() + .equals(other.getProductSetId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 (hasProductSet()) { + hash = (37 * hash) + PRODUCT_SET_FIELD_NUMBER; + hash = (53 * hash) + getProductSet().hashCode(); + } + hash = (37 * hash) + PRODUCT_SET_ID_FIELD_NUMBER; + hash = (53 * hash) + getProductSetId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest 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.vision.v1p3beta1.CreateProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest 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.vision.v1p3beta1.CreateProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest 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.vision.v1p3beta1.CreateProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest 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.vision.v1p3beta1.CreateProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.CreateProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `CreateProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CreateProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.CreateProductSetRequest) + com.google.cloud.vision.v1p3beta1.CreateProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest.class, com.google.cloud.vision.v1p3beta1.CreateProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.CreateProductSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (productSetBuilder_ == null) { + productSet_ = null; + } else { + productSet_ = null; + productSetBuilder_ = null; + } + productSetId_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.CreateProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.CreateProductSetRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.CreateProductSetRequest build() { + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.CreateProductSetRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest result = new com.google.cloud.vision.v1p3beta1.CreateProductSetRequest(this); + result.parent_ = parent_; + if (productSetBuilder_ == null) { + result.productSet_ = productSet_; + } else { + result.productSet_ = productSetBuilder_.build(); + } + result.productSetId_ = productSetId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.CreateProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.CreateProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.CreateProductSetRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.CreateProductSetRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasProductSet()) { + mergeProductSet(other.getProductSet()); + } + if (!other.getProductSetId().isEmpty()) { + productSetId_ = other.productSetId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.CreateProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.CreateProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The project in which the ProductSet should be created.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 project in which the ProductSet should be created.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 project in which the ProductSet should be created.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The project in which the ProductSet should be created.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The project in which the ProductSet should be created.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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.vision.v1p3beta1.ProductSet productSet_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder> productSetBuilder_; + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public boolean hasProductSet() { + return productSetBuilder_ != null || productSet_ != null; + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet getProductSet() { + if (productSetBuilder_ == null) { + return productSet_ == null ? com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance() : productSet_; + } else { + return productSetBuilder_.getMessage(); + } + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public Builder setProductSet(com.google.cloud.vision.v1p3beta1.ProductSet value) { + if (productSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productSet_ = value; + onChanged(); + } else { + productSetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public Builder setProductSet( + com.google.cloud.vision.v1p3beta1.ProductSet.Builder builderForValue) { + if (productSetBuilder_ == null) { + productSet_ = builderForValue.build(); + onChanged(); + } else { + productSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public Builder mergeProductSet(com.google.cloud.vision.v1p3beta1.ProductSet value) { + if (productSetBuilder_ == null) { + if (productSet_ != null) { + productSet_ = + com.google.cloud.vision.v1p3beta1.ProductSet.newBuilder(productSet_).mergeFrom(value).buildPartial(); + } else { + productSet_ = value; + } + onChanged(); + } else { + productSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public Builder clearProductSet() { + if (productSetBuilder_ == null) { + productSet_ = null; + onChanged(); + } else { + productSet_ = null; + productSetBuilder_ = null; + } + + return this; + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet.Builder getProductSetBuilder() { + + onChanged(); + return getProductSetFieldBuilder().getBuilder(); + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetOrBuilder() { + if (productSetBuilder_ != null) { + return productSetBuilder_.getMessageOrBuilder(); + } else { + return productSet_ == null ? + com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance() : productSet_; + } + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder> + getProductSetFieldBuilder() { + if (productSetBuilder_ == null) { + productSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder>( + getProductSet(), + getParentForChildren(), + isClean()); + productSet_ = null; + } + return productSetBuilder_; + } + + private java.lang.Object productSetId_ = ""; + /** + *
+     * A user-supplied resource id for this ProductSet. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_set_id = 3; + */ + public java.lang.String getProductSetId() { + java.lang.Object ref = productSetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productSetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A user-supplied resource id for this ProductSet. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_set_id = 3; + */ + public com.google.protobuf.ByteString + getProductSetIdBytes() { + java.lang.Object ref = productSetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productSetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A user-supplied resource id for this ProductSet. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_set_id = 3; + */ + public Builder setProductSetId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productSetId_ = value; + onChanged(); + return this; + } + /** + *
+     * A user-supplied resource id for this ProductSet. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_set_id = 3; + */ + public Builder clearProductSetId() { + + productSetId_ = getDefaultInstance().getProductSetId(); + onChanged(); + return this; + } + /** + *
+     * A user-supplied resource id for this ProductSet. If set, the server will
+     * attempt to use this value as the resource id. If it is already in use, an
+     * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+     * long. It cannot contain the character `/`.
+     * 
+ * + * string product_set_id = 3; + */ + public Builder setProductSetIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productSetId_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.CreateProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CreateProductSetRequest) + private static final com.google.cloud.vision.v1p3beta1.CreateProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.CreateProductSetRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.CreateProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CreateProductSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateProductSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.CreateProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..bdfd15126e9f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateProductSetRequestOrBuilder.java @@ -0,0 +1,78 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface CreateProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.CreateProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The project in which the ProductSet should be created.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The project in which the ProductSet should be created.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + boolean hasProductSet(); + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + com.google.cloud.vision.v1p3beta1.ProductSet getProductSet(); + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 2; + */ + com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetOrBuilder(); + + /** + *
+   * A user-supplied resource id for this ProductSet. If set, the server will
+   * attempt to use this value as the resource id. If it is already in use, an
+   * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+   * long. It cannot contain the character `/`.
+   * 
+ * + * string product_set_id = 3; + */ + java.lang.String getProductSetId(); + /** + *
+   * A user-supplied resource id for this ProductSet. If set, the server will
+   * attempt to use this value as the resource id. If it is already in use, an
+   * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
+   * long. It cannot contain the character `/`.
+   * 
+ * + * string product_set_id = 3; + */ + com.google.protobuf.ByteString + getProductSetIdBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateReferenceImageRequest.java new file mode 100644 index 000000000000..f7b5109857f2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateReferenceImageRequest.java @@ -0,0 +1,983 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `CreateReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CreateReferenceImageRequest} + */ +public final class CreateReferenceImageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) + CreateReferenceImageRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateReferenceImageRequest.newBuilder() to construct. + private CreateReferenceImageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateReferenceImageRequest() { + parent_ = ""; + referenceImageId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateReferenceImageRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder subBuilder = null; + if (referenceImage_ != null) { + subBuilder = referenceImage_.toBuilder(); + } + referenceImage_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ReferenceImage.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(referenceImage_); + referenceImage_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + referenceImageId_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.class, com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Resource name of the product in which to create the reference image.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * 
+ * + * 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 product in which to create the reference image.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * 
+ * + * 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 REFERENCE_IMAGE_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.ReferenceImage referenceImage_; + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public boolean hasReferenceImage() { + return referenceImage_ != null; + } + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImage() { + return referenceImage_ == null ? com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance() : referenceImage_; + } + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImageOrBuilder() { + return getReferenceImage(); + } + + public static final int REFERENCE_IMAGE_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object referenceImageId_; + /** + *
+   * A user-supplied resource id for the ReferenceImage to be added. If set,
+   * the server will attempt to use this value as the resource id. If it is
+   * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+   * most 128 characters long. It cannot contain the character `/`.
+   * 
+ * + * string reference_image_id = 3; + */ + public java.lang.String getReferenceImageId() { + java.lang.Object ref = referenceImageId_; + 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(); + referenceImageId_ = s; + return s; + } + } + /** + *
+   * A user-supplied resource id for the ReferenceImage to be added. If set,
+   * the server will attempt to use this value as the resource id. If it is
+   * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+   * most 128 characters long. It cannot contain the character `/`.
+   * 
+ * + * string reference_image_id = 3; + */ + public com.google.protobuf.ByteString + getReferenceImageIdBytes() { + java.lang.Object ref = referenceImageId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + referenceImageId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (referenceImage_ != null) { + output.writeMessage(2, getReferenceImage()); + } + if (!getReferenceImageIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, referenceImageId_); + } + unknownFields.writeTo(output); + } + + 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 (referenceImage_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getReferenceImage()); + } + if (!getReferenceImageIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, referenceImageId_); + } + 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.vision.v1p3beta1.CreateReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest other = (com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasReferenceImage() == other.hasReferenceImage()); + if (hasReferenceImage()) { + result = result && getReferenceImage() + .equals(other.getReferenceImage()); + } + result = result && getReferenceImageId() + .equals(other.getReferenceImageId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 (hasReferenceImage()) { + hash = (37 * hash) + REFERENCE_IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getReferenceImage().hashCode(); + } + hash = (37 * hash) + REFERENCE_IMAGE_ID_FIELD_NUMBER; + hash = (53 * hash) + getReferenceImageId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest 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.vision.v1p3beta1.CreateReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest 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.vision.v1p3beta1.CreateReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest 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.vision.v1p3beta1.CreateReferenceImageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest 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.vision.v1p3beta1.CreateReferenceImageRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `CreateReferenceImage` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CreateReferenceImageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.class, com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (referenceImageBuilder_ == null) { + referenceImage_ = null; + } else { + referenceImage_ = null; + referenceImageBuilder_ = null; + } + referenceImageId_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest build() { + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest result = new com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest(this); + result.parent_ = parent_; + if (referenceImageBuilder_ == null) { + result.referenceImage_ = referenceImage_; + } else { + result.referenceImage_ = referenceImageBuilder_.build(); + } + result.referenceImageId_ = referenceImageId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasReferenceImage()) { + mergeReferenceImage(other.getReferenceImage()); + } + if (!other.getReferenceImageId().isEmpty()) { + referenceImageId_ = other.referenceImageId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Resource name of the product in which to create the reference image.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * 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 product in which to create the reference image.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * 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 product in which to create the reference image.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * 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 product in which to create the reference image.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the product in which to create the reference image.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * 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.vision.v1p3beta1.ReferenceImage referenceImage_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder> referenceImageBuilder_; + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public boolean hasReferenceImage() { + return referenceImageBuilder_ != null || referenceImage_ != null; + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImage() { + if (referenceImageBuilder_ == null) { + return referenceImage_ == null ? com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance() : referenceImage_; + } else { + return referenceImageBuilder_.getMessage(); + } + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public Builder setReferenceImage(com.google.cloud.vision.v1p3beta1.ReferenceImage value) { + if (referenceImageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + referenceImage_ = value; + onChanged(); + } else { + referenceImageBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public Builder setReferenceImage( + com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder builderForValue) { + if (referenceImageBuilder_ == null) { + referenceImage_ = builderForValue.build(); + onChanged(); + } else { + referenceImageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public Builder mergeReferenceImage(com.google.cloud.vision.v1p3beta1.ReferenceImage value) { + if (referenceImageBuilder_ == null) { + if (referenceImage_ != null) { + referenceImage_ = + com.google.cloud.vision.v1p3beta1.ReferenceImage.newBuilder(referenceImage_).mergeFrom(value).buildPartial(); + } else { + referenceImage_ = value; + } + onChanged(); + } else { + referenceImageBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public Builder clearReferenceImage() { + if (referenceImageBuilder_ == null) { + referenceImage_ = null; + onChanged(); + } else { + referenceImage_ = null; + referenceImageBuilder_ = null; + } + + return this; + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder getReferenceImageBuilder() { + + onChanged(); + return getReferenceImageFieldBuilder().getBuilder(); + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImageOrBuilder() { + if (referenceImageBuilder_ != null) { + return referenceImageBuilder_.getMessageOrBuilder(); + } else { + return referenceImage_ == null ? + com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance() : referenceImage_; + } + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder> + getReferenceImageFieldBuilder() { + if (referenceImageBuilder_ == null) { + referenceImageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder>( + getReferenceImage(), + getParentForChildren(), + isClean()); + referenceImage_ = null; + } + return referenceImageBuilder_; + } + + private java.lang.Object referenceImageId_ = ""; + /** + *
+     * A user-supplied resource id for the ReferenceImage to be added. If set,
+     * the server will attempt to use this value as the resource id. If it is
+     * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+     * most 128 characters long. It cannot contain the character `/`.
+     * 
+ * + * string reference_image_id = 3; + */ + public java.lang.String getReferenceImageId() { + java.lang.Object ref = referenceImageId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referenceImageId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A user-supplied resource id for the ReferenceImage to be added. If set,
+     * the server will attempt to use this value as the resource id. If it is
+     * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+     * most 128 characters long. It cannot contain the character `/`.
+     * 
+ * + * string reference_image_id = 3; + */ + public com.google.protobuf.ByteString + getReferenceImageIdBytes() { + java.lang.Object ref = referenceImageId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + referenceImageId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A user-supplied resource id for the ReferenceImage to be added. If set,
+     * the server will attempt to use this value as the resource id. If it is
+     * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+     * most 128 characters long. It cannot contain the character `/`.
+     * 
+ * + * string reference_image_id = 3; + */ + public Builder setReferenceImageId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referenceImageId_ = value; + onChanged(); + return this; + } + /** + *
+     * A user-supplied resource id for the ReferenceImage to be added. If set,
+     * the server will attempt to use this value as the resource id. If it is
+     * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+     * most 128 characters long. It cannot contain the character `/`.
+     * 
+ * + * string reference_image_id = 3; + */ + public Builder clearReferenceImageId() { + + referenceImageId_ = getDefaultInstance().getReferenceImageId(); + onChanged(); + return this; + } + /** + *
+     * A user-supplied resource id for the ReferenceImage to be added. If set,
+     * the server will attempt to use this value as the resource id. If it is
+     * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+     * most 128 characters long. It cannot contain the character `/`.
+     * 
+ * + * string reference_image_id = 3; + */ + public Builder setReferenceImageIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referenceImageId_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) + private static final com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CreateReferenceImageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateReferenceImageRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..42de2b343f05 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CreateReferenceImageRequestOrBuilder.java @@ -0,0 +1,83 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface CreateReferenceImageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the product in which to create the reference image.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Resource name of the product in which to create the reference image.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + boolean hasReferenceImage(); + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImage(); + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ReferenceImage reference_image = 2; + */ + com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImageOrBuilder(); + + /** + *
+   * A user-supplied resource id for the ReferenceImage to be added. If set,
+   * the server will attempt to use this value as the resource id. If it is
+   * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+   * most 128 characters long. It cannot contain the character `/`.
+   * 
+ * + * string reference_image_id = 3; + */ + java.lang.String getReferenceImageId(); + /** + *
+   * A user-supplied resource id for the ReferenceImage to be added. If set,
+   * the server will attempt to use this value as the resource id. If it is
+   * already in use, an error is returned with code ALREADY_EXISTS. Must be at
+   * most 128 characters long. It cannot contain the character `/`.
+   * 
+ * + * string reference_image_id = 3; + */ + com.google.protobuf.ByteString + getReferenceImageIdBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHint.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHint.java new file mode 100644 index 000000000000..c0d2e0bd356e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHint.java @@ -0,0 +1,796 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Single crop hint that is used to generate a new crop when serving an image.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CropHint} + */ +public final class CropHint extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.CropHint) + CropHintOrBuilder { +private static final long serialVersionUID = 0L; + // Use CropHint.newBuilder() to construct. + private CropHint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CropHint() { + confidence_ = 0F; + importanceFraction_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CropHint( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + confidence_ = input.readFloat(); + break; + } + case 29: { + + importanceFraction_ = input.readFloat(); + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHint_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CropHint.class, com.google.cloud.vision.v1p3beta1.CropHint.Builder.class); + } + + public static final int BOUNDING_POLY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_; + /** + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale, as returned in `ImageParams`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale, as returned in `ImageParams`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + /** + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale, as returned in `ImageParams`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 2; + private float confidence_; + /** + *
+   * Confidence of this being a salient region.  Range [0, 1].
+   * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + + public static final int IMPORTANCE_FRACTION_FIELD_NUMBER = 3; + private float importanceFraction_; + /** + *
+   * Fraction of importance of this salient region with respect to the original
+   * image.
+   * 
+ * + * float importance_fraction = 3; + */ + public float getImportanceFraction() { + return importanceFraction_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (boundingPoly_ != null) { + output.writeMessage(1, getBoundingPoly()); + } + if (confidence_ != 0F) { + output.writeFloat(2, confidence_); + } + if (importanceFraction_ != 0F) { + output.writeFloat(3, importanceFraction_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (boundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getBoundingPoly()); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, confidence_); + } + if (importanceFraction_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, importanceFraction_); + } + 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.vision.v1p3beta1.CropHint)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.CropHint other = (com.google.cloud.vision.v1p3beta1.CropHint) obj; + + boolean result = true; + result = result && (hasBoundingPoly() == other.hasBoundingPoly()); + if (hasBoundingPoly()) { + result = result && getBoundingPoly() + .equals(other.getBoundingPoly()); + } + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && ( + java.lang.Float.floatToIntBits(getImportanceFraction()) + == java.lang.Float.floatToIntBits( + other.getImportanceFraction())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (37 * hash) + IMPORTANCE_FRACTION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getImportanceFraction()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.CropHint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHint 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.vision.v1p3beta1.CropHint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHint 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.vision.v1p3beta1.CropHint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.CropHint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHint 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.vision.v1p3beta1.CropHint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHint 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.vision.v1p3beta1.CropHint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.CropHint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Single crop hint that is used to generate a new crop when serving an image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CropHint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.CropHint) + com.google.cloud.vision.v1p3beta1.CropHintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHint_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CropHint.class, com.google.cloud.vision.v1p3beta1.CropHint.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.CropHint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + confidence_ = 0F; + + importanceFraction_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHint_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.CropHint getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.CropHint.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.CropHint build() { + com.google.cloud.vision.v1p3beta1.CropHint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.CropHint buildPartial() { + com.google.cloud.vision.v1p3beta1.CropHint result = new com.google.cloud.vision.v1p3beta1.CropHint(this); + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + result.confidence_ = confidence_; + result.importanceFraction_ = importanceFraction_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.CropHint) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.CropHint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.CropHint other) { + if (other == com.google.cloud.vision.v1p3beta1.CropHint.getDefaultInstance()) return this; + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (other.getImportanceFraction() != 0F) { + setImportanceFraction(other.getImportanceFraction()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.CropHint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.CropHint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingPolyBuilder_; + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public boolean hasBoundingPoly() { + return boundingPolyBuilder_ != null || boundingPoly_ != null; + } + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingPoly_ = value; + onChanged(); + } else { + boundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = builderForValue.build(); + onChanged(); + } else { + boundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingPoly_).mergeFrom(value).buildPartial(); + } else { + boundingPoly_ = value; + } + onChanged(); + } else { + boundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public Builder clearBoundingPoly() { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + onChanged(); + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + + return this; + } + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + } + /** + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale, as returned in `ImageParams`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), + getParentForChildren(), + isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private float confidence_ ; + /** + *
+     * Confidence of this being a salient region.  Range [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence of this being a salient region.  Range [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence of this being a salient region.  Range [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private float importanceFraction_ ; + /** + *
+     * Fraction of importance of this salient region with respect to the original
+     * image.
+     * 
+ * + * float importance_fraction = 3; + */ + public float getImportanceFraction() { + return importanceFraction_; + } + /** + *
+     * Fraction of importance of this salient region with respect to the original
+     * image.
+     * 
+ * + * float importance_fraction = 3; + */ + public Builder setImportanceFraction(float value) { + + importanceFraction_ = value; + onChanged(); + return this; + } + /** + *
+     * Fraction of importance of this salient region with respect to the original
+     * image.
+     * 
+ * + * float importance_fraction = 3; + */ + public Builder clearImportanceFraction() { + + importanceFraction_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.CropHint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CropHint) + private static final com.google.cloud.vision.v1p3beta1.CropHint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.CropHint(); + } + + public static com.google.cloud.vision.v1p3beta1.CropHint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CropHint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CropHint(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.CropHint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintOrBuilder.java new file mode 100644 index 000000000000..df2329b56302 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface CropHintOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.CropHint) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale, as returned in `ImageParams`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + boolean hasBoundingPoly(); + /** + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale, as returned in `ImageParams`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly(); + /** + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale, as returned in `ImageParams`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + *
+   * Confidence of this being a salient region.  Range [0, 1].
+   * 
+ * + * float confidence = 2; + */ + float getConfidence(); + + /** + *
+   * Fraction of importance of this salient region with respect to the original
+   * image.
+   * 
+ * + * float importance_fraction = 3; + */ + float getImportanceFraction(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsAnnotation.java new file mode 100644 index 000000000000..c96e37fd284a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsAnnotation.java @@ -0,0 +1,834 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Set of crop hints that are used to generate new crops when serving images.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CropHintsAnnotation} + */ +public final class CropHintsAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.CropHintsAnnotation) + CropHintsAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use CropHintsAnnotation.newBuilder() to construct. + private CropHintsAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CropHintsAnnotation() { + cropHints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CropHintsAnnotation( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + cropHints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + cropHints_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.CropHint.parser(), extensionRegistry)); + 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) == 0x00000001)) { + cropHints_ = java.util.Collections.unmodifiableList(cropHints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.class, com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.Builder.class); + } + + public static final int CROP_HINTS_FIELD_NUMBER = 1; + private java.util.List cropHints_; + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public java.util.List getCropHintsList() { + return cropHints_; + } + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public java.util.List + getCropHintsOrBuilderList() { + return cropHints_; + } + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public int getCropHintsCount() { + return cropHints_.size(); + } + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p3beta1.CropHint getCropHints(int index) { + return cropHints_.get(index); + } + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p3beta1.CropHintOrBuilder getCropHintsOrBuilder( + int index) { + return cropHints_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < cropHints_.size(); i++) { + output.writeMessage(1, cropHints_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < cropHints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, cropHints_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.CropHintsAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation other = (com.google.cloud.vision.v1p3beta1.CropHintsAnnotation) obj; + + boolean result = true; + result = result && getCropHintsList() + .equals(other.getCropHintsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCropHintsCount() > 0) { + hash = (37 * hash) + CROP_HINTS_FIELD_NUMBER; + hash = (53 * hash) + getCropHintsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation 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.vision.v1p3beta1.CropHintsAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation 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.vision.v1p3beta1.CropHintsAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation 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.vision.v1p3beta1.CropHintsAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation 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.vision.v1p3beta1.CropHintsAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.CropHintsAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Set of crop hints that are used to generate new crops when serving images.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CropHintsAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.CropHintsAnnotation) + com.google.cloud.vision.v1p3beta1.CropHintsAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.class, com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getCropHintsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (cropHintsBuilder_ == null) { + cropHints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + cropHintsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotation build() { + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotation buildPartial() { + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation result = new com.google.cloud.vision.v1p3beta1.CropHintsAnnotation(this); + int from_bitField0_ = bitField0_; + if (cropHintsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + cropHints_ = java.util.Collections.unmodifiableList(cropHints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.cropHints_ = cropHints_; + } else { + result.cropHints_ = cropHintsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.CropHintsAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.CropHintsAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.CropHintsAnnotation other) { + if (other == com.google.cloud.vision.v1p3beta1.CropHintsAnnotation.getDefaultInstance()) return this; + if (cropHintsBuilder_ == null) { + if (!other.cropHints_.isEmpty()) { + if (cropHints_.isEmpty()) { + cropHints_ = other.cropHints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCropHintsIsMutable(); + cropHints_.addAll(other.cropHints_); + } + onChanged(); + } + } else { + if (!other.cropHints_.isEmpty()) { + if (cropHintsBuilder_.isEmpty()) { + cropHintsBuilder_.dispose(); + cropHintsBuilder_ = null; + cropHints_ = other.cropHints_; + bitField0_ = (bitField0_ & ~0x00000001); + cropHintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCropHintsFieldBuilder() : null; + } else { + cropHintsBuilder_.addAllMessages(other.cropHints_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.CropHintsAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.CropHintsAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List cropHints_ = + java.util.Collections.emptyList(); + private void ensureCropHintsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + cropHints_ = new java.util.ArrayList(cropHints_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHint, com.google.cloud.vision.v1p3beta1.CropHint.Builder, com.google.cloud.vision.v1p3beta1.CropHintOrBuilder> cropHintsBuilder_; + + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public java.util.List getCropHintsList() { + if (cropHintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(cropHints_); + } else { + return cropHintsBuilder_.getMessageList(); + } + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public int getCropHintsCount() { + if (cropHintsBuilder_ == null) { + return cropHints_.size(); + } else { + return cropHintsBuilder_.getCount(); + } + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p3beta1.CropHint getCropHints(int index) { + if (cropHintsBuilder_ == null) { + return cropHints_.get(index); + } else { + return cropHintsBuilder_.getMessage(index); + } + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder setCropHints( + int index, com.google.cloud.vision.v1p3beta1.CropHint value) { + if (cropHintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCropHintsIsMutable(); + cropHints_.set(index, value); + onChanged(); + } else { + cropHintsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder setCropHints( + int index, com.google.cloud.vision.v1p3beta1.CropHint.Builder builderForValue) { + if (cropHintsBuilder_ == null) { + ensureCropHintsIsMutable(); + cropHints_.set(index, builderForValue.build()); + onChanged(); + } else { + cropHintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder addCropHints(com.google.cloud.vision.v1p3beta1.CropHint value) { + if (cropHintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCropHintsIsMutable(); + cropHints_.add(value); + onChanged(); + } else { + cropHintsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder addCropHints( + int index, com.google.cloud.vision.v1p3beta1.CropHint value) { + if (cropHintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCropHintsIsMutable(); + cropHints_.add(index, value); + onChanged(); + } else { + cropHintsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder addCropHints( + com.google.cloud.vision.v1p3beta1.CropHint.Builder builderForValue) { + if (cropHintsBuilder_ == null) { + ensureCropHintsIsMutable(); + cropHints_.add(builderForValue.build()); + onChanged(); + } else { + cropHintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder addCropHints( + int index, com.google.cloud.vision.v1p3beta1.CropHint.Builder builderForValue) { + if (cropHintsBuilder_ == null) { + ensureCropHintsIsMutable(); + cropHints_.add(index, builderForValue.build()); + onChanged(); + } else { + cropHintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder addAllCropHints( + java.lang.Iterable values) { + if (cropHintsBuilder_ == null) { + ensureCropHintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, cropHints_); + onChanged(); + } else { + cropHintsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder clearCropHints() { + if (cropHintsBuilder_ == null) { + cropHints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + cropHintsBuilder_.clear(); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public Builder removeCropHints(int index) { + if (cropHintsBuilder_ == null) { + ensureCropHintsIsMutable(); + cropHints_.remove(index); + onChanged(); + } else { + cropHintsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p3beta1.CropHint.Builder getCropHintsBuilder( + int index) { + return getCropHintsFieldBuilder().getBuilder(index); + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p3beta1.CropHintOrBuilder getCropHintsOrBuilder( + int index) { + if (cropHintsBuilder_ == null) { + return cropHints_.get(index); } else { + return cropHintsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public java.util.List + getCropHintsOrBuilderList() { + if (cropHintsBuilder_ != null) { + return cropHintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cropHints_); + } + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p3beta1.CropHint.Builder addCropHintsBuilder() { + return getCropHintsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.CropHint.getDefaultInstance()); + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p3beta1.CropHint.Builder addCropHintsBuilder( + int index) { + return getCropHintsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.CropHint.getDefaultInstance()); + } + /** + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + public java.util.List + getCropHintsBuilderList() { + return getCropHintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHint, com.google.cloud.vision.v1p3beta1.CropHint.Builder, com.google.cloud.vision.v1p3beta1.CropHintOrBuilder> + getCropHintsFieldBuilder() { + if (cropHintsBuilder_ == null) { + cropHintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHint, com.google.cloud.vision.v1p3beta1.CropHint.Builder, com.google.cloud.vision.v1p3beta1.CropHintOrBuilder>( + cropHints_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + cropHints_ = null; + } + return cropHintsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.CropHintsAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CropHintsAnnotation) + private static final com.google.cloud.vision.v1p3beta1.CropHintsAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.CropHintsAnnotation(); + } + + public static com.google.cloud.vision.v1p3beta1.CropHintsAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CropHintsAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CropHintsAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.CropHintsAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsAnnotationOrBuilder.java new file mode 100644 index 000000000000..9192acbf2006 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsAnnotationOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface CropHintsAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.CropHintsAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + java.util.List + getCropHintsList(); + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + com.google.cloud.vision.v1p3beta1.CropHint getCropHints(int index); + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + int getCropHintsCount(); + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + java.util.List + getCropHintsOrBuilderList(); + /** + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.CropHint crop_hints = 1; + */ + com.google.cloud.vision.v1p3beta1.CropHintOrBuilder getCropHintsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsParams.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsParams.java new file mode 100644 index 000000000000..47c579942e16 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsParams.java @@ -0,0 +1,645 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Parameters for crop hints annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CropHintsParams} + */ +public final class CropHintsParams extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.CropHintsParams) + CropHintsParamsOrBuilder { +private static final long serialVersionUID = 0L; + // Use CropHintsParams.newBuilder() to construct. + private CropHintsParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CropHintsParams() { + aspectRatios_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CropHintsParams( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 13: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + aspectRatios_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + aspectRatios_.add(input.readFloat()); + break; + } + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) { + aspectRatios_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + aspectRatios_.add(input.readFloat()); + } + input.popLimit(limit); + 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) == 0x00000001)) { + aspectRatios_ = java.util.Collections.unmodifiableList(aspectRatios_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CropHintsParams.class, com.google.cloud.vision.v1p3beta1.CropHintsParams.Builder.class); + } + + public static final int ASPECT_RATIOS_FIELD_NUMBER = 1; + private java.util.List aspectRatios_; + /** + *
+   * Aspect ratios in floats, representing the ratio of the width to the height
+   * of the image. For example, if the desired aspect ratio is 4/3, the
+   * corresponding float value should be 1.33333.  If not specified, the
+   * best possible crop is returned. The number of provided aspect ratios is
+   * limited to a maximum of 16; any aspect ratios provided after the 16th are
+   * ignored.
+   * 
+ * + * repeated float aspect_ratios = 1; + */ + public java.util.List + getAspectRatiosList() { + return aspectRatios_; + } + /** + *
+   * Aspect ratios in floats, representing the ratio of the width to the height
+   * of the image. For example, if the desired aspect ratio is 4/3, the
+   * corresponding float value should be 1.33333.  If not specified, the
+   * best possible crop is returned. The number of provided aspect ratios is
+   * limited to a maximum of 16; any aspect ratios provided after the 16th are
+   * ignored.
+   * 
+ * + * repeated float aspect_ratios = 1; + */ + public int getAspectRatiosCount() { + return aspectRatios_.size(); + } + /** + *
+   * Aspect ratios in floats, representing the ratio of the width to the height
+   * of the image. For example, if the desired aspect ratio is 4/3, the
+   * corresponding float value should be 1.33333.  If not specified, the
+   * best possible crop is returned. The number of provided aspect ratios is
+   * limited to a maximum of 16; any aspect ratios provided after the 16th are
+   * ignored.
+   * 
+ * + * repeated float aspect_ratios = 1; + */ + public float getAspectRatios(int index) { + return aspectRatios_.get(index); + } + private int aspectRatiosMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getAspectRatiosList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(aspectRatiosMemoizedSerializedSize); + } + for (int i = 0; i < aspectRatios_.size(); i++) { + output.writeFloatNoTag(aspectRatios_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * getAspectRatiosList().size(); + size += dataSize; + if (!getAspectRatiosList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + aspectRatiosMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.CropHintsParams)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.CropHintsParams other = (com.google.cloud.vision.v1p3beta1.CropHintsParams) obj; + + boolean result = true; + result = result && getAspectRatiosList() + .equals(other.getAspectRatiosList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAspectRatiosCount() > 0) { + hash = (37 * hash) + ASPECT_RATIOS_FIELD_NUMBER; + hash = (53 * hash) + getAspectRatiosList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.CropHintsParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsParams 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.vision.v1p3beta1.CropHintsParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsParams 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.vision.v1p3beta1.CropHintsParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsParams parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsParams 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.vision.v1p3beta1.CropHintsParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsParams 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.vision.v1p3beta1.CropHintsParams parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.CropHintsParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.CropHintsParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.CropHintsParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.CropHintsParams) + com.google.cloud.vision.v1p3beta1.CropHintsParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.CropHintsParams.class, com.google.cloud.vision.v1p3beta1.CropHintsParams.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.CropHintsParams.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + aspectRatios_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.CropHintsParams getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.CropHintsParams.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.CropHintsParams build() { + com.google.cloud.vision.v1p3beta1.CropHintsParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.CropHintsParams buildPartial() { + com.google.cloud.vision.v1p3beta1.CropHintsParams result = new com.google.cloud.vision.v1p3beta1.CropHintsParams(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + aspectRatios_ = java.util.Collections.unmodifiableList(aspectRatios_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.aspectRatios_ = aspectRatios_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.CropHintsParams) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.CropHintsParams)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.CropHintsParams other) { + if (other == com.google.cloud.vision.v1p3beta1.CropHintsParams.getDefaultInstance()) return this; + if (!other.aspectRatios_.isEmpty()) { + if (aspectRatios_.isEmpty()) { + aspectRatios_ = other.aspectRatios_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAspectRatiosIsMutable(); + aspectRatios_.addAll(other.aspectRatios_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.CropHintsParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.CropHintsParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List aspectRatios_ = java.util.Collections.emptyList(); + private void ensureAspectRatiosIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + aspectRatios_ = new java.util.ArrayList(aspectRatios_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * Aspect ratios in floats, representing the ratio of the width to the height
+     * of the image. For example, if the desired aspect ratio is 4/3, the
+     * corresponding float value should be 1.33333.  If not specified, the
+     * best possible crop is returned. The number of provided aspect ratios is
+     * limited to a maximum of 16; any aspect ratios provided after the 16th are
+     * ignored.
+     * 
+ * + * repeated float aspect_ratios = 1; + */ + public java.util.List + getAspectRatiosList() { + return java.util.Collections.unmodifiableList(aspectRatios_); + } + /** + *
+     * Aspect ratios in floats, representing the ratio of the width to the height
+     * of the image. For example, if the desired aspect ratio is 4/3, the
+     * corresponding float value should be 1.33333.  If not specified, the
+     * best possible crop is returned. The number of provided aspect ratios is
+     * limited to a maximum of 16; any aspect ratios provided after the 16th are
+     * ignored.
+     * 
+ * + * repeated float aspect_ratios = 1; + */ + public int getAspectRatiosCount() { + return aspectRatios_.size(); + } + /** + *
+     * Aspect ratios in floats, representing the ratio of the width to the height
+     * of the image. For example, if the desired aspect ratio is 4/3, the
+     * corresponding float value should be 1.33333.  If not specified, the
+     * best possible crop is returned. The number of provided aspect ratios is
+     * limited to a maximum of 16; any aspect ratios provided after the 16th are
+     * ignored.
+     * 
+ * + * repeated float aspect_ratios = 1; + */ + public float getAspectRatios(int index) { + return aspectRatios_.get(index); + } + /** + *
+     * Aspect ratios in floats, representing the ratio of the width to the height
+     * of the image. For example, if the desired aspect ratio is 4/3, the
+     * corresponding float value should be 1.33333.  If not specified, the
+     * best possible crop is returned. The number of provided aspect ratios is
+     * limited to a maximum of 16; any aspect ratios provided after the 16th are
+     * ignored.
+     * 
+ * + * repeated float aspect_ratios = 1; + */ + public Builder setAspectRatios( + int index, float value) { + ensureAspectRatiosIsMutable(); + aspectRatios_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Aspect ratios in floats, representing the ratio of the width to the height
+     * of the image. For example, if the desired aspect ratio is 4/3, the
+     * corresponding float value should be 1.33333.  If not specified, the
+     * best possible crop is returned. The number of provided aspect ratios is
+     * limited to a maximum of 16; any aspect ratios provided after the 16th are
+     * ignored.
+     * 
+ * + * repeated float aspect_ratios = 1; + */ + public Builder addAspectRatios(float value) { + ensureAspectRatiosIsMutable(); + aspectRatios_.add(value); + onChanged(); + return this; + } + /** + *
+     * Aspect ratios in floats, representing the ratio of the width to the height
+     * of the image. For example, if the desired aspect ratio is 4/3, the
+     * corresponding float value should be 1.33333.  If not specified, the
+     * best possible crop is returned. The number of provided aspect ratios is
+     * limited to a maximum of 16; any aspect ratios provided after the 16th are
+     * ignored.
+     * 
+ * + * repeated float aspect_ratios = 1; + */ + public Builder addAllAspectRatios( + java.lang.Iterable values) { + ensureAspectRatiosIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, aspectRatios_); + onChanged(); + return this; + } + /** + *
+     * Aspect ratios in floats, representing the ratio of the width to the height
+     * of the image. For example, if the desired aspect ratio is 4/3, the
+     * corresponding float value should be 1.33333.  If not specified, the
+     * best possible crop is returned. The number of provided aspect ratios is
+     * limited to a maximum of 16; any aspect ratios provided after the 16th are
+     * ignored.
+     * 
+ * + * repeated float aspect_ratios = 1; + */ + public Builder clearAspectRatios() { + aspectRatios_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.CropHintsParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CropHintsParams) + private static final com.google.cloud.vision.v1p3beta1.CropHintsParams DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.CropHintsParams(); + } + + public static com.google.cloud.vision.v1p3beta1.CropHintsParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CropHintsParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CropHintsParams(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.CropHintsParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsParamsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsParamsOrBuilder.java new file mode 100644 index 000000000000..4289b15a663d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/CropHintsParamsOrBuilder.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface CropHintsParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.CropHintsParams) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Aspect ratios in floats, representing the ratio of the width to the height
+   * of the image. For example, if the desired aspect ratio is 4/3, the
+   * corresponding float value should be 1.33333.  If not specified, the
+   * best possible crop is returned. The number of provided aspect ratios is
+   * limited to a maximum of 16; any aspect ratios provided after the 16th are
+   * ignored.
+   * 
+ * + * repeated float aspect_ratios = 1; + */ + java.util.List getAspectRatiosList(); + /** + *
+   * Aspect ratios in floats, representing the ratio of the width to the height
+   * of the image. For example, if the desired aspect ratio is 4/3, the
+   * corresponding float value should be 1.33333.  If not specified, the
+   * best possible crop is returned. The number of provided aspect ratios is
+   * limited to a maximum of 16; any aspect ratios provided after the 16th are
+   * ignored.
+   * 
+ * + * repeated float aspect_ratios = 1; + */ + int getAspectRatiosCount(); + /** + *
+   * Aspect ratios in floats, representing the ratio of the width to the height
+   * of the image. For example, if the desired aspect ratio is 4/3, the
+   * corresponding float value should be 1.33333.  If not specified, the
+   * best possible crop is returned. The number of provided aspect ratios is
+   * limited to a maximum of 16; any aspect ratios provided after the 16th are
+   * ignored.
+   * 
+ * + * repeated float aspect_ratios = 1; + */ + float getAspectRatios(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductRequest.java new file mode 100644 index 000000000000..51313ca68e2f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductRequest.java @@ -0,0 +1,566 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `DeleteProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.DeleteProductRequest} + */ +public final class DeleteProductRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.DeleteProductRequest) + DeleteProductRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteProductRequest.newBuilder() to construct. + private DeleteProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteProductRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteProductRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.DeleteProductRequest.class, com.google.cloud.vision.v1p3beta1.DeleteProductRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of product to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + } + /** + *
+   * Resource name of product to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.vision.v1p3beta1.DeleteProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.DeleteProductRequest other = (com.google.cloud.vision.v1p3beta1.DeleteProductRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.vision.v1p3beta1.DeleteProductRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductRequest 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.vision.v1p3beta1.DeleteProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductRequest 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.vision.v1p3beta1.DeleteProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductRequest 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.vision.v1p3beta1.DeleteProductRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductRequest 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.vision.v1p3beta1.DeleteProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.DeleteProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `DeleteProduct` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.DeleteProductRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.DeleteProductRequest) + com.google.cloud.vision.v1p3beta1.DeleteProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.DeleteProductRequest.class, com.google.cloud.vision.v1p3beta1.DeleteProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.DeleteProductRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.DeleteProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.DeleteProductRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.DeleteProductRequest build() { + com.google.cloud.vision.v1p3beta1.DeleteProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.DeleteProductRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.DeleteProductRequest result = new com.google.cloud.vision.v1p3beta1.DeleteProductRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.DeleteProductRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.DeleteProductRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.DeleteProductRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.DeleteProductRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.DeleteProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.DeleteProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of product to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + } + /** + *
+     * Resource name of product to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + } + /** + *
+     * Resource name of product to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Resource name of product to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of product to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.DeleteProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.DeleteProductRequest) + private static final com.google.cloud.vision.v1p3beta1.DeleteProductRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.DeleteProductRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.DeleteProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProductRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.DeleteProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductRequestOrBuilder.java new file mode 100644 index 000000000000..5838fc6cffe9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface DeleteProductRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.DeleteProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of product to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of product to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductSetRequest.java new file mode 100644 index 000000000000..9b564de9f6c3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductSetRequest.java @@ -0,0 +1,566 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `DeleteProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.DeleteProductSetRequest} + */ +public final class DeleteProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.DeleteProductSetRequest) + DeleteProductSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteProductSetRequest.newBuilder() to construct. + private DeleteProductSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteProductSetRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteProductSetRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest.class, com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of the ProductSet to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+   * Resource name of the ProductSet to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.vision.v1p3beta1.DeleteProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest other = (com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.vision.v1p3beta1.DeleteProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest 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.vision.v1p3beta1.DeleteProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest 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.vision.v1p3beta1.DeleteProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest 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.vision.v1p3beta1.DeleteProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest 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.vision.v1p3beta1.DeleteProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `DeleteProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.DeleteProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.DeleteProductSetRequest) + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest.class, com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest build() { + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest result = new com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of the ProductSet to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * Resource name of the ProductSet to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * Resource name of the ProductSet to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * 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 ProductSet to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the ProductSet to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.DeleteProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.DeleteProductSetRequest) + private static final com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteProductSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProductSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..3bdde2989304 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteProductSetRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface DeleteProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.DeleteProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the ProductSet to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of the ProductSet to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteReferenceImageRequest.java new file mode 100644 index 000000000000..aa26ff4f4a8c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteReferenceImageRequest.java @@ -0,0 +1,566 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `DeleteReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest} + */ +public final class DeleteReferenceImageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) + DeleteReferenceImageRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteReferenceImageRequest.newBuilder() to construct. + private DeleteReferenceImageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteReferenceImageRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteReferenceImageRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.class, com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the reference image to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + } + /** + *
+   * The resource name of the reference image to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.vision.v1p3beta1.DeleteReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest other = (com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.vision.v1p3beta1.DeleteReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest 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.vision.v1p3beta1.DeleteReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest 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.vision.v1p3beta1.DeleteReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest 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.vision.v1p3beta1.DeleteReferenceImageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest 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.vision.v1p3beta1.DeleteReferenceImageRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `DeleteReferenceImage` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.class, com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest build() { + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest result = new com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the reference image to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + } + /** + *
+     * The resource name of the reference image to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + } + /** + *
+     * The resource name of the reference image to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
+     * 
+ * + * 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 reference image to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the reference image to delete.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) + private static final com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteReferenceImageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteReferenceImageRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..e2c0b5fbb143 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DeleteReferenceImageRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface DeleteReferenceImageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the reference image to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The resource name of the reference image to delete.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DominantColorsAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DominantColorsAnnotation.java new file mode 100644 index 000000000000..1122270d44b8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DominantColorsAnnotation.java @@ -0,0 +1,834 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Set of dominant colors and their corresponding scores.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.DominantColorsAnnotation} + */ +public final class DominantColorsAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.DominantColorsAnnotation) + DominantColorsAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use DominantColorsAnnotation.newBuilder() to construct. + private DominantColorsAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DominantColorsAnnotation() { + colors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DominantColorsAnnotation( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + colors_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + colors_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.ColorInfo.parser(), extensionRegistry)); + 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) == 0x00000001)) { + colors_ = java.util.Collections.unmodifiableList(colors_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.class, com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.Builder.class); + } + + public static final int COLORS_FIELD_NUMBER = 1; + private java.util.List colors_; + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public java.util.List getColorsList() { + return colors_; + } + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public java.util.List + getColorsOrBuilderList() { + return colors_; + } + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public int getColorsCount() { + return colors_.size(); + } + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.ColorInfo getColors(int index) { + return colors_.get(index); + } + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.ColorInfoOrBuilder getColorsOrBuilder( + int index) { + return colors_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < colors_.size(); i++) { + output.writeMessage(1, colors_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < colors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, colors_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation other = (com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation) obj; + + boolean result = true; + result = result && getColorsList() + .equals(other.getColorsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getColorsCount() > 0) { + hash = (37 * hash) + COLORS_FIELD_NUMBER; + hash = (53 * hash) + getColorsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation 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.vision.v1p3beta1.DominantColorsAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation 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.vision.v1p3beta1.DominantColorsAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation 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.vision.v1p3beta1.DominantColorsAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation 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.vision.v1p3beta1.DominantColorsAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Set of dominant colors and their corresponding scores.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.DominantColorsAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.DominantColorsAnnotation) + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.class, com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getColorsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (colorsBuilder_ == null) { + colors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + colorsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation build() { + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation buildPartial() { + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation result = new com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation(this); + int from_bitField0_ = bitField0_; + if (colorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + colors_ = java.util.Collections.unmodifiableList(colors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.colors_ = colors_; + } else { + result.colors_ = colorsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation other) { + if (other == com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.getDefaultInstance()) return this; + if (colorsBuilder_ == null) { + if (!other.colors_.isEmpty()) { + if (colors_.isEmpty()) { + colors_ = other.colors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColorsIsMutable(); + colors_.addAll(other.colors_); + } + onChanged(); + } + } else { + if (!other.colors_.isEmpty()) { + if (colorsBuilder_.isEmpty()) { + colorsBuilder_.dispose(); + colorsBuilder_ = null; + colors_ = other.colors_; + bitField0_ = (bitField0_ & ~0x00000001); + colorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getColorsFieldBuilder() : null; + } else { + colorsBuilder_.addAllMessages(other.colors_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List colors_ = + java.util.Collections.emptyList(); + private void ensureColorsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + colors_ = new java.util.ArrayList(colors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ColorInfo, com.google.cloud.vision.v1p3beta1.ColorInfo.Builder, com.google.cloud.vision.v1p3beta1.ColorInfoOrBuilder> colorsBuilder_; + + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public java.util.List getColorsList() { + if (colorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(colors_); + } else { + return colorsBuilder_.getMessageList(); + } + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public int getColorsCount() { + if (colorsBuilder_ == null) { + return colors_.size(); + } else { + return colorsBuilder_.getCount(); + } + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.ColorInfo getColors(int index) { + if (colorsBuilder_ == null) { + return colors_.get(index); + } else { + return colorsBuilder_.getMessage(index); + } + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder setColors( + int index, com.google.cloud.vision.v1p3beta1.ColorInfo value) { + if (colorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.set(index, value); + onChanged(); + } else { + colorsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder setColors( + int index, com.google.cloud.vision.v1p3beta1.ColorInfo.Builder builderForValue) { + if (colorsBuilder_ == null) { + ensureColorsIsMutable(); + colors_.set(index, builderForValue.build()); + onChanged(); + } else { + colorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder addColors(com.google.cloud.vision.v1p3beta1.ColorInfo value) { + if (colorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.add(value); + onChanged(); + } else { + colorsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder addColors( + int index, com.google.cloud.vision.v1p3beta1.ColorInfo value) { + if (colorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.add(index, value); + onChanged(); + } else { + colorsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder addColors( + com.google.cloud.vision.v1p3beta1.ColorInfo.Builder builderForValue) { + if (colorsBuilder_ == null) { + ensureColorsIsMutable(); + colors_.add(builderForValue.build()); + onChanged(); + } else { + colorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder addColors( + int index, com.google.cloud.vision.v1p3beta1.ColorInfo.Builder builderForValue) { + if (colorsBuilder_ == null) { + ensureColorsIsMutable(); + colors_.add(index, builderForValue.build()); + onChanged(); + } else { + colorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder addAllColors( + java.lang.Iterable values) { + if (colorsBuilder_ == null) { + ensureColorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, colors_); + onChanged(); + } else { + colorsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder clearColors() { + if (colorsBuilder_ == null) { + colors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + colorsBuilder_.clear(); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public Builder removeColors(int index) { + if (colorsBuilder_ == null) { + ensureColorsIsMutable(); + colors_.remove(index); + onChanged(); + } else { + colorsBuilder_.remove(index); + } + return this; + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.ColorInfo.Builder getColorsBuilder( + int index) { + return getColorsFieldBuilder().getBuilder(index); + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.ColorInfoOrBuilder getColorsOrBuilder( + int index) { + if (colorsBuilder_ == null) { + return colors_.get(index); } else { + return colorsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public java.util.List + getColorsOrBuilderList() { + if (colorsBuilder_ != null) { + return colorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(colors_); + } + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.ColorInfo.Builder addColorsBuilder() { + return getColorsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.ColorInfo.getDefaultInstance()); + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.ColorInfo.Builder addColorsBuilder( + int index) { + return getColorsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.ColorInfo.getDefaultInstance()); + } + /** + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + public java.util.List + getColorsBuilderList() { + return getColorsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ColorInfo, com.google.cloud.vision.v1p3beta1.ColorInfo.Builder, com.google.cloud.vision.v1p3beta1.ColorInfoOrBuilder> + getColorsFieldBuilder() { + if (colorsBuilder_ == null) { + colorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ColorInfo, com.google.cloud.vision.v1p3beta1.ColorInfo.Builder, com.google.cloud.vision.v1p3beta1.ColorInfoOrBuilder>( + colors_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + colors_ = null; + } + return colorsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.DominantColorsAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.DominantColorsAnnotation) + private static final com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation(); + } + + public static com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DominantColorsAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DominantColorsAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DominantColorsAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DominantColorsAnnotationOrBuilder.java new file mode 100644 index 000000000000..56cf0dfcc742 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/DominantColorsAnnotationOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface DominantColorsAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.DominantColorsAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + java.util.List + getColorsList(); + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + com.google.cloud.vision.v1p3beta1.ColorInfo getColors(int index); + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + int getColorsCount(); + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + java.util.List + getColorsOrBuilderList(); + /** + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ColorInfo colors = 1; + */ + com.google.cloud.vision.v1p3beta1.ColorInfoOrBuilder getColorsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/EntityAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/EntityAnnotation.java new file mode 100644 index 000000000000..f62659f35f7e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/EntityAnnotation.java @@ -0,0 +1,2377 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Set of detected entity features.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.EntityAnnotation} + */ +public final class EntityAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.EntityAnnotation) + EntityAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use EntityAnnotation.newBuilder() to construct. + private EntityAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EntityAnnotation() { + mid_ = ""; + locale_ = ""; + description_ = ""; + score_ = 0F; + confidence_ = 0F; + topicality_ = 0F; + locations_ = java.util.Collections.emptyList(); + properties_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EntityAnnotation( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + mid_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + locale_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 37: { + + score_ = input.readFloat(); + break; + } + case 45: { + + confidence_ = input.readFloat(); + break; + } + case 53: { + + topicality_ = input.readFloat(); + break; + } + case 58: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + locations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + locations_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.LocationInfo.parser(), extensionRegistry)); + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + properties_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + properties_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Property.parser(), extensionRegistry)); + 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_ & 0x00000080) == 0x00000080)) { + locations_ = java.util.Collections.unmodifiableList(locations_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.class, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder.class); + } + + private int bitField0_; + public static final int MID_FIELD_NUMBER = 1; + private volatile java.lang.Object mid_; + /** + *
+   * Opaque entity ID. Some IDs may be available in
+   * [Google Knowledge Graph Search
+   * API](https://developers.google.com/knowledge-graph/).
+   * 
+ * + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + 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(); + mid_ = s; + return s; + } + } + /** + *
+   * Opaque entity ID. Some IDs may be available in
+   * [Google Knowledge Graph Search
+   * API](https://developers.google.com/knowledge-graph/).
+   * 
+ * + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCALE_FIELD_NUMBER = 2; + private volatile java.lang.Object locale_; + /** + *
+   * The language code for the locale in which the entity textual
+   * `description` is expressed.
+   * 
+ * + * string locale = 2; + */ + public java.lang.String getLocale() { + java.lang.Object ref = locale_; + 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(); + locale_ = s; + return s; + } + } + /** + *
+   * The language code for the locale in which the entity textual
+   * `description` is expressed.
+   * 
+ * + * string locale = 2; + */ + public com.google.protobuf.ByteString + getLocaleBytes() { + java.lang.Object ref = locale_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locale_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + *
+   * Entity textual description, expressed in its `locale` language.
+   * 
+ * + * 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; + } + } + /** + *
+   * Entity textual description, expressed in its `locale` language.
+   * 
+ * + * 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 SCORE_FIELD_NUMBER = 4; + private float score_; + /** + *
+   * Overall score of the result. Range [0, 1].
+   * 
+ * + * float score = 4; + */ + public float getScore() { + return score_; + } + + public static final int CONFIDENCE_FIELD_NUMBER = 5; + private float confidence_; + /** + *
+   * **Deprecated. Use `score` instead.**
+   * The accuracy of the entity detection in an image.
+   * For example, for an image in which the "Eiffel Tower" entity is detected,
+   * this field represents the confidence that there is a tower in the query
+   * image. Range [0, 1].
+   * 
+ * + * float confidence = 5; + */ + public float getConfidence() { + return confidence_; + } + + public static final int TOPICALITY_FIELD_NUMBER = 6; + private float topicality_; + /** + *
+   * The relevancy of the ICA (Image Content Annotation) label to the
+   * image. For example, the relevancy of "tower" is likely higher to an image
+   * containing the detected "Eiffel Tower" than to an image containing a
+   * detected distant towering building, even though the confidence that
+   * there is a tower in each image may be the same. Range [0, 1].
+   * 
+ * + * float topicality = 6; + */ + public float getTopicality() { + return topicality_; + } + + public static final int BOUNDING_POLY_FIELD_NUMBER = 7; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_; + /** + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + /** + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + public static final int LOCATIONS_FIELD_NUMBER = 8; + private java.util.List locations_; + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public java.util.List getLocationsList() { + return locations_; + } + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public java.util.List + getLocationsOrBuilderList() { + return locations_; + } + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public int getLocationsCount() { + return locations_.size(); + } + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p3beta1.LocationInfo getLocations(int index) { + return locations_.get(index); + } + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p3beta1.LocationInfoOrBuilder getLocationsOrBuilder( + int index) { + return locations_.get(index); + } + + public static final int PROPERTIES_FIELD_NUMBER = 9; + private java.util.List properties_; + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public java.util.List getPropertiesList() { + return properties_; + } + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public java.util.List + getPropertiesOrBuilderList() { + return properties_; + } + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public int getPropertiesCount() { + return properties_.size(); + } + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p3beta1.Property getProperties(int index) { + return properties_.get(index); + } + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p3beta1.PropertyOrBuilder getPropertiesOrBuilder( + int index) { + return properties_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + } + if (!getLocaleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, locale_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (score_ != 0F) { + output.writeFloat(4, score_); + } + if (confidence_ != 0F) { + output.writeFloat(5, confidence_); + } + if (topicality_ != 0F) { + output.writeFloat(6, topicality_); + } + if (boundingPoly_ != null) { + output.writeMessage(7, getBoundingPoly()); + } + for (int i = 0; i < locations_.size(); i++) { + output.writeMessage(8, locations_.get(i)); + } + for (int i = 0; i < properties_.size(); i++) { + output.writeMessage(9, properties_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + } + if (!getLocaleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, locale_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, score_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(5, confidence_); + } + if (topicality_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(6, topicality_); + } + if (boundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getBoundingPoly()); + } + for (int i = 0; i < locations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, locations_.get(i)); + } + for (int i = 0; i < properties_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, properties_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.EntityAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.EntityAnnotation other = (com.google.cloud.vision.v1p3beta1.EntityAnnotation) obj; + + boolean result = true; + result = result && getMid() + .equals(other.getMid()); + result = result && getLocale() + .equals(other.getLocale()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && ( + java.lang.Float.floatToIntBits(getTopicality()) + == java.lang.Float.floatToIntBits( + other.getTopicality())); + result = result && (hasBoundingPoly() == other.hasBoundingPoly()); + if (hasBoundingPoly()) { + result = result && getBoundingPoly() + .equals(other.getBoundingPoly()); + } + result = result && getLocationsList() + .equals(other.getLocationsList()); + result = result && getPropertiesList() + .equals(other.getPropertiesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MID_FIELD_NUMBER; + hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + LOCALE_FIELD_NUMBER; + hash = (53 * hash) + getLocale().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (37 * hash) + TOPICALITY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getTopicality()); + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().hashCode(); + } + if (getLocationsCount() > 0) { + hash = (37 * hash) + LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getLocationsList().hashCode(); + } + if (getPropertiesCount() > 0) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getPropertiesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation 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.vision.v1p3beta1.EntityAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation 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.vision.v1p3beta1.EntityAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation 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.vision.v1p3beta1.EntityAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation 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.vision.v1p3beta1.EntityAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.EntityAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Set of detected entity features.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.EntityAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.EntityAnnotation) + com.google.cloud.vision.v1p3beta1.EntityAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.EntityAnnotation.class, com.google.cloud.vision.v1p3beta1.EntityAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.EntityAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLocationsFieldBuilder(); + getPropertiesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + mid_ = ""; + + locale_ = ""; + + description_ = ""; + + score_ = 0F; + + confidence_ = 0F; + + topicality_ = 0F; + + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + if (locationsBuilder_ == null) { + locations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + } else { + locationsBuilder_.clear(); + } + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + } else { + propertiesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.EntityAnnotation build() { + com.google.cloud.vision.v1p3beta1.EntityAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.EntityAnnotation buildPartial() { + com.google.cloud.vision.v1p3beta1.EntityAnnotation result = new com.google.cloud.vision.v1p3beta1.EntityAnnotation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.mid_ = mid_; + result.locale_ = locale_; + result.description_ = description_; + result.score_ = score_; + result.confidence_ = confidence_; + result.topicality_ = topicality_; + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + if (locationsBuilder_ == null) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { + locations_ = java.util.Collections.unmodifiableList(locations_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.locations_ = locations_; + } else { + result.locations_ = locationsBuilder_.build(); + } + if (propertiesBuilder_ == null) { + if (((bitField0_ & 0x00000100) == 0x00000100)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.properties_ = properties_; + } else { + result.properties_ = propertiesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.EntityAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.EntityAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.EntityAnnotation other) { + if (other == com.google.cloud.vision.v1p3beta1.EntityAnnotation.getDefaultInstance()) return this; + if (!other.getMid().isEmpty()) { + mid_ = other.mid_; + onChanged(); + } + if (!other.getLocale().isEmpty()) { + locale_ = other.locale_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (other.getTopicality() != 0F) { + setTopicality(other.getTopicality()); + } + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + if (locationsBuilder_ == null) { + if (!other.locations_.isEmpty()) { + if (locations_.isEmpty()) { + locations_ = other.locations_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureLocationsIsMutable(); + locations_.addAll(other.locations_); + } + onChanged(); + } + } else { + if (!other.locations_.isEmpty()) { + if (locationsBuilder_.isEmpty()) { + locationsBuilder_.dispose(); + locationsBuilder_ = null; + locations_ = other.locations_; + bitField0_ = (bitField0_ & ~0x00000080); + locationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLocationsFieldBuilder() : null; + } else { + locationsBuilder_.addAllMessages(other.locations_); + } + } + } + if (propertiesBuilder_ == null) { + if (!other.properties_.isEmpty()) { + if (properties_.isEmpty()) { + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensurePropertiesIsMutable(); + properties_.addAll(other.properties_); + } + onChanged(); + } + } else { + if (!other.properties_.isEmpty()) { + if (propertiesBuilder_.isEmpty()) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000100); + propertiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPropertiesFieldBuilder() : null; + } else { + propertiesBuilder_.addAllMessages(other.properties_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.EntityAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.EntityAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object mid_ = ""; + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string mid = 1; + */ + public Builder setMid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mid_ = value; + onChanged(); + return this; + } + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string mid = 1; + */ + public Builder clearMid() { + + mid_ = getDefaultInstance().getMid(); + onChanged(); + return this; + } + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string mid = 1; + */ + public Builder setMidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mid_ = value; + onChanged(); + return this; + } + + private java.lang.Object locale_ = ""; + /** + *
+     * The language code for the locale in which the entity textual
+     * `description` is expressed.
+     * 
+ * + * string locale = 2; + */ + public java.lang.String getLocale() { + java.lang.Object ref = locale_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locale_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The language code for the locale in which the entity textual
+     * `description` is expressed.
+     * 
+ * + * string locale = 2; + */ + public com.google.protobuf.ByteString + getLocaleBytes() { + java.lang.Object ref = locale_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locale_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The language code for the locale in which the entity textual
+     * `description` is expressed.
+     * 
+ * + * string locale = 2; + */ + public Builder setLocale( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + locale_ = value; + onChanged(); + return this; + } + /** + *
+     * The language code for the locale in which the entity textual
+     * `description` is expressed.
+     * 
+ * + * string locale = 2; + */ + public Builder clearLocale() { + + locale_ = getDefaultInstance().getLocale(); + onChanged(); + return this; + } + /** + *
+     * The language code for the locale in which the entity textual
+     * `description` is expressed.
+     * 
+ * + * string locale = 2; + */ + public Builder setLocaleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + locale_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * Entity textual description, expressed in its `locale` language.
+     * 
+ * + * 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; + } + } + /** + *
+     * Entity textual description, expressed in its `locale` language.
+     * 
+ * + * 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; + } + } + /** + *
+     * Entity textual description, expressed in its `locale` language.
+     * 
+ * + * string description = 3; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * Entity textual description, expressed in its `locale` language.
+     * 
+ * + * string description = 3; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * Entity textual description, expressed in its `locale` language.
+     * 
+ * + * 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 float score_ ; + /** + *
+     * Overall score of the result. Range [0, 1].
+     * 
+ * + * float score = 4; + */ + public float getScore() { + return score_; + } + /** + *
+     * Overall score of the result. Range [0, 1].
+     * 
+ * + * float score = 4; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+     * Overall score of the result. Range [0, 1].
+     * 
+ * + * float score = 4; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+     * **Deprecated. Use `score` instead.**
+     * The accuracy of the entity detection in an image.
+     * For example, for an image in which the "Eiffel Tower" entity is detected,
+     * this field represents the confidence that there is a tower in the query
+     * image. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * **Deprecated. Use `score` instead.**
+     * The accuracy of the entity detection in an image.
+     * For example, for an image in which the "Eiffel Tower" entity is detected,
+     * this field represents the confidence that there is a tower in the query
+     * image. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * **Deprecated. Use `score` instead.**
+     * The accuracy of the entity detection in an image.
+     * For example, for an image in which the "Eiffel Tower" entity is detected,
+     * this field represents the confidence that there is a tower in the query
+     * image. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private float topicality_ ; + /** + *
+     * The relevancy of the ICA (Image Content Annotation) label to the
+     * image. For example, the relevancy of "tower" is likely higher to an image
+     * containing the detected "Eiffel Tower" than to an image containing a
+     * detected distant towering building, even though the confidence that
+     * there is a tower in each image may be the same. Range [0, 1].
+     * 
+ * + * float topicality = 6; + */ + public float getTopicality() { + return topicality_; + } + /** + *
+     * The relevancy of the ICA (Image Content Annotation) label to the
+     * image. For example, the relevancy of "tower" is likely higher to an image
+     * containing the detected "Eiffel Tower" than to an image containing a
+     * detected distant towering building, even though the confidence that
+     * there is a tower in each image may be the same. Range [0, 1].
+     * 
+ * + * float topicality = 6; + */ + public Builder setTopicality(float value) { + + topicality_ = value; + onChanged(); + return this; + } + /** + *
+     * The relevancy of the ICA (Image Content Annotation) label to the
+     * image. For example, the relevancy of "tower" is likely higher to an image
+     * containing the detected "Eiffel Tower" than to an image containing a
+     * detected distant towering building, even though the confidence that
+     * there is a tower in each image may be the same. Range [0, 1].
+     * 
+ * + * float topicality = 6; + */ + public Builder clearTopicality() { + + topicality_ = 0F; + onChanged(); + return this; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingPolyBuilder_; + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public boolean hasBoundingPoly() { + return boundingPolyBuilder_ != null || boundingPoly_ != null; + } + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingPoly_ = value; + onChanged(); + } else { + boundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = builderForValue.build(); + onChanged(); + } else { + boundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingPoly_).mergeFrom(value).buildPartial(); + } else { + boundingPoly_ = value; + } + onChanged(); + } else { + boundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public Builder clearBoundingPoly() { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + onChanged(); + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + + return this; + } + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + } + /** + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), + getParentForChildren(), + isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private java.util.List locations_ = + java.util.Collections.emptyList(); + private void ensureLocationsIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + locations_ = new java.util.ArrayList(locations_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LocationInfo, com.google.cloud.vision.v1p3beta1.LocationInfo.Builder, com.google.cloud.vision.v1p3beta1.LocationInfoOrBuilder> locationsBuilder_; + + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public java.util.List getLocationsList() { + if (locationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(locations_); + } else { + return locationsBuilder_.getMessageList(); + } + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public int getLocationsCount() { + if (locationsBuilder_ == null) { + return locations_.size(); + } else { + return locationsBuilder_.getCount(); + } + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p3beta1.LocationInfo getLocations(int index) { + if (locationsBuilder_ == null) { + return locations_.get(index); + } else { + return locationsBuilder_.getMessage(index); + } + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder setLocations( + int index, com.google.cloud.vision.v1p3beta1.LocationInfo value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.set(index, value); + onChanged(); + } else { + locationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder setLocations( + int index, com.google.cloud.vision.v1p3beta1.LocationInfo.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.set(index, builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder addLocations(com.google.cloud.vision.v1p3beta1.LocationInfo value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.add(value); + onChanged(); + } else { + locationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder addLocations( + int index, com.google.cloud.vision.v1p3beta1.LocationInfo value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.add(index, value); + onChanged(); + } else { + locationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder addLocations( + com.google.cloud.vision.v1p3beta1.LocationInfo.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.add(builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder addLocations( + int index, com.google.cloud.vision.v1p3beta1.LocationInfo.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.add(index, builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder addAllLocations( + java.lang.Iterable values) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, locations_); + onChanged(); + } else { + locationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder clearLocations() { + if (locationsBuilder_ == null) { + locations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + locationsBuilder_.clear(); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public Builder removeLocations(int index) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.remove(index); + onChanged(); + } else { + locationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p3beta1.LocationInfo.Builder getLocationsBuilder( + int index) { + return getLocationsFieldBuilder().getBuilder(index); + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p3beta1.LocationInfoOrBuilder getLocationsOrBuilder( + int index) { + if (locationsBuilder_ == null) { + return locations_.get(index); } else { + return locationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public java.util.List + getLocationsOrBuilderList() { + if (locationsBuilder_ != null) { + return locationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(locations_); + } + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p3beta1.LocationInfo.Builder addLocationsBuilder() { + return getLocationsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.LocationInfo.getDefaultInstance()); + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p3beta1.LocationInfo.Builder addLocationsBuilder( + int index) { + return getLocationsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.LocationInfo.getDefaultInstance()); + } + /** + *
+     * The location information for the detected entity. Multiple
+     * `LocationInfo` elements can be present because one location may
+     * indicate the location of the scene in the image, and another location
+     * may indicate the location of the place where the image was taken.
+     * Location information is usually present for landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + public java.util.List + getLocationsBuilderList() { + return getLocationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LocationInfo, com.google.cloud.vision.v1p3beta1.LocationInfo.Builder, com.google.cloud.vision.v1p3beta1.LocationInfoOrBuilder> + getLocationsFieldBuilder() { + if (locationsBuilder_ == null) { + locationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LocationInfo, com.google.cloud.vision.v1p3beta1.LocationInfo.Builder, com.google.cloud.vision.v1p3beta1.LocationInfoOrBuilder>( + locations_, + ((bitField0_ & 0x00000080) == 0x00000080), + getParentForChildren(), + isClean()); + locations_ = null; + } + return locationsBuilder_; + } + + private java.util.List properties_ = + java.util.Collections.emptyList(); + private void ensurePropertiesIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + properties_ = new java.util.ArrayList(properties_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Property, com.google.cloud.vision.v1p3beta1.Property.Builder, com.google.cloud.vision.v1p3beta1.PropertyOrBuilder> propertiesBuilder_; + + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public java.util.List getPropertiesList() { + if (propertiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(properties_); + } else { + return propertiesBuilder_.getMessageList(); + } + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public int getPropertiesCount() { + if (propertiesBuilder_ == null) { + return properties_.size(); + } else { + return propertiesBuilder_.getCount(); + } + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p3beta1.Property getProperties(int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessage(index); + } + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder setProperties( + int index, com.google.cloud.vision.v1p3beta1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.set(index, value); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder setProperties( + int index, com.google.cloud.vision.v1p3beta1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.set(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder addProperties(com.google.cloud.vision.v1p3beta1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(value); + onChanged(); + } else { + propertiesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder addProperties( + int index, com.google.cloud.vision.v1p3beta1.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(index, value); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder addProperties( + com.google.cloud.vision.v1p3beta1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder addProperties( + int index, com.google.cloud.vision.v1p3beta1.Property.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder addAllProperties( + java.lang.Iterable values) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, properties_); + onChanged(); + } else { + propertiesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder clearProperties() { + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + propertiesBuilder_.clear(); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public Builder removeProperties(int index) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.remove(index); + onChanged(); + } else { + propertiesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p3beta1.Property.Builder getPropertiesBuilder( + int index) { + return getPropertiesFieldBuilder().getBuilder(index); + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p3beta1.PropertyOrBuilder getPropertiesOrBuilder( + int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); } else { + return propertiesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public java.util.List + getPropertiesOrBuilderList() { + if (propertiesBuilder_ != null) { + return propertiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(properties_); + } + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p3beta1.Property.Builder addPropertiesBuilder() { + return getPropertiesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Property.getDefaultInstance()); + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p3beta1.Property.Builder addPropertiesBuilder( + int index) { + return getPropertiesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Property.getDefaultInstance()); + } + /** + *
+     * Some entities may have optional user-supplied `Property` (name/value)
+     * fields, such a score or string that qualifies the entity.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + public java.util.List + getPropertiesBuilderList() { + return getPropertiesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Property, com.google.cloud.vision.v1p3beta1.Property.Builder, com.google.cloud.vision.v1p3beta1.PropertyOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Property, com.google.cloud.vision.v1p3beta1.Property.Builder, com.google.cloud.vision.v1p3beta1.PropertyOrBuilder>( + properties_, + ((bitField0_ & 0x00000100) == 0x00000100), + getParentForChildren(), + isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.EntityAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.EntityAnnotation) + private static final com.google.cloud.vision.v1p3beta1.EntityAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.EntityAnnotation(); + } + + public static com.google.cloud.vision.v1p3beta1.EntityAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public EntityAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EntityAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.EntityAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/EntityAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/EntityAnnotationOrBuilder.java new file mode 100644 index 000000000000..e04b99e2102f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/EntityAnnotationOrBuilder.java @@ -0,0 +1,245 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface EntityAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.EntityAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Opaque entity ID. Some IDs may be available in
+   * [Google Knowledge Graph Search
+   * API](https://developers.google.com/knowledge-graph/).
+   * 
+ * + * string mid = 1; + */ + java.lang.String getMid(); + /** + *
+   * Opaque entity ID. Some IDs may be available in
+   * [Google Knowledge Graph Search
+   * API](https://developers.google.com/knowledge-graph/).
+   * 
+ * + * string mid = 1; + */ + com.google.protobuf.ByteString + getMidBytes(); + + /** + *
+   * The language code for the locale in which the entity textual
+   * `description` is expressed.
+   * 
+ * + * string locale = 2; + */ + java.lang.String getLocale(); + /** + *
+   * The language code for the locale in which the entity textual
+   * `description` is expressed.
+   * 
+ * + * string locale = 2; + */ + com.google.protobuf.ByteString + getLocaleBytes(); + + /** + *
+   * Entity textual description, expressed in its `locale` language.
+   * 
+ * + * string description = 3; + */ + java.lang.String getDescription(); + /** + *
+   * Entity textual description, expressed in its `locale` language.
+   * 
+ * + * string description = 3; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Overall score of the result. Range [0, 1].
+   * 
+ * + * float score = 4; + */ + float getScore(); + + /** + *
+   * **Deprecated. Use `score` instead.**
+   * The accuracy of the entity detection in an image.
+   * For example, for an image in which the "Eiffel Tower" entity is detected,
+   * this field represents the confidence that there is a tower in the query
+   * image. Range [0, 1].
+   * 
+ * + * float confidence = 5; + */ + float getConfidence(); + + /** + *
+   * The relevancy of the ICA (Image Content Annotation) label to the
+   * image. For example, the relevancy of "tower" is likely higher to an image
+   * containing the detected "Eiffel Tower" than to an image containing a
+   * detected distant towering building, even though the confidence that
+   * there is a tower in each image may be the same. Range [0, 1].
+   * 
+ * + * float topicality = 6; + */ + float getTopicality(); + + /** + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + boolean hasBoundingPoly(); + /** + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly(); + /** + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 7; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + java.util.List + getLocationsList(); + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + com.google.cloud.vision.v1p3beta1.LocationInfo getLocations(int index); + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + int getLocationsCount(); + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + java.util.List + getLocationsOrBuilderList(); + /** + *
+   * The location information for the detected entity. Multiple
+   * `LocationInfo` elements can be present because one location may
+   * indicate the location of the scene in the image, and another location
+   * may indicate the location of the place where the image was taken.
+   * Location information is usually present for landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.LocationInfo locations = 8; + */ + com.google.cloud.vision.v1p3beta1.LocationInfoOrBuilder getLocationsOrBuilder( + int index); + + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + java.util.List + getPropertiesList(); + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + com.google.cloud.vision.v1p3beta1.Property getProperties(int index); + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + int getPropertiesCount(); + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + java.util.List + getPropertiesOrBuilderList(); + /** + *
+   * Some entities may have optional user-supplied `Property` (name/value)
+   * fields, such a score or string that qualifies the entity.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Property properties = 9; + */ + com.google.cloud.vision.v1p3beta1.PropertyOrBuilder getPropertiesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FaceAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FaceAnnotation.java new file mode 100644 index 000000000000..b073460529ee --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FaceAnnotation.java @@ -0,0 +1,4069 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A face annotation object contains the results of face detection.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.FaceAnnotation} + */ +public final class FaceAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.FaceAnnotation) + FaceAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use FaceAnnotation.newBuilder() to construct. + private FaceAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FaceAnnotation() { + landmarks_ = java.util.Collections.emptyList(); + rollAngle_ = 0F; + panAngle_ = 0F; + tiltAngle_ = 0F; + detectionConfidence_ = 0F; + landmarkingConfidence_ = 0F; + joyLikelihood_ = 0; + sorrowLikelihood_ = 0; + angerLikelihood_ = 0; + surpriseLikelihood_ = 0; + underExposedLikelihood_ = 0; + blurredLikelihood_ = 0; + headwearLikelihood_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FaceAnnotation( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (fdBoundingPoly_ != null) { + subBuilder = fdBoundingPoly_.toBuilder(); + } + fdBoundingPoly_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fdBoundingPoly_); + fdBoundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + landmarks_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + landmarks_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.parser(), extensionRegistry)); + break; + } + case 37: { + + rollAngle_ = input.readFloat(); + break; + } + case 45: { + + panAngle_ = input.readFloat(); + break; + } + case 53: { + + tiltAngle_ = input.readFloat(); + break; + } + case 61: { + + detectionConfidence_ = input.readFloat(); + break; + } + case 69: { + + landmarkingConfidence_ = input.readFloat(); + break; + } + case 72: { + int rawValue = input.readEnum(); + + joyLikelihood_ = rawValue; + break; + } + case 80: { + int rawValue = input.readEnum(); + + sorrowLikelihood_ = rawValue; + break; + } + case 88: { + int rawValue = input.readEnum(); + + angerLikelihood_ = rawValue; + break; + } + case 96: { + int rawValue = input.readEnum(); + + surpriseLikelihood_ = rawValue; + break; + } + case 104: { + int rawValue = input.readEnum(); + + underExposedLikelihood_ = rawValue; + break; + } + case 112: { + int rawValue = input.readEnum(); + + blurredLikelihood_ = rawValue; + break; + } + case 120: { + int rawValue = input.readEnum(); + + headwearLikelihood_ = rawValue; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + landmarks_ = java.util.Collections.unmodifiableList(landmarks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.FaceAnnotation.class, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder.class); + } + + public interface LandmarkOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Face landmark type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + int getTypeValue(); + /** + *
+     * Face landmark type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type getType(); + + /** + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + boolean hasPosition(); + /** + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + com.google.cloud.vision.v1p3beta1.Position getPosition(); + /** + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + com.google.cloud.vision.v1p3beta1.PositionOrBuilder getPositionOrBuilder(); + } + /** + *
+   * A face-specific landmark (for example, a face feature).
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark} + */ + public static final class Landmark extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) + LandmarkOrBuilder { + private static final long serialVersionUID = 0L; + // Use Landmark.newBuilder() to construct. + private Landmark(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Landmark() { + type_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Landmark( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 24: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 34: { + com.google.cloud.vision.v1p3beta1.Position.Builder subBuilder = null; + if (position_ != null) { + subBuilder = position_.toBuilder(); + } + position_ = input.readMessage(com.google.cloud.vision.v1p3beta1.Position.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(position_); + position_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.class, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder.class); + } + + /** + *
+     * Face landmark (feature) type.
+     * Left and right are defined from the vantage of the viewer of the image
+     * without considering mirror projections typical of photos. So, `LEFT_EYE`,
+     * typically, is the person's right eye.
+     * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * Unknown face landmark detected. Should not be filled.
+       * 
+ * + * UNKNOWN_LANDMARK = 0; + */ + UNKNOWN_LANDMARK(0), + /** + *
+       * Left eye.
+       * 
+ * + * LEFT_EYE = 1; + */ + LEFT_EYE(1), + /** + *
+       * Right eye.
+       * 
+ * + * RIGHT_EYE = 2; + */ + RIGHT_EYE(2), + /** + *
+       * Left of left eyebrow.
+       * 
+ * + * LEFT_OF_LEFT_EYEBROW = 3; + */ + LEFT_OF_LEFT_EYEBROW(3), + /** + *
+       * Right of left eyebrow.
+       * 
+ * + * RIGHT_OF_LEFT_EYEBROW = 4; + */ + RIGHT_OF_LEFT_EYEBROW(4), + /** + *
+       * Left of right eyebrow.
+       * 
+ * + * LEFT_OF_RIGHT_EYEBROW = 5; + */ + LEFT_OF_RIGHT_EYEBROW(5), + /** + *
+       * Right of right eyebrow.
+       * 
+ * + * RIGHT_OF_RIGHT_EYEBROW = 6; + */ + RIGHT_OF_RIGHT_EYEBROW(6), + /** + *
+       * Midpoint between eyes.
+       * 
+ * + * MIDPOINT_BETWEEN_EYES = 7; + */ + MIDPOINT_BETWEEN_EYES(7), + /** + *
+       * Nose tip.
+       * 
+ * + * NOSE_TIP = 8; + */ + NOSE_TIP(8), + /** + *
+       * Upper lip.
+       * 
+ * + * UPPER_LIP = 9; + */ + UPPER_LIP(9), + /** + *
+       * Lower lip.
+       * 
+ * + * LOWER_LIP = 10; + */ + LOWER_LIP(10), + /** + *
+       * Mouth left.
+       * 
+ * + * MOUTH_LEFT = 11; + */ + MOUTH_LEFT(11), + /** + *
+       * Mouth right.
+       * 
+ * + * MOUTH_RIGHT = 12; + */ + MOUTH_RIGHT(12), + /** + *
+       * Mouth center.
+       * 
+ * + * MOUTH_CENTER = 13; + */ + MOUTH_CENTER(13), + /** + *
+       * Nose, bottom right.
+       * 
+ * + * NOSE_BOTTOM_RIGHT = 14; + */ + NOSE_BOTTOM_RIGHT(14), + /** + *
+       * Nose, bottom left.
+       * 
+ * + * NOSE_BOTTOM_LEFT = 15; + */ + NOSE_BOTTOM_LEFT(15), + /** + *
+       * Nose, bottom center.
+       * 
+ * + * NOSE_BOTTOM_CENTER = 16; + */ + NOSE_BOTTOM_CENTER(16), + /** + *
+       * Left eye, top boundary.
+       * 
+ * + * LEFT_EYE_TOP_BOUNDARY = 17; + */ + LEFT_EYE_TOP_BOUNDARY(17), + /** + *
+       * Left eye, right corner.
+       * 
+ * + * LEFT_EYE_RIGHT_CORNER = 18; + */ + LEFT_EYE_RIGHT_CORNER(18), + /** + *
+       * Left eye, bottom boundary.
+       * 
+ * + * LEFT_EYE_BOTTOM_BOUNDARY = 19; + */ + LEFT_EYE_BOTTOM_BOUNDARY(19), + /** + *
+       * Left eye, left corner.
+       * 
+ * + * LEFT_EYE_LEFT_CORNER = 20; + */ + LEFT_EYE_LEFT_CORNER(20), + /** + *
+       * Right eye, top boundary.
+       * 
+ * + * RIGHT_EYE_TOP_BOUNDARY = 21; + */ + RIGHT_EYE_TOP_BOUNDARY(21), + /** + *
+       * Right eye, right corner.
+       * 
+ * + * RIGHT_EYE_RIGHT_CORNER = 22; + */ + RIGHT_EYE_RIGHT_CORNER(22), + /** + *
+       * Right eye, bottom boundary.
+       * 
+ * + * RIGHT_EYE_BOTTOM_BOUNDARY = 23; + */ + RIGHT_EYE_BOTTOM_BOUNDARY(23), + /** + *
+       * Right eye, left corner.
+       * 
+ * + * RIGHT_EYE_LEFT_CORNER = 24; + */ + RIGHT_EYE_LEFT_CORNER(24), + /** + *
+       * Left eyebrow, upper midpoint.
+       * 
+ * + * LEFT_EYEBROW_UPPER_MIDPOINT = 25; + */ + LEFT_EYEBROW_UPPER_MIDPOINT(25), + /** + *
+       * Right eyebrow, upper midpoint.
+       * 
+ * + * RIGHT_EYEBROW_UPPER_MIDPOINT = 26; + */ + RIGHT_EYEBROW_UPPER_MIDPOINT(26), + /** + *
+       * Left ear tragion.
+       * 
+ * + * LEFT_EAR_TRAGION = 27; + */ + LEFT_EAR_TRAGION(27), + /** + *
+       * Right ear tragion.
+       * 
+ * + * RIGHT_EAR_TRAGION = 28; + */ + RIGHT_EAR_TRAGION(28), + /** + *
+       * Left eye pupil.
+       * 
+ * + * LEFT_EYE_PUPIL = 29; + */ + LEFT_EYE_PUPIL(29), + /** + *
+       * Right eye pupil.
+       * 
+ * + * RIGHT_EYE_PUPIL = 30; + */ + RIGHT_EYE_PUPIL(30), + /** + *
+       * Forehead glabella.
+       * 
+ * + * FOREHEAD_GLABELLA = 31; + */ + FOREHEAD_GLABELLA(31), + /** + *
+       * Chin gnathion.
+       * 
+ * + * CHIN_GNATHION = 32; + */ + CHIN_GNATHION(32), + /** + *
+       * Chin left gonion.
+       * 
+ * + * CHIN_LEFT_GONION = 33; + */ + CHIN_LEFT_GONION(33), + /** + *
+       * Chin right gonion.
+       * 
+ * + * CHIN_RIGHT_GONION = 34; + */ + CHIN_RIGHT_GONION(34), + UNRECOGNIZED(-1), + ; + + /** + *
+       * Unknown face landmark detected. Should not be filled.
+       * 
+ * + * UNKNOWN_LANDMARK = 0; + */ + public static final int UNKNOWN_LANDMARK_VALUE = 0; + /** + *
+       * Left eye.
+       * 
+ * + * LEFT_EYE = 1; + */ + public static final int LEFT_EYE_VALUE = 1; + /** + *
+       * Right eye.
+       * 
+ * + * RIGHT_EYE = 2; + */ + public static final int RIGHT_EYE_VALUE = 2; + /** + *
+       * Left of left eyebrow.
+       * 
+ * + * LEFT_OF_LEFT_EYEBROW = 3; + */ + public static final int LEFT_OF_LEFT_EYEBROW_VALUE = 3; + /** + *
+       * Right of left eyebrow.
+       * 
+ * + * RIGHT_OF_LEFT_EYEBROW = 4; + */ + public static final int RIGHT_OF_LEFT_EYEBROW_VALUE = 4; + /** + *
+       * Left of right eyebrow.
+       * 
+ * + * LEFT_OF_RIGHT_EYEBROW = 5; + */ + public static final int LEFT_OF_RIGHT_EYEBROW_VALUE = 5; + /** + *
+       * Right of right eyebrow.
+       * 
+ * + * RIGHT_OF_RIGHT_EYEBROW = 6; + */ + public static final int RIGHT_OF_RIGHT_EYEBROW_VALUE = 6; + /** + *
+       * Midpoint between eyes.
+       * 
+ * + * MIDPOINT_BETWEEN_EYES = 7; + */ + public static final int MIDPOINT_BETWEEN_EYES_VALUE = 7; + /** + *
+       * Nose tip.
+       * 
+ * + * NOSE_TIP = 8; + */ + public static final int NOSE_TIP_VALUE = 8; + /** + *
+       * Upper lip.
+       * 
+ * + * UPPER_LIP = 9; + */ + public static final int UPPER_LIP_VALUE = 9; + /** + *
+       * Lower lip.
+       * 
+ * + * LOWER_LIP = 10; + */ + public static final int LOWER_LIP_VALUE = 10; + /** + *
+       * Mouth left.
+       * 
+ * + * MOUTH_LEFT = 11; + */ + public static final int MOUTH_LEFT_VALUE = 11; + /** + *
+       * Mouth right.
+       * 
+ * + * MOUTH_RIGHT = 12; + */ + public static final int MOUTH_RIGHT_VALUE = 12; + /** + *
+       * Mouth center.
+       * 
+ * + * MOUTH_CENTER = 13; + */ + public static final int MOUTH_CENTER_VALUE = 13; + /** + *
+       * Nose, bottom right.
+       * 
+ * + * NOSE_BOTTOM_RIGHT = 14; + */ + public static final int NOSE_BOTTOM_RIGHT_VALUE = 14; + /** + *
+       * Nose, bottom left.
+       * 
+ * + * NOSE_BOTTOM_LEFT = 15; + */ + public static final int NOSE_BOTTOM_LEFT_VALUE = 15; + /** + *
+       * Nose, bottom center.
+       * 
+ * + * NOSE_BOTTOM_CENTER = 16; + */ + public static final int NOSE_BOTTOM_CENTER_VALUE = 16; + /** + *
+       * Left eye, top boundary.
+       * 
+ * + * LEFT_EYE_TOP_BOUNDARY = 17; + */ + public static final int LEFT_EYE_TOP_BOUNDARY_VALUE = 17; + /** + *
+       * Left eye, right corner.
+       * 
+ * + * LEFT_EYE_RIGHT_CORNER = 18; + */ + public static final int LEFT_EYE_RIGHT_CORNER_VALUE = 18; + /** + *
+       * Left eye, bottom boundary.
+       * 
+ * + * LEFT_EYE_BOTTOM_BOUNDARY = 19; + */ + public static final int LEFT_EYE_BOTTOM_BOUNDARY_VALUE = 19; + /** + *
+       * Left eye, left corner.
+       * 
+ * + * LEFT_EYE_LEFT_CORNER = 20; + */ + public static final int LEFT_EYE_LEFT_CORNER_VALUE = 20; + /** + *
+       * Right eye, top boundary.
+       * 
+ * + * RIGHT_EYE_TOP_BOUNDARY = 21; + */ + public static final int RIGHT_EYE_TOP_BOUNDARY_VALUE = 21; + /** + *
+       * Right eye, right corner.
+       * 
+ * + * RIGHT_EYE_RIGHT_CORNER = 22; + */ + public static final int RIGHT_EYE_RIGHT_CORNER_VALUE = 22; + /** + *
+       * Right eye, bottom boundary.
+       * 
+ * + * RIGHT_EYE_BOTTOM_BOUNDARY = 23; + */ + public static final int RIGHT_EYE_BOTTOM_BOUNDARY_VALUE = 23; + /** + *
+       * Right eye, left corner.
+       * 
+ * + * RIGHT_EYE_LEFT_CORNER = 24; + */ + public static final int RIGHT_EYE_LEFT_CORNER_VALUE = 24; + /** + *
+       * Left eyebrow, upper midpoint.
+       * 
+ * + * LEFT_EYEBROW_UPPER_MIDPOINT = 25; + */ + public static final int LEFT_EYEBROW_UPPER_MIDPOINT_VALUE = 25; + /** + *
+       * Right eyebrow, upper midpoint.
+       * 
+ * + * RIGHT_EYEBROW_UPPER_MIDPOINT = 26; + */ + public static final int RIGHT_EYEBROW_UPPER_MIDPOINT_VALUE = 26; + /** + *
+       * Left ear tragion.
+       * 
+ * + * LEFT_EAR_TRAGION = 27; + */ + public static final int LEFT_EAR_TRAGION_VALUE = 27; + /** + *
+       * Right ear tragion.
+       * 
+ * + * RIGHT_EAR_TRAGION = 28; + */ + public static final int RIGHT_EAR_TRAGION_VALUE = 28; + /** + *
+       * Left eye pupil.
+       * 
+ * + * LEFT_EYE_PUPIL = 29; + */ + public static final int LEFT_EYE_PUPIL_VALUE = 29; + /** + *
+       * Right eye pupil.
+       * 
+ * + * RIGHT_EYE_PUPIL = 30; + */ + public static final int RIGHT_EYE_PUPIL_VALUE = 30; + /** + *
+       * Forehead glabella.
+       * 
+ * + * FOREHEAD_GLABELLA = 31; + */ + public static final int FOREHEAD_GLABELLA_VALUE = 31; + /** + *
+       * Chin gnathion.
+       * 
+ * + * CHIN_GNATHION = 32; + */ + public static final int CHIN_GNATHION_VALUE = 32; + /** + *
+       * Chin left gonion.
+       * 
+ * + * CHIN_LEFT_GONION = 33; + */ + public static final int CHIN_LEFT_GONION_VALUE = 33; + /** + *
+       * Chin right gonion.
+       * 
+ * + * CHIN_RIGHT_GONION = 34; + */ + public static final int CHIN_RIGHT_GONION_VALUE = 34; + + + 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 Type valueOf(int value) { + return forNumber(value); + } + + public static Type forNumber(int value) { + switch (value) { + case 0: return UNKNOWN_LANDMARK; + case 1: return LEFT_EYE; + case 2: return RIGHT_EYE; + case 3: return LEFT_OF_LEFT_EYEBROW; + case 4: return RIGHT_OF_LEFT_EYEBROW; + case 5: return LEFT_OF_RIGHT_EYEBROW; + case 6: return RIGHT_OF_RIGHT_EYEBROW; + case 7: return MIDPOINT_BETWEEN_EYES; + case 8: return NOSE_TIP; + case 9: return UPPER_LIP; + case 10: return LOWER_LIP; + case 11: return MOUTH_LEFT; + case 12: return MOUTH_RIGHT; + case 13: return MOUTH_CENTER; + case 14: return NOSE_BOTTOM_RIGHT; + case 15: return NOSE_BOTTOM_LEFT; + case 16: return NOSE_BOTTOM_CENTER; + case 17: return LEFT_EYE_TOP_BOUNDARY; + case 18: return LEFT_EYE_RIGHT_CORNER; + case 19: return LEFT_EYE_BOTTOM_BOUNDARY; + case 20: return LEFT_EYE_LEFT_CORNER; + case 21: return RIGHT_EYE_TOP_BOUNDARY; + case 22: return RIGHT_EYE_RIGHT_CORNER; + case 23: return RIGHT_EYE_BOTTOM_BOUNDARY; + case 24: return RIGHT_EYE_LEFT_CORNER; + case 25: return LEFT_EYEBROW_UPPER_MIDPOINT; + case 26: return RIGHT_EYEBROW_UPPER_MIDPOINT; + case 27: return LEFT_EAR_TRAGION; + case 28: return RIGHT_EAR_TRAGION; + case 29: return LEFT_EYE_PUPIL; + case 30: return RIGHT_EYE_PUPIL; + case 31: return FOREHEAD_GLABELLA; + case 32: return CHIN_GNATHION; + case 33: return CHIN_LEFT_GONION; + case 34: return CHIN_RIGHT_GONION; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Type> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.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.vision.v1p3beta1.FaceAnnotation.Landmark.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type) + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_; + /** + *
+     * Face landmark type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public int getTypeValue() { + return type_; + } + /** + *
+     * Face landmark type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type getType() { + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type result = com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type.valueOf(type_); + return result == null ? com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type.UNRECOGNIZED : result; + } + + public static final int POSITION_FIELD_NUMBER = 4; + private com.google.cloud.vision.v1p3beta1.Position position_; + /** + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public boolean hasPosition() { + return position_ != null; + } + /** + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p3beta1.Position getPosition() { + return position_ == null ? com.google.cloud.vision.v1p3beta1.Position.getDefaultInstance() : position_; + } + /** + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p3beta1.PositionOrBuilder getPositionOrBuilder() { + return getPosition(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type.UNKNOWN_LANDMARK.getNumber()) { + output.writeEnum(3, type_); + } + if (position_ != null) { + output.writeMessage(4, getPosition()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type.UNKNOWN_LANDMARK.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, type_); + } + if (position_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getPosition()); + } + 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.vision.v1p3beta1.FaceAnnotation.Landmark)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark other = (com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) obj; + + boolean result = true; + result = result && type_ == other.type_; + result = result && (hasPosition() == other.hasPosition()); + if (hasPosition()) { + result = result && getPosition() + .equals(other.getPosition()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (hasPosition()) { + hash = (37 * hash) + POSITION_FIELD_NUMBER; + hash = (53 * hash) + getPosition().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark 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.vision.v1p3beta1.FaceAnnotation.Landmark parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark 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.vision.v1p3beta1.FaceAnnotation.Landmark parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark 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.vision.v1p3beta1.FaceAnnotation.Landmark parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark 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.vision.v1p3beta1.FaceAnnotation.Landmark parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 face-specific landmark (for example, a face feature).
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) + com.google.cloud.vision.v1p3beta1.FaceAnnotation.LandmarkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.class, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + type_ = 0; + + if (positionBuilder_ == null) { + position_ = null; + } else { + position_ = null; + positionBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark build() { + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark buildPartial() { + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark result = new com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark(this); + result.type_ = type_; + if (positionBuilder_ == null) { + result.position_ = position_; + } else { + result.position_ = positionBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark other) { + if (other == com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasPosition()) { + mergePosition(other.getPosition()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public int getTypeValue() { + return type_; + } + /** + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type getType() { + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type result = com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type.valueOf(type_); + return result == null ? com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type.UNRECOGNIZED : result; + } + /** + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public Builder setType(com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.vision.v1p3beta1.Position position_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Position, com.google.cloud.vision.v1p3beta1.Position.Builder, com.google.cloud.vision.v1p3beta1.PositionOrBuilder> positionBuilder_; + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public boolean hasPosition() { + return positionBuilder_ != null || position_ != null; + } + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p3beta1.Position getPosition() { + if (positionBuilder_ == null) { + return position_ == null ? com.google.cloud.vision.v1p3beta1.Position.getDefaultInstance() : position_; + } else { + return positionBuilder_.getMessage(); + } + } + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public Builder setPosition(com.google.cloud.vision.v1p3beta1.Position value) { + if (positionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + position_ = value; + onChanged(); + } else { + positionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public Builder setPosition( + com.google.cloud.vision.v1p3beta1.Position.Builder builderForValue) { + if (positionBuilder_ == null) { + position_ = builderForValue.build(); + onChanged(); + } else { + positionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public Builder mergePosition(com.google.cloud.vision.v1p3beta1.Position value) { + if (positionBuilder_ == null) { + if (position_ != null) { + position_ = + com.google.cloud.vision.v1p3beta1.Position.newBuilder(position_).mergeFrom(value).buildPartial(); + } else { + position_ = value; + } + onChanged(); + } else { + positionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public Builder clearPosition() { + if (positionBuilder_ == null) { + position_ = null; + onChanged(); + } else { + position_ = null; + positionBuilder_ = null; + } + + return this; + } + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p3beta1.Position.Builder getPositionBuilder() { + + onChanged(); + return getPositionFieldBuilder().getBuilder(); + } + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p3beta1.PositionOrBuilder getPositionOrBuilder() { + if (positionBuilder_ != null) { + return positionBuilder_.getMessageOrBuilder(); + } else { + return position_ == null ? + com.google.cloud.vision.v1p3beta1.Position.getDefaultInstance() : position_; + } + } + /** + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Position position = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Position, com.google.cloud.vision.v1p3beta1.Position.Builder, com.google.cloud.vision.v1p3beta1.PositionOrBuilder> + getPositionFieldBuilder() { + if (positionBuilder_ == null) { + positionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Position, com.google.cloud.vision.v1p3beta1.Position.Builder, com.google.cloud.vision.v1p3beta1.PositionOrBuilder>( + getPosition(), + getParentForChildren(), + isClean()); + position_ = null; + } + return positionBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) + private static final com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark(); + } + + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Landmark parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Landmark(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int BOUNDING_POLY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_; + /** + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale, as returned in `ImageParams`.
+   * The bounding box is computed to "frame" the face in accordance with human
+   * expectations. It is based on the landmarker results.
+   * Note that one or more x and/or y coordinates may not be generated in the
+   * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+   * appears in the image to be annotated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale, as returned in `ImageParams`.
+   * The bounding box is computed to "frame" the face in accordance with human
+   * expectations. It is based on the landmarker results.
+   * Note that one or more x and/or y coordinates may not be generated in the
+   * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+   * appears in the image to be annotated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + /** + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale, as returned in `ImageParams`.
+   * The bounding box is computed to "frame" the face in accordance with human
+   * expectations. It is based on the landmarker results.
+   * Note that one or more x and/or y coordinates may not be generated in the
+   * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+   * appears in the image to be annotated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + public static final int FD_BOUNDING_POLY_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.BoundingPoly fdBoundingPoly_; + /** + *
+   * The `fd_bounding_poly` bounding polygon is tighter than the
+   * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+   * is used to eliminate the face from any image analysis that detects the
+   * "amount of skin" visible in an image. It is not based on the
+   * landmarker results, only on the initial face detection, hence
+   * the <code>fd</code> (face detection) prefix.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public boolean hasFdBoundingPoly() { + return fdBoundingPoly_ != null; + } + /** + *
+   * The `fd_bounding_poly` bounding polygon is tighter than the
+   * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+   * is used to eliminate the face from any image analysis that detects the
+   * "amount of skin" visible in an image. It is not based on the
+   * landmarker results, only on the initial face detection, hence
+   * the <code>fd</code> (face detection) prefix.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getFdBoundingPoly() { + return fdBoundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : fdBoundingPoly_; + } + /** + *
+   * The `fd_bounding_poly` bounding polygon is tighter than the
+   * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+   * is used to eliminate the face from any image analysis that detects the
+   * "amount of skin" visible in an image. It is not based on the
+   * landmarker results, only on the initial face detection, hence
+   * the <code>fd</code> (face detection) prefix.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getFdBoundingPolyOrBuilder() { + return getFdBoundingPoly(); + } + + public static final int LANDMARKS_FIELD_NUMBER = 3; + private java.util.List landmarks_; + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List getLandmarksList() { + return landmarks_; + } + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List + getLandmarksOrBuilderList() { + return landmarks_; + } + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public int getLandmarksCount() { + return landmarks_.size(); + } + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark getLandmarks(int index) { + return landmarks_.get(index); + } + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.LandmarkOrBuilder getLandmarksOrBuilder( + int index) { + return landmarks_.get(index); + } + + public static final int ROLL_ANGLE_FIELD_NUMBER = 4; + private float rollAngle_; + /** + *
+   * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
+   * of the face relative to the image vertical about the axis perpendicular to
+   * the face. Range [-180,180].
+   * 
+ * + * float roll_angle = 4; + */ + public float getRollAngle() { + return rollAngle_; + } + + public static final int PAN_ANGLE_FIELD_NUMBER = 5; + private float panAngle_; + /** + *
+   * Yaw angle, which indicates the leftward/rightward angle that the face is
+   * pointing relative to the vertical plane perpendicular to the image. Range
+   * [-180,180].
+   * 
+ * + * float pan_angle = 5; + */ + public float getPanAngle() { + return panAngle_; + } + + public static final int TILT_ANGLE_FIELD_NUMBER = 6; + private float tiltAngle_; + /** + *
+   * Pitch angle, which indicates the upwards/downwards angle that the face is
+   * pointing relative to the image's horizontal plane. Range [-180,180].
+   * 
+ * + * float tilt_angle = 6; + */ + public float getTiltAngle() { + return tiltAngle_; + } + + public static final int DETECTION_CONFIDENCE_FIELD_NUMBER = 7; + private float detectionConfidence_; + /** + *
+   * Detection confidence. Range [0, 1].
+   * 
+ * + * float detection_confidence = 7; + */ + public float getDetectionConfidence() { + return detectionConfidence_; + } + + public static final int LANDMARKING_CONFIDENCE_FIELD_NUMBER = 8; + private float landmarkingConfidence_; + /** + *
+   * Face landmarking confidence. Range [0, 1].
+   * 
+ * + * float landmarking_confidence = 8; + */ + public float getLandmarkingConfidence() { + return landmarkingConfidence_; + } + + public static final int JOY_LIKELIHOOD_FIELD_NUMBER = 9; + private int joyLikelihood_; + /** + *
+   * Joy likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + public int getJoyLikelihoodValue() { + return joyLikelihood_; + } + /** + *
+   * Joy likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getJoyLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(joyLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int SORROW_LIKELIHOOD_FIELD_NUMBER = 10; + private int sorrowLikelihood_; + /** + *
+   * Sorrow likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + public int getSorrowLikelihoodValue() { + return sorrowLikelihood_; + } + /** + *
+   * Sorrow likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getSorrowLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(sorrowLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int ANGER_LIKELIHOOD_FIELD_NUMBER = 11; + private int angerLikelihood_; + /** + *
+   * Anger likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + public int getAngerLikelihoodValue() { + return angerLikelihood_; + } + /** + *
+   * Anger likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getAngerLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(angerLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int SURPRISE_LIKELIHOOD_FIELD_NUMBER = 12; + private int surpriseLikelihood_; + /** + *
+   * Surprise likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + public int getSurpriseLikelihoodValue() { + return surpriseLikelihood_; + } + /** + *
+   * Surprise likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getSurpriseLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(surpriseLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int UNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER = 13; + private int underExposedLikelihood_; + /** + *
+   * Under-exposed likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + public int getUnderExposedLikelihoodValue() { + return underExposedLikelihood_; + } + /** + *
+   * Under-exposed likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getUnderExposedLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(underExposedLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int BLURRED_LIKELIHOOD_FIELD_NUMBER = 14; + private int blurredLikelihood_; + /** + *
+   * Blurred likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + public int getBlurredLikelihoodValue() { + return blurredLikelihood_; + } + /** + *
+   * Blurred likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getBlurredLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(blurredLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int HEADWEAR_LIKELIHOOD_FIELD_NUMBER = 15; + private int headwearLikelihood_; + /** + *
+   * Headwear likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + public int getHeadwearLikelihoodValue() { + return headwearLikelihood_; + } + /** + *
+   * Headwear likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getHeadwearLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(headwearLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (boundingPoly_ != null) { + output.writeMessage(1, getBoundingPoly()); + } + if (fdBoundingPoly_ != null) { + output.writeMessage(2, getFdBoundingPoly()); + } + for (int i = 0; i < landmarks_.size(); i++) { + output.writeMessage(3, landmarks_.get(i)); + } + if (rollAngle_ != 0F) { + output.writeFloat(4, rollAngle_); + } + if (panAngle_ != 0F) { + output.writeFloat(5, panAngle_); + } + if (tiltAngle_ != 0F) { + output.writeFloat(6, tiltAngle_); + } + if (detectionConfidence_ != 0F) { + output.writeFloat(7, detectionConfidence_); + } + if (landmarkingConfidence_ != 0F) { + output.writeFloat(8, landmarkingConfidence_); + } + if (joyLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(9, joyLikelihood_); + } + if (sorrowLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(10, sorrowLikelihood_); + } + if (angerLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(11, angerLikelihood_); + } + if (surpriseLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(12, surpriseLikelihood_); + } + if (underExposedLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(13, underExposedLikelihood_); + } + if (blurredLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(14, blurredLikelihood_); + } + if (headwearLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(15, headwearLikelihood_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (boundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getBoundingPoly()); + } + if (fdBoundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFdBoundingPoly()); + } + for (int i = 0; i < landmarks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, landmarks_.get(i)); + } + if (rollAngle_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, rollAngle_); + } + if (panAngle_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(5, panAngle_); + } + if (tiltAngle_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(6, tiltAngle_); + } + if (detectionConfidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(7, detectionConfidence_); + } + if (landmarkingConfidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(8, landmarkingConfidence_); + } + if (joyLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(9, joyLikelihood_); + } + if (sorrowLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(10, sorrowLikelihood_); + } + if (angerLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(11, angerLikelihood_); + } + if (surpriseLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(12, surpriseLikelihood_); + } + if (underExposedLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(13, underExposedLikelihood_); + } + if (blurredLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(14, blurredLikelihood_); + } + if (headwearLikelihood_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(15, headwearLikelihood_); + } + 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.vision.v1p3beta1.FaceAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.FaceAnnotation other = (com.google.cloud.vision.v1p3beta1.FaceAnnotation) obj; + + boolean result = true; + result = result && (hasBoundingPoly() == other.hasBoundingPoly()); + if (hasBoundingPoly()) { + result = result && getBoundingPoly() + .equals(other.getBoundingPoly()); + } + result = result && (hasFdBoundingPoly() == other.hasFdBoundingPoly()); + if (hasFdBoundingPoly()) { + result = result && getFdBoundingPoly() + .equals(other.getFdBoundingPoly()); + } + result = result && getLandmarksList() + .equals(other.getLandmarksList()); + result = result && ( + java.lang.Float.floatToIntBits(getRollAngle()) + == java.lang.Float.floatToIntBits( + other.getRollAngle())); + result = result && ( + java.lang.Float.floatToIntBits(getPanAngle()) + == java.lang.Float.floatToIntBits( + other.getPanAngle())); + result = result && ( + java.lang.Float.floatToIntBits(getTiltAngle()) + == java.lang.Float.floatToIntBits( + other.getTiltAngle())); + result = result && ( + java.lang.Float.floatToIntBits(getDetectionConfidence()) + == java.lang.Float.floatToIntBits( + other.getDetectionConfidence())); + result = result && ( + java.lang.Float.floatToIntBits(getLandmarkingConfidence()) + == java.lang.Float.floatToIntBits( + other.getLandmarkingConfidence())); + result = result && joyLikelihood_ == other.joyLikelihood_; + result = result && sorrowLikelihood_ == other.sorrowLikelihood_; + result = result && angerLikelihood_ == other.angerLikelihood_; + result = result && surpriseLikelihood_ == other.surpriseLikelihood_; + result = result && underExposedLikelihood_ == other.underExposedLikelihood_; + result = result && blurredLikelihood_ == other.blurredLikelihood_; + result = result && headwearLikelihood_ == other.headwearLikelihood_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().hashCode(); + } + if (hasFdBoundingPoly()) { + hash = (37 * hash) + FD_BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getFdBoundingPoly().hashCode(); + } + if (getLandmarksCount() > 0) { + hash = (37 * hash) + LANDMARKS_FIELD_NUMBER; + hash = (53 * hash) + getLandmarksList().hashCode(); + } + hash = (37 * hash) + ROLL_ANGLE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getRollAngle()); + hash = (37 * hash) + PAN_ANGLE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPanAngle()); + hash = (37 * hash) + TILT_ANGLE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getTiltAngle()); + hash = (37 * hash) + DETECTION_CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDetectionConfidence()); + hash = (37 * hash) + LANDMARKING_CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getLandmarkingConfidence()); + hash = (37 * hash) + JOY_LIKELIHOOD_FIELD_NUMBER; + hash = (53 * hash) + joyLikelihood_; + hash = (37 * hash) + SORROW_LIKELIHOOD_FIELD_NUMBER; + hash = (53 * hash) + sorrowLikelihood_; + hash = (37 * hash) + ANGER_LIKELIHOOD_FIELD_NUMBER; + hash = (53 * hash) + angerLikelihood_; + hash = (37 * hash) + SURPRISE_LIKELIHOOD_FIELD_NUMBER; + hash = (53 * hash) + surpriseLikelihood_; + hash = (37 * hash) + UNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER; + hash = (53 * hash) + underExposedLikelihood_; + hash = (37 * hash) + BLURRED_LIKELIHOOD_FIELD_NUMBER; + hash = (53 * hash) + blurredLikelihood_; + hash = (37 * hash) + HEADWEAR_LIKELIHOOD_FIELD_NUMBER; + hash = (53 * hash) + headwearLikelihood_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation 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.vision.v1p3beta1.FaceAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation 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.vision.v1p3beta1.FaceAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation 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.vision.v1p3beta1.FaceAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation 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.vision.v1p3beta1.FaceAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.FaceAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 face annotation object contains the results of face detection.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.FaceAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.FaceAnnotation) + com.google.cloud.vision.v1p3beta1.FaceAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.FaceAnnotation.class, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.FaceAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLandmarksFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + if (fdBoundingPolyBuilder_ == null) { + fdBoundingPoly_ = null; + } else { + fdBoundingPoly_ = null; + fdBoundingPolyBuilder_ = null; + } + if (landmarksBuilder_ == null) { + landmarks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + landmarksBuilder_.clear(); + } + rollAngle_ = 0F; + + panAngle_ = 0F; + + tiltAngle_ = 0F; + + detectionConfidence_ = 0F; + + landmarkingConfidence_ = 0F; + + joyLikelihood_ = 0; + + sorrowLikelihood_ = 0; + + angerLikelihood_ = 0; + + surpriseLikelihood_ = 0; + + underExposedLikelihood_ = 0; + + blurredLikelihood_ = 0; + + headwearLikelihood_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.FaceAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.FaceAnnotation.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.FaceAnnotation build() { + com.google.cloud.vision.v1p3beta1.FaceAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.FaceAnnotation buildPartial() { + com.google.cloud.vision.v1p3beta1.FaceAnnotation result = new com.google.cloud.vision.v1p3beta1.FaceAnnotation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + if (fdBoundingPolyBuilder_ == null) { + result.fdBoundingPoly_ = fdBoundingPoly_; + } else { + result.fdBoundingPoly_ = fdBoundingPolyBuilder_.build(); + } + if (landmarksBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + landmarks_ = java.util.Collections.unmodifiableList(landmarks_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.landmarks_ = landmarks_; + } else { + result.landmarks_ = landmarksBuilder_.build(); + } + result.rollAngle_ = rollAngle_; + result.panAngle_ = panAngle_; + result.tiltAngle_ = tiltAngle_; + result.detectionConfidence_ = detectionConfidence_; + result.landmarkingConfidence_ = landmarkingConfidence_; + result.joyLikelihood_ = joyLikelihood_; + result.sorrowLikelihood_ = sorrowLikelihood_; + result.angerLikelihood_ = angerLikelihood_; + result.surpriseLikelihood_ = surpriseLikelihood_; + result.underExposedLikelihood_ = underExposedLikelihood_; + result.blurredLikelihood_ = blurredLikelihood_; + result.headwearLikelihood_ = headwearLikelihood_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.FaceAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.FaceAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.FaceAnnotation other) { + if (other == com.google.cloud.vision.v1p3beta1.FaceAnnotation.getDefaultInstance()) return this; + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + if (other.hasFdBoundingPoly()) { + mergeFdBoundingPoly(other.getFdBoundingPoly()); + } + if (landmarksBuilder_ == null) { + if (!other.landmarks_.isEmpty()) { + if (landmarks_.isEmpty()) { + landmarks_ = other.landmarks_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureLandmarksIsMutable(); + landmarks_.addAll(other.landmarks_); + } + onChanged(); + } + } else { + if (!other.landmarks_.isEmpty()) { + if (landmarksBuilder_.isEmpty()) { + landmarksBuilder_.dispose(); + landmarksBuilder_ = null; + landmarks_ = other.landmarks_; + bitField0_ = (bitField0_ & ~0x00000004); + landmarksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLandmarksFieldBuilder() : null; + } else { + landmarksBuilder_.addAllMessages(other.landmarks_); + } + } + } + if (other.getRollAngle() != 0F) { + setRollAngle(other.getRollAngle()); + } + if (other.getPanAngle() != 0F) { + setPanAngle(other.getPanAngle()); + } + if (other.getTiltAngle() != 0F) { + setTiltAngle(other.getTiltAngle()); + } + if (other.getDetectionConfidence() != 0F) { + setDetectionConfidence(other.getDetectionConfidence()); + } + if (other.getLandmarkingConfidence() != 0F) { + setLandmarkingConfidence(other.getLandmarkingConfidence()); + } + if (other.joyLikelihood_ != 0) { + setJoyLikelihoodValue(other.getJoyLikelihoodValue()); + } + if (other.sorrowLikelihood_ != 0) { + setSorrowLikelihoodValue(other.getSorrowLikelihoodValue()); + } + if (other.angerLikelihood_ != 0) { + setAngerLikelihoodValue(other.getAngerLikelihoodValue()); + } + if (other.surpriseLikelihood_ != 0) { + setSurpriseLikelihoodValue(other.getSurpriseLikelihoodValue()); + } + if (other.underExposedLikelihood_ != 0) { + setUnderExposedLikelihoodValue(other.getUnderExposedLikelihoodValue()); + } + if (other.blurredLikelihood_ != 0) { + setBlurredLikelihoodValue(other.getBlurredLikelihoodValue()); + } + if (other.headwearLikelihood_ != 0) { + setHeadwearLikelihoodValue(other.getHeadwearLikelihoodValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.FaceAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.FaceAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingPolyBuilder_; + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public boolean hasBoundingPoly() { + return boundingPolyBuilder_ != null || boundingPoly_ != null; + } + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingPoly_ = value; + onChanged(); + } else { + boundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = builderForValue.build(); + onChanged(); + } else { + boundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingPoly_).mergeFrom(value).buildPartial(); + } else { + boundingPoly_ = value; + } + onChanged(); + } else { + boundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public Builder clearBoundingPoly() { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + onChanged(); + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + + return this; + } + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + } + /** + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale, as returned in `ImageParams`.
+     * The bounding box is computed to "frame" the face in accordance with human
+     * expectations. It is based on the landmarker results.
+     * Note that one or more x and/or y coordinates may not be generated in the
+     * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+     * appears in the image to be annotated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), + getParentForChildren(), + isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly fdBoundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> fdBoundingPolyBuilder_; + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public boolean hasFdBoundingPoly() { + return fdBoundingPolyBuilder_ != null || fdBoundingPoly_ != null; + } + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getFdBoundingPoly() { + if (fdBoundingPolyBuilder_ == null) { + return fdBoundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : fdBoundingPoly_; + } else { + return fdBoundingPolyBuilder_.getMessage(); + } + } + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public Builder setFdBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (fdBoundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fdBoundingPoly_ = value; + onChanged(); + } else { + fdBoundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public Builder setFdBoundingPoly( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (fdBoundingPolyBuilder_ == null) { + fdBoundingPoly_ = builderForValue.build(); + onChanged(); + } else { + fdBoundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public Builder mergeFdBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (fdBoundingPolyBuilder_ == null) { + if (fdBoundingPoly_ != null) { + fdBoundingPoly_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(fdBoundingPoly_).mergeFrom(value).buildPartial(); + } else { + fdBoundingPoly_ = value; + } + onChanged(); + } else { + fdBoundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public Builder clearFdBoundingPoly() { + if (fdBoundingPolyBuilder_ == null) { + fdBoundingPoly_ = null; + onChanged(); + } else { + fdBoundingPoly_ = null; + fdBoundingPolyBuilder_ = null; + } + + return this; + } + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getFdBoundingPolyBuilder() { + + onChanged(); + return getFdBoundingPolyFieldBuilder().getBuilder(); + } + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getFdBoundingPolyOrBuilder() { + if (fdBoundingPolyBuilder_ != null) { + return fdBoundingPolyBuilder_.getMessageOrBuilder(); + } else { + return fdBoundingPoly_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : fdBoundingPoly_; + } + } + /** + *
+     * The `fd_bounding_poly` bounding polygon is tighter than the
+     * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+     * is used to eliminate the face from any image analysis that detects the
+     * "amount of skin" visible in an image. It is not based on the
+     * landmarker results, only on the initial face detection, hence
+     * the <code>fd</code> (face detection) prefix.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getFdBoundingPolyFieldBuilder() { + if (fdBoundingPolyBuilder_ == null) { + fdBoundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getFdBoundingPoly(), + getParentForChildren(), + isClean()); + fdBoundingPoly_ = null; + } + return fdBoundingPolyBuilder_; + } + + private java.util.List landmarks_ = + java.util.Collections.emptyList(); + private void ensureLandmarksIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + landmarks_ = new java.util.ArrayList(landmarks_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder, com.google.cloud.vision.v1p3beta1.FaceAnnotation.LandmarkOrBuilder> landmarksBuilder_; + + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List getLandmarksList() { + if (landmarksBuilder_ == null) { + return java.util.Collections.unmodifiableList(landmarks_); + } else { + return landmarksBuilder_.getMessageList(); + } + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public int getLandmarksCount() { + if (landmarksBuilder_ == null) { + return landmarks_.size(); + } else { + return landmarksBuilder_.getCount(); + } + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark getLandmarks(int index) { + if (landmarksBuilder_ == null) { + return landmarks_.get(index); + } else { + return landmarksBuilder_.getMessage(index); + } + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder setLandmarks( + int index, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark value) { + if (landmarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLandmarksIsMutable(); + landmarks_.set(index, value); + onChanged(); + } else { + landmarksBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder setLandmarks( + int index, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder builderForValue) { + if (landmarksBuilder_ == null) { + ensureLandmarksIsMutable(); + landmarks_.set(index, builderForValue.build()); + onChanged(); + } else { + landmarksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addLandmarks(com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark value) { + if (landmarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLandmarksIsMutable(); + landmarks_.add(value); + onChanged(); + } else { + landmarksBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addLandmarks( + int index, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark value) { + if (landmarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLandmarksIsMutable(); + landmarks_.add(index, value); + onChanged(); + } else { + landmarksBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addLandmarks( + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder builderForValue) { + if (landmarksBuilder_ == null) { + ensureLandmarksIsMutable(); + landmarks_.add(builderForValue.build()); + onChanged(); + } else { + landmarksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addLandmarks( + int index, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder builderForValue) { + if (landmarksBuilder_ == null) { + ensureLandmarksIsMutable(); + landmarks_.add(index, builderForValue.build()); + onChanged(); + } else { + landmarksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addAllLandmarks( + java.lang.Iterable values) { + if (landmarksBuilder_ == null) { + ensureLandmarksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, landmarks_); + onChanged(); + } else { + landmarksBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder clearLandmarks() { + if (landmarksBuilder_ == null) { + landmarks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + landmarksBuilder_.clear(); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder removeLandmarks(int index) { + if (landmarksBuilder_ == null) { + ensureLandmarksIsMutable(); + landmarks_.remove(index); + onChanged(); + } else { + landmarksBuilder_.remove(index); + } + return this; + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder getLandmarksBuilder( + int index) { + return getLandmarksFieldBuilder().getBuilder(index); + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.LandmarkOrBuilder getLandmarksOrBuilder( + int index) { + if (landmarksBuilder_ == null) { + return landmarks_.get(index); } else { + return landmarksBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List + getLandmarksOrBuilderList() { + if (landmarksBuilder_ != null) { + return landmarksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(landmarks_); + } + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder addLandmarksBuilder() { + return getLandmarksFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.getDefaultInstance()); + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder addLandmarksBuilder( + int index) { + return getLandmarksFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.getDefaultInstance()); + } + /** + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List + getLandmarksBuilderList() { + return getLandmarksFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder, com.google.cloud.vision.v1p3beta1.FaceAnnotation.LandmarkOrBuilder> + getLandmarksFieldBuilder() { + if (landmarksBuilder_ == null) { + landmarksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark, com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Builder, com.google.cloud.vision.v1p3beta1.FaceAnnotation.LandmarkOrBuilder>( + landmarks_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + landmarks_ = null; + } + return landmarksBuilder_; + } + + private float rollAngle_ ; + /** + *
+     * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
+     * of the face relative to the image vertical about the axis perpendicular to
+     * the face. Range [-180,180].
+     * 
+ * + * float roll_angle = 4; + */ + public float getRollAngle() { + return rollAngle_; + } + /** + *
+     * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
+     * of the face relative to the image vertical about the axis perpendicular to
+     * the face. Range [-180,180].
+     * 
+ * + * float roll_angle = 4; + */ + public Builder setRollAngle(float value) { + + rollAngle_ = value; + onChanged(); + return this; + } + /** + *
+     * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
+     * of the face relative to the image vertical about the axis perpendicular to
+     * the face. Range [-180,180].
+     * 
+ * + * float roll_angle = 4; + */ + public Builder clearRollAngle() { + + rollAngle_ = 0F; + onChanged(); + return this; + } + + private float panAngle_ ; + /** + *
+     * Yaw angle, which indicates the leftward/rightward angle that the face is
+     * pointing relative to the vertical plane perpendicular to the image. Range
+     * [-180,180].
+     * 
+ * + * float pan_angle = 5; + */ + public float getPanAngle() { + return panAngle_; + } + /** + *
+     * Yaw angle, which indicates the leftward/rightward angle that the face is
+     * pointing relative to the vertical plane perpendicular to the image. Range
+     * [-180,180].
+     * 
+ * + * float pan_angle = 5; + */ + public Builder setPanAngle(float value) { + + panAngle_ = value; + onChanged(); + return this; + } + /** + *
+     * Yaw angle, which indicates the leftward/rightward angle that the face is
+     * pointing relative to the vertical plane perpendicular to the image. Range
+     * [-180,180].
+     * 
+ * + * float pan_angle = 5; + */ + public Builder clearPanAngle() { + + panAngle_ = 0F; + onChanged(); + return this; + } + + private float tiltAngle_ ; + /** + *
+     * Pitch angle, which indicates the upwards/downwards angle that the face is
+     * pointing relative to the image's horizontal plane. Range [-180,180].
+     * 
+ * + * float tilt_angle = 6; + */ + public float getTiltAngle() { + return tiltAngle_; + } + /** + *
+     * Pitch angle, which indicates the upwards/downwards angle that the face is
+     * pointing relative to the image's horizontal plane. Range [-180,180].
+     * 
+ * + * float tilt_angle = 6; + */ + public Builder setTiltAngle(float value) { + + tiltAngle_ = value; + onChanged(); + return this; + } + /** + *
+     * Pitch angle, which indicates the upwards/downwards angle that the face is
+     * pointing relative to the image's horizontal plane. Range [-180,180].
+     * 
+ * + * float tilt_angle = 6; + */ + public Builder clearTiltAngle() { + + tiltAngle_ = 0F; + onChanged(); + return this; + } + + private float detectionConfidence_ ; + /** + *
+     * Detection confidence. Range [0, 1].
+     * 
+ * + * float detection_confidence = 7; + */ + public float getDetectionConfidence() { + return detectionConfidence_; + } + /** + *
+     * Detection confidence. Range [0, 1].
+     * 
+ * + * float detection_confidence = 7; + */ + public Builder setDetectionConfidence(float value) { + + detectionConfidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Detection confidence. Range [0, 1].
+     * 
+ * + * float detection_confidence = 7; + */ + public Builder clearDetectionConfidence() { + + detectionConfidence_ = 0F; + onChanged(); + return this; + } + + private float landmarkingConfidence_ ; + /** + *
+     * Face landmarking confidence. Range [0, 1].
+     * 
+ * + * float landmarking_confidence = 8; + */ + public float getLandmarkingConfidence() { + return landmarkingConfidence_; + } + /** + *
+     * Face landmarking confidence. Range [0, 1].
+     * 
+ * + * float landmarking_confidence = 8; + */ + public Builder setLandmarkingConfidence(float value) { + + landmarkingConfidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Face landmarking confidence. Range [0, 1].
+     * 
+ * + * float landmarking_confidence = 8; + */ + public Builder clearLandmarkingConfidence() { + + landmarkingConfidence_ = 0F; + onChanged(); + return this; + } + + private int joyLikelihood_ = 0; + /** + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + public int getJoyLikelihoodValue() { + return joyLikelihood_; + } + /** + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + public Builder setJoyLikelihoodValue(int value) { + joyLikelihood_ = value; + onChanged(); + return this; + } + /** + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getJoyLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(joyLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + public Builder setJoyLikelihood(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + joyLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + public Builder clearJoyLikelihood() { + + joyLikelihood_ = 0; + onChanged(); + return this; + } + + private int sorrowLikelihood_ = 0; + /** + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + public int getSorrowLikelihoodValue() { + return sorrowLikelihood_; + } + /** + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + public Builder setSorrowLikelihoodValue(int value) { + sorrowLikelihood_ = value; + onChanged(); + return this; + } + /** + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getSorrowLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(sorrowLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + public Builder setSorrowLikelihood(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + sorrowLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + public Builder clearSorrowLikelihood() { + + sorrowLikelihood_ = 0; + onChanged(); + return this; + } + + private int angerLikelihood_ = 0; + /** + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + public int getAngerLikelihoodValue() { + return angerLikelihood_; + } + /** + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + public Builder setAngerLikelihoodValue(int value) { + angerLikelihood_ = value; + onChanged(); + return this; + } + /** + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getAngerLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(angerLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + public Builder setAngerLikelihood(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + angerLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + public Builder clearAngerLikelihood() { + + angerLikelihood_ = 0; + onChanged(); + return this; + } + + private int surpriseLikelihood_ = 0; + /** + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + public int getSurpriseLikelihoodValue() { + return surpriseLikelihood_; + } + /** + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + public Builder setSurpriseLikelihoodValue(int value) { + surpriseLikelihood_ = value; + onChanged(); + return this; + } + /** + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getSurpriseLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(surpriseLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + public Builder setSurpriseLikelihood(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + surpriseLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + public Builder clearSurpriseLikelihood() { + + surpriseLikelihood_ = 0; + onChanged(); + return this; + } + + private int underExposedLikelihood_ = 0; + /** + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + public int getUnderExposedLikelihoodValue() { + return underExposedLikelihood_; + } + /** + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + public Builder setUnderExposedLikelihoodValue(int value) { + underExposedLikelihood_ = value; + onChanged(); + return this; + } + /** + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getUnderExposedLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(underExposedLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + public Builder setUnderExposedLikelihood(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + underExposedLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + public Builder clearUnderExposedLikelihood() { + + underExposedLikelihood_ = 0; + onChanged(); + return this; + } + + private int blurredLikelihood_ = 0; + /** + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + public int getBlurredLikelihoodValue() { + return blurredLikelihood_; + } + /** + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + public Builder setBlurredLikelihoodValue(int value) { + blurredLikelihood_ = value; + onChanged(); + return this; + } + /** + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getBlurredLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(blurredLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + public Builder setBlurredLikelihood(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + blurredLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + public Builder clearBlurredLikelihood() { + + blurredLikelihood_ = 0; + onChanged(); + return this; + } + + private int headwearLikelihood_ = 0; + /** + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + public int getHeadwearLikelihoodValue() { + return headwearLikelihood_; + } + /** + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + public Builder setHeadwearLikelihoodValue(int value) { + headwearLikelihood_ = value; + onChanged(); + return this; + } + /** + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getHeadwearLikelihood() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(headwearLikelihood_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + public Builder setHeadwearLikelihood(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + headwearLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + public Builder clearHeadwearLikelihood() { + + headwearLikelihood_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.FaceAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.FaceAnnotation) + private static final com.google.cloud.vision.v1p3beta1.FaceAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.FaceAnnotation(); + } + + public static com.google.cloud.vision.v1p3beta1.FaceAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public FaceAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FaceAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.FaceAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FaceAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FaceAnnotationOrBuilder.java new file mode 100644 index 000000000000..8a3f8c3c762e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FaceAnnotationOrBuilder.java @@ -0,0 +1,305 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface FaceAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.FaceAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale, as returned in `ImageParams`.
+   * The bounding box is computed to "frame" the face in accordance with human
+   * expectations. It is based on the landmarker results.
+   * Note that one or more x and/or y coordinates may not be generated in the
+   * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+   * appears in the image to be annotated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + boolean hasBoundingPoly(); + /** + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale, as returned in `ImageParams`.
+   * The bounding box is computed to "frame" the face in accordance with human
+   * expectations. It is based on the landmarker results.
+   * Note that one or more x and/or y coordinates may not be generated in the
+   * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+   * appears in the image to be annotated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly(); + /** + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale, as returned in `ImageParams`.
+   * The bounding box is computed to "frame" the face in accordance with human
+   * expectations. It is based on the landmarker results.
+   * Note that one or more x and/or y coordinates may not be generated in the
+   * `BoundingPoly` (the polygon will be unbounded) if only a partial face
+   * appears in the image to be annotated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + *
+   * The `fd_bounding_poly` bounding polygon is tighter than the
+   * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+   * is used to eliminate the face from any image analysis that detects the
+   * "amount of skin" visible in an image. It is not based on the
+   * landmarker results, only on the initial face detection, hence
+   * the <code>fd</code> (face detection) prefix.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + boolean hasFdBoundingPoly(); + /** + *
+   * The `fd_bounding_poly` bounding polygon is tighter than the
+   * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+   * is used to eliminate the face from any image analysis that detects the
+   * "amount of skin" visible in an image. It is not based on the
+   * landmarker results, only on the initial face detection, hence
+   * the <code>fd</code> (face detection) prefix.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getFdBoundingPoly(); + /** + *
+   * The `fd_bounding_poly` bounding polygon is tighter than the
+   * `boundingPoly`, and encloses only the skin part of the face. Typically, it
+   * is used to eliminate the face from any image analysis that detects the
+   * "amount of skin" visible in an image. It is not based on the
+   * landmarker results, only on the initial face detection, hence
+   * the <code>fd</code> (face detection) prefix.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly fd_bounding_poly = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getFdBoundingPolyOrBuilder(); + + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + java.util.List + getLandmarksList(); + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + com.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark getLandmarks(int index); + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + int getLandmarksCount(); + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + java.util.List + getLandmarksOrBuilderList(); + /** + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark landmarks = 3; + */ + com.google.cloud.vision.v1p3beta1.FaceAnnotation.LandmarkOrBuilder getLandmarksOrBuilder( + int index); + + /** + *
+   * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
+   * of the face relative to the image vertical about the axis perpendicular to
+   * the face. Range [-180,180].
+   * 
+ * + * float roll_angle = 4; + */ + float getRollAngle(); + + /** + *
+   * Yaw angle, which indicates the leftward/rightward angle that the face is
+   * pointing relative to the vertical plane perpendicular to the image. Range
+   * [-180,180].
+   * 
+ * + * float pan_angle = 5; + */ + float getPanAngle(); + + /** + *
+   * Pitch angle, which indicates the upwards/downwards angle that the face is
+   * pointing relative to the image's horizontal plane. Range [-180,180].
+   * 
+ * + * float tilt_angle = 6; + */ + float getTiltAngle(); + + /** + *
+   * Detection confidence. Range [0, 1].
+   * 
+ * + * float detection_confidence = 7; + */ + float getDetectionConfidence(); + + /** + *
+   * Face landmarking confidence. Range [0, 1].
+   * 
+ * + * float landmarking_confidence = 8; + */ + float getLandmarkingConfidence(); + + /** + *
+   * Joy likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + int getJoyLikelihoodValue(); + /** + *
+   * Joy likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood joy_likelihood = 9; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getJoyLikelihood(); + + /** + *
+   * Sorrow likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + int getSorrowLikelihoodValue(); + /** + *
+   * Sorrow likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood sorrow_likelihood = 10; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getSorrowLikelihood(); + + /** + *
+   * Anger likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + int getAngerLikelihoodValue(); + /** + *
+   * Anger likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood anger_likelihood = 11; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getAngerLikelihood(); + + /** + *
+   * Surprise likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + int getSurpriseLikelihoodValue(); + /** + *
+   * Surprise likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood surprise_likelihood = 12; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getSurpriseLikelihood(); + + /** + *
+   * Under-exposed likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + int getUnderExposedLikelihoodValue(); + /** + *
+   * Under-exposed likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood under_exposed_likelihood = 13; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getUnderExposedLikelihood(); + + /** + *
+   * Blurred likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + int getBlurredLikelihoodValue(); + /** + *
+   * Blurred likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood blurred_likelihood = 14; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getBlurredLikelihood(); + + /** + *
+   * Headwear likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + int getHeadwearLikelihoodValue(); + /** + *
+   * Headwear likelihood.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood headwear_likelihood = 15; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getHeadwearLikelihood(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Feature.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Feature.java new file mode 100644 index 000000000000..76d0a84d1773 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Feature.java @@ -0,0 +1,1074 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * The type of Google Cloud Vision API detection to perform, and the maximum
+ * number of results to return for that type. Multiple `Feature` objects can
+ * be specified in the `features` list.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Feature} + */ +public final class Feature extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Feature) + FeatureOrBuilder { +private static final long serialVersionUID = 0L; + // Use Feature.newBuilder() to construct. + private Feature(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Feature() { + type_ = 0; + maxResults_ = 0; + model_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Feature( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 16: { + + maxResults_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Feature_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Feature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Feature.class, com.google.cloud.vision.v1p3beta1.Feature.Builder.class); + } + + /** + *
+   * Type of Google Cloud Vision API feature to be extracted.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.Feature.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unspecified feature type.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + *
+     * Run face detection.
+     * 
+ * + * FACE_DETECTION = 1; + */ + FACE_DETECTION(1), + /** + *
+     * Run landmark detection.
+     * 
+ * + * LANDMARK_DETECTION = 2; + */ + LANDMARK_DETECTION(2), + /** + *
+     * Run logo detection.
+     * 
+ * + * LOGO_DETECTION = 3; + */ + LOGO_DETECTION(3), + /** + *
+     * Run label detection.
+     * 
+ * + * LABEL_DETECTION = 4; + */ + LABEL_DETECTION(4), + /** + *
+     * Run text detection / optical character recognition (OCR). Text detection
+     * is optimized for areas of text within a larger image; if the image is
+     * a document, use `DOCUMENT_TEXT_DETECTION` instead.
+     * 
+ * + * TEXT_DETECTION = 5; + */ + TEXT_DETECTION(5), + /** + *
+     * Run dense text document OCR. Takes precedence when both
+     * `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present.
+     * 
+ * + * DOCUMENT_TEXT_DETECTION = 11; + */ + DOCUMENT_TEXT_DETECTION(11), + /** + *
+     * Run Safe Search to detect potentially unsafe
+     * or undesirable content.
+     * 
+ * + * SAFE_SEARCH_DETECTION = 6; + */ + SAFE_SEARCH_DETECTION(6), + /** + *
+     * Compute a set of image properties, such as the
+     * image's dominant colors.
+     * 
+ * + * IMAGE_PROPERTIES = 7; + */ + IMAGE_PROPERTIES(7), + /** + *
+     * Run crop hints.
+     * 
+ * + * CROP_HINTS = 9; + */ + CROP_HINTS(9), + /** + *
+     * Run web detection.
+     * 
+ * + * WEB_DETECTION = 10; + */ + WEB_DETECTION(10), + /** + *
+     * Run Product Search.
+     * 
+ * + * PRODUCT_SEARCH = 12; + */ + PRODUCT_SEARCH(12), + /** + *
+     * Run localizer for object detection.
+     * 
+ * + * OBJECT_LOCALIZATION = 19; + */ + OBJECT_LOCALIZATION(19), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unspecified feature type.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Run face detection.
+     * 
+ * + * FACE_DETECTION = 1; + */ + public static final int FACE_DETECTION_VALUE = 1; + /** + *
+     * Run landmark detection.
+     * 
+ * + * LANDMARK_DETECTION = 2; + */ + public static final int LANDMARK_DETECTION_VALUE = 2; + /** + *
+     * Run logo detection.
+     * 
+ * + * LOGO_DETECTION = 3; + */ + public static final int LOGO_DETECTION_VALUE = 3; + /** + *
+     * Run label detection.
+     * 
+ * + * LABEL_DETECTION = 4; + */ + public static final int LABEL_DETECTION_VALUE = 4; + /** + *
+     * Run text detection / optical character recognition (OCR). Text detection
+     * is optimized for areas of text within a larger image; if the image is
+     * a document, use `DOCUMENT_TEXT_DETECTION` instead.
+     * 
+ * + * TEXT_DETECTION = 5; + */ + public static final int TEXT_DETECTION_VALUE = 5; + /** + *
+     * Run dense text document OCR. Takes precedence when both
+     * `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present.
+     * 
+ * + * DOCUMENT_TEXT_DETECTION = 11; + */ + public static final int DOCUMENT_TEXT_DETECTION_VALUE = 11; + /** + *
+     * Run Safe Search to detect potentially unsafe
+     * or undesirable content.
+     * 
+ * + * SAFE_SEARCH_DETECTION = 6; + */ + public static final int SAFE_SEARCH_DETECTION_VALUE = 6; + /** + *
+     * Compute a set of image properties, such as the
+     * image's dominant colors.
+     * 
+ * + * IMAGE_PROPERTIES = 7; + */ + public static final int IMAGE_PROPERTIES_VALUE = 7; + /** + *
+     * Run crop hints.
+     * 
+ * + * CROP_HINTS = 9; + */ + public static final int CROP_HINTS_VALUE = 9; + /** + *
+     * Run web detection.
+     * 
+ * + * WEB_DETECTION = 10; + */ + public static final int WEB_DETECTION_VALUE = 10; + /** + *
+     * Run Product Search.
+     * 
+ * + * PRODUCT_SEARCH = 12; + */ + public static final int PRODUCT_SEARCH_VALUE = 12; + /** + *
+     * Run localizer for object detection.
+     * 
+ * + * OBJECT_LOCALIZATION = 19; + */ + public static final int OBJECT_LOCALIZATION_VALUE = 19; + + + 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 Type valueOf(int value) { + return forNumber(value); + } + + public static Type forNumber(int value) { + switch (value) { + case 0: return TYPE_UNSPECIFIED; + case 1: return FACE_DETECTION; + case 2: return LANDMARK_DETECTION; + case 3: return LOGO_DETECTION; + case 4: return LABEL_DETECTION; + case 5: return TEXT_DETECTION; + case 11: return DOCUMENT_TEXT_DETECTION; + case 6: return SAFE_SEARCH_DETECTION; + case 7: return IMAGE_PROPERTIES; + case 9: return CROP_HINTS; + case 10: return WEB_DETECTION; + case 12: return PRODUCT_SEARCH; + case 19: return OBJECT_LOCALIZATION; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Type> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.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.vision.v1p3beta1.Feature.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.Feature.Type) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + *
+   * The feature type.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + *
+   * The feature type.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + public com.google.cloud.vision.v1p3beta1.Feature.Type getType() { + com.google.cloud.vision.v1p3beta1.Feature.Type result = com.google.cloud.vision.v1p3beta1.Feature.Type.valueOf(type_); + return result == null ? com.google.cloud.vision.v1p3beta1.Feature.Type.UNRECOGNIZED : result; + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_; + /** + *
+   * Maximum number of results of this type. Does not apply to
+   * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
+   * 
+ * + * int32 max_results = 2; + */ + public int getMaxResults() { + return maxResults_; + } + + public static final int MODEL_FIELD_NUMBER = 3; + private volatile java.lang.Object model_; + /** + *
+   * Model to use for the feature.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 3; + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + *
+   * Model to use for the feature.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 3; + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != com.google.cloud.vision.v1p3beta1.Feature.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (maxResults_ != 0) { + output.writeInt32(2, maxResults_); + } + if (!getModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, model_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.cloud.vision.v1p3beta1.Feature.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, maxResults_); + } + if (!getModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, model_); + } + 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.vision.v1p3beta1.Feature)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Feature other = (com.google.cloud.vision.v1p3beta1.Feature) obj; + + boolean result = true; + result = result && type_ == other.type_; + result = result && (getMaxResults() + == other.getMaxResults()); + result = result && getModel() + .equals(other.getModel()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + 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.vision.v1p3beta1.Feature parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Feature 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.vision.v1p3beta1.Feature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Feature 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.vision.v1p3beta1.Feature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Feature parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Feature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Feature 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.vision.v1p3beta1.Feature parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Feature 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.vision.v1p3beta1.Feature parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Feature parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Feature prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 type of Google Cloud Vision API detection to perform, and the maximum
+   * number of results to return for that type. Multiple `Feature` objects can
+   * be specified in the `features` list.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Feature} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Feature) + com.google.cloud.vision.v1p3beta1.FeatureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Feature_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Feature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Feature.class, com.google.cloud.vision.v1p3beta1.Feature.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Feature.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + type_ = 0; + + maxResults_ = 0; + + model_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Feature_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Feature getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Feature.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Feature build() { + com.google.cloud.vision.v1p3beta1.Feature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Feature buildPartial() { + com.google.cloud.vision.v1p3beta1.Feature result = new com.google.cloud.vision.v1p3beta1.Feature(this); + result.type_ = type_; + result.maxResults_ = maxResults_; + result.model_ = model_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Feature) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Feature)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Feature other) { + if (other == com.google.cloud.vision.v1p3beta1.Feature.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Feature parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Feature) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + public com.google.cloud.vision.v1p3beta1.Feature.Type getType() { + com.google.cloud.vision.v1p3beta1.Feature.Type result = com.google.cloud.vision.v1p3beta1.Feature.Type.valueOf(type_); + return result == null ? com.google.cloud.vision.v1p3beta1.Feature.Type.UNRECOGNIZED : result; + } + /** + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + public Builder setType(com.google.cloud.vision.v1p3beta1.Feature.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private int maxResults_ ; + /** + *
+     * Maximum number of results of this type. Does not apply to
+     * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
+     * 
+ * + * int32 max_results = 2; + */ + public int getMaxResults() { + return maxResults_; + } + /** + *
+     * Maximum number of results of this type. Does not apply to
+     * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
+     * 
+ * + * int32 max_results = 2; + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + onChanged(); + return this; + } + /** + *
+     * Maximum number of results of this type. Does not apply to
+     * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
+     * 
+ * + * int32 max_results = 2; + */ + public Builder clearMaxResults() { + + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + *
+     * Model to use for the feature.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Model to use for the feature.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Model to use for the feature.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + *
+     * Model to use for the feature.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + *
+     * Model to use for the feature.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Feature) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Feature) + private static final com.google.cloud.vision.v1p3beta1.Feature DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Feature(); + } + + public static com.google.cloud.vision.v1p3beta1.Feature getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Feature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Feature(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Feature getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FeatureOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FeatureOrBuilder.java new file mode 100644 index 000000000000..807d1ef2f0fa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/FeatureOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface FeatureOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Feature) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The feature type.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + int getTypeValue(); + /** + *
+   * The feature type.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Feature.Type type = 1; + */ + com.google.cloud.vision.v1p3beta1.Feature.Type getType(); + + /** + *
+   * Maximum number of results of this type. Does not apply to
+   * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
+   * 
+ * + * int32 max_results = 2; + */ + int getMaxResults(); + + /** + *
+   * Model to use for the feature.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 3; + */ + java.lang.String getModel(); + /** + *
+   * Model to use for the feature.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 3; + */ + com.google.protobuf.ByteString + getModelBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsDestination.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsDestination.java new file mode 100644 index 000000000000..373fe68cf3a9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsDestination.java @@ -0,0 +1,629 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * The Google Cloud Storage location where the output will be written to.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GcsDestination} + */ +public final class GcsDestination extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.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() { + uri_ = ""; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsDestination_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GcsDestination.class, com.google.cloud.vision.v1p3beta1.GcsDestination.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + *
+   * Google Cloud Storage URI where the results will be stored. Results will
+   * be in JSON format and preceded by its corresponding input URI. This field
+   * can either represent a single file, or a prefix for multiple outputs.
+   * Prefixes must end in a `/`.
+   * Examples:
+   * *    File: gs://bucket-name/filename.json
+   * *    Prefix: gs://bucket-name/prefix/here/
+   * *    File: gs://bucket-name/prefix/here
+   * If multiple outputs, each response is still AnnotateFileResponse, each of
+   * which contains some subset of the full list of AnnotateImageResponse.
+   * Multiple outputs can happen if, for example, the output JSON is too large
+   * and overflows into multiple sharded files.
+   * 
+ * + * string uri = 1; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + *
+   * Google Cloud Storage URI where the results will be stored. Results will
+   * be in JSON format and preceded by its corresponding input URI. This field
+   * can either represent a single file, or a prefix for multiple outputs.
+   * Prefixes must end in a `/`.
+   * Examples:
+   * *    File: gs://bucket-name/filename.json
+   * *    Prefix: gs://bucket-name/prefix/here/
+   * *    File: gs://bucket-name/prefix/here
+   * If multiple outputs, each response is still AnnotateFileResponse, each of
+   * which contains some subset of the full list of AnnotateImageResponse.
+   * Multiple outputs can happen if, for example, the output JSON is too large
+   * and overflows into multiple sharded files.
+   * 
+ * + * string uri = 1; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + 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.vision.v1p3beta1.GcsDestination)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.GcsDestination other = (com.google.cloud.vision.v1p3beta1.GcsDestination) obj; + + boolean result = true; + result = result && getUri() + .equals(other.getUri()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.GcsDestination parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GcsDestination parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.GcsDestination parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsDestination parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.GcsDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 will be written to.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GcsDestination} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.GcsDestination) + com.google.cloud.vision.v1p3beta1.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsDestination_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GcsDestination.class, com.google.cloud.vision.v1p3beta1.GcsDestination.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.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) { + } + } + public Builder clear() { + super.clear(); + uri_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsDestination_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.GcsDestination getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.GcsDestination.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.GcsDestination build() { + com.google.cloud.vision.v1p3beta1.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.GcsDestination buildPartial() { + com.google.cloud.vision.v1p3beta1.GcsDestination result = new com.google.cloud.vision.v1p3beta1.GcsDestination(this); + result.uri_ = uri_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.GcsDestination) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.GcsDestination)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.GcsDestination other) { + if (other == com.google.cloud.vision.v1p3beta1.GcsDestination.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.GcsDestination parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.GcsDestination) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uri_ = ""; + /** + *
+     * Google Cloud Storage URI where the results will be stored. Results will
+     * be in JSON format and preceded by its corresponding input URI. This field
+     * can either represent a single file, or a prefix for multiple outputs.
+     * Prefixes must end in a `/`.
+     * Examples:
+     * *    File: gs://bucket-name/filename.json
+     * *    Prefix: gs://bucket-name/prefix/here/
+     * *    File: gs://bucket-name/prefix/here
+     * If multiple outputs, each response is still AnnotateFileResponse, each of
+     * which contains some subset of the full list of AnnotateImageResponse.
+     * Multiple outputs can happen if, for example, the output JSON is too large
+     * and overflows into multiple sharded files.
+     * 
+ * + * string uri = 1; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Google Cloud Storage URI where the results will be stored. Results will
+     * be in JSON format and preceded by its corresponding input URI. This field
+     * can either represent a single file, or a prefix for multiple outputs.
+     * Prefixes must end in a `/`.
+     * Examples:
+     * *    File: gs://bucket-name/filename.json
+     * *    Prefix: gs://bucket-name/prefix/here/
+     * *    File: gs://bucket-name/prefix/here
+     * If multiple outputs, each response is still AnnotateFileResponse, each of
+     * which contains some subset of the full list of AnnotateImageResponse.
+     * Multiple outputs can happen if, for example, the output JSON is too large
+     * and overflows into multiple sharded files.
+     * 
+ * + * string uri = 1; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Google Cloud Storage URI where the results will be stored. Results will
+     * be in JSON format and preceded by its corresponding input URI. This field
+     * can either represent a single file, or a prefix for multiple outputs.
+     * Prefixes must end in a `/`.
+     * Examples:
+     * *    File: gs://bucket-name/filename.json
+     * *    Prefix: gs://bucket-name/prefix/here/
+     * *    File: gs://bucket-name/prefix/here
+     * If multiple outputs, each response is still AnnotateFileResponse, each of
+     * which contains some subset of the full list of AnnotateImageResponse.
+     * Multiple outputs can happen if, for example, the output JSON is too large
+     * and overflows into multiple sharded files.
+     * 
+ * + * string uri = 1; + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + *
+     * Google Cloud Storage URI where the results will be stored. Results will
+     * be in JSON format and preceded by its corresponding input URI. This field
+     * can either represent a single file, or a prefix for multiple outputs.
+     * Prefixes must end in a `/`.
+     * Examples:
+     * *    File: gs://bucket-name/filename.json
+     * *    Prefix: gs://bucket-name/prefix/here/
+     * *    File: gs://bucket-name/prefix/here
+     * If multiple outputs, each response is still AnnotateFileResponse, each of
+     * which contains some subset of the full list of AnnotateImageResponse.
+     * Multiple outputs can happen if, for example, the output JSON is too large
+     * and overflows into multiple sharded files.
+     * 
+ * + * string uri = 1; + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + *
+     * Google Cloud Storage URI where the results will be stored. Results will
+     * be in JSON format and preceded by its corresponding input URI. This field
+     * can either represent a single file, or a prefix for multiple outputs.
+     * Prefixes must end in a `/`.
+     * Examples:
+     * *    File: gs://bucket-name/filename.json
+     * *    Prefix: gs://bucket-name/prefix/here/
+     * *    File: gs://bucket-name/prefix/here
+     * If multiple outputs, each response is still AnnotateFileResponse, each of
+     * which contains some subset of the full list of AnnotateImageResponse.
+     * Multiple outputs can happen if, for example, the output JSON is too large
+     * and overflows into multiple sharded files.
+     * 
+ * + * string uri = 1; + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GcsDestination) + private static final com.google.cloud.vision.v1p3beta1.GcsDestination DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.GcsDestination(); + } + + public static com.google.cloud.vision.v1p3beta1.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.vision.v1p3beta1.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsDestinationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsDestinationOrBuilder.java new file mode 100644 index 000000000000..964e908b1fb0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsDestinationOrBuilder.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface GcsDestinationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.GcsDestination) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Google Cloud Storage URI where the results will be stored. Results will
+   * be in JSON format and preceded by its corresponding input URI. This field
+   * can either represent a single file, or a prefix for multiple outputs.
+   * Prefixes must end in a `/`.
+   * Examples:
+   * *    File: gs://bucket-name/filename.json
+   * *    Prefix: gs://bucket-name/prefix/here/
+   * *    File: gs://bucket-name/prefix/here
+   * If multiple outputs, each response is still AnnotateFileResponse, each of
+   * which contains some subset of the full list of AnnotateImageResponse.
+   * Multiple outputs can happen if, for example, the output JSON is too large
+   * and overflows into multiple sharded files.
+   * 
+ * + * string uri = 1; + */ + java.lang.String getUri(); + /** + *
+   * Google Cloud Storage URI where the results will be stored. Results will
+   * be in JSON format and preceded by its corresponding input URI. This field
+   * can either represent a single file, or a prefix for multiple outputs.
+   * Prefixes must end in a `/`.
+   * Examples:
+   * *    File: gs://bucket-name/filename.json
+   * *    Prefix: gs://bucket-name/prefix/here/
+   * *    File: gs://bucket-name/prefix/here
+   * If multiple outputs, each response is still AnnotateFileResponse, each of
+   * which contains some subset of the full list of AnnotateImageResponse.
+   * Multiple outputs can happen if, for example, the output JSON is too large
+   * and overflows into multiple sharded files.
+   * 
+ * + * string uri = 1; + */ + com.google.protobuf.ByteString + getUriBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsSource.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsSource.java new file mode 100644 index 000000000000..4776a61c2c52 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsSource.java @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * The Google Cloud Storage location where the input will be read from.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GcsSource} + */ +public final class GcsSource extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.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() { + uri_ = ""; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsSource_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GcsSource.class, com.google.cloud.vision.v1p3beta1.GcsSource.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + *
+   * Google Cloud Storage URI for the input file. This must only be a
+   * Google Cloud Storage object. Wildcards are not currently supported.
+   * 
+ * + * string uri = 1; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + *
+   * Google Cloud Storage URI for the input file. This must only be a
+   * Google Cloud Storage object. Wildcards are not currently supported.
+   * 
+ * + * string uri = 1; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + 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.vision.v1p3beta1.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.GcsSource other = (com.google.cloud.vision.v1p3beta1.GcsSource) obj; + + boolean result = true; + result = result && getUri() + .equals(other.getUri()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.GcsSource parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GcsSource parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.GcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsSource parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.GcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 input will be read from.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GcsSource} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.GcsSource) + com.google.cloud.vision.v1p3beta1.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsSource_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GcsSource.class, com.google.cloud.vision.v1p3beta1.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.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) { + } + } + public Builder clear() { + super.clear(); + uri_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_GcsSource_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.GcsSource getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.GcsSource.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.GcsSource build() { + com.google.cloud.vision.v1p3beta1.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.GcsSource buildPartial() { + com.google.cloud.vision.v1p3beta1.GcsSource result = new com.google.cloud.vision.v1p3beta1.GcsSource(this); + result.uri_ = uri_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.GcsSource) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.GcsSource)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.GcsSource other) { + if (other == com.google.cloud.vision.v1p3beta1.GcsSource.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.GcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.GcsSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uri_ = ""; + /** + *
+     * Google Cloud Storage URI for the input file. This must only be a
+     * Google Cloud Storage object. Wildcards are not currently supported.
+     * 
+ * + * string uri = 1; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Google Cloud Storage URI for the input file. This must only be a
+     * Google Cloud Storage object. Wildcards are not currently supported.
+     * 
+ * + * string uri = 1; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Google Cloud Storage URI for the input file. This must only be a
+     * Google Cloud Storage object. Wildcards are not currently supported.
+     * 
+ * + * string uri = 1; + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + *
+     * Google Cloud Storage URI for the input file. This must only be a
+     * Google Cloud Storage object. Wildcards are not currently supported.
+     * 
+ * + * string uri = 1; + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + *
+     * Google Cloud Storage URI for the input file. This must only be a
+     * Google Cloud Storage object. Wildcards are not currently supported.
+     * 
+ * + * string uri = 1; + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GcsSource) + private static final com.google.cloud.vision.v1p3beta1.GcsSource DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.GcsSource(); + } + + public static com.google.cloud.vision.v1p3beta1.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.vision.v1p3beta1.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsSourceOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsSourceOrBuilder.java new file mode 100644 index 000000000000..90dc5b0ebf48 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GcsSourceOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface GcsSourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Google Cloud Storage URI for the input file. This must only be a
+   * Google Cloud Storage object. Wildcards are not currently supported.
+   * 
+ * + * string uri = 1; + */ + java.lang.String getUri(); + /** + *
+   * Google Cloud Storage URI for the input file. This must only be a
+   * Google Cloud Storage object. Wildcards are not currently supported.
+   * 
+ * + * string uri = 1; + */ + com.google.protobuf.ByteString + getUriBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GeometryProto.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GeometryProto.java new file mode 100644 index 000000000000..84827e1624a8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GeometryProto.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +public final class GeometryProto { + private GeometryProto() {} + 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_vision_v1p3beta1_Vertex_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Vertex_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Position_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Position_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/vision/v1p3beta1/geometry" + + ".proto\022\035google.cloud.vision.v1p3beta1\032\034g" + + "oogle/api/annotations.proto\"\036\n\006Vertex\022\t\n" + + "\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\"(\n\020NormalizedVertex\022" + + "\t\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\"\225\001\n\014BoundingPoly\0227" + + "\n\010vertices\030\001 \003(\0132%.google.cloud.vision.v" + + "1p3beta1.Vertex\022L\n\023normalized_vertices\030\002" + + " \003(\0132/.google.cloud.vision.v1p3beta1.Nor" + + "malizedVertex\"[\n\026NormalizedBoundingPoly\022" + + "A\n\010vertices\030\001 \003(\0132/.google.cloud.vision." + + "v1p3beta1.NormalizedVertex\"+\n\010Position\022\t" + + "\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\022\t\n\001z\030\003 \001(\002B|\n!com.g" + + "oogle.cloud.vision.v1p3beta1B\rGeometryPr" + + "otoP\001ZCgoogle.golang.org/genproto/google" + + "apis/cloud/vision/v1p3beta1;vision\370\001\001b\006p" + + "roto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_vision_v1p3beta1_Vertex_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_Vertex_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Vertex_descriptor, + new java.lang.String[] { "X", "Y", }); + internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_descriptor, + new java.lang.String[] { "X", "Y", }); + internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_BoundingPoly_descriptor, + new java.lang.String[] { "Vertices", "NormalizedVertices", }); + internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_descriptor, + new java.lang.String[] { "Vertices", }); + internal_static_google_cloud_vision_v1p3beta1_Position_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vision_v1p3beta1_Position_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Position_descriptor, + new java.lang.String[] { "X", "Y", "Z", }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductRequest.java new file mode 100644 index 000000000000..f4feefbc46da --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductRequest.java @@ -0,0 +1,566 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `GetProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GetProductRequest} + */ +public final class GetProductRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.GetProductRequest) + GetProductRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetProductRequest.newBuilder() to construct. + private GetProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetProductRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetProductRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GetProductRequest.class, com.google.cloud.vision.v1p3beta1.GetProductRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of the Product to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + } + /** + *
+   * Resource name of the Product to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.vision.v1p3beta1.GetProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.GetProductRequest other = (com.google.cloud.vision.v1p3beta1.GetProductRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.vision.v1p3beta1.GetProductRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetProductRequest 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.vision.v1p3beta1.GetProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetProductRequest 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.vision.v1p3beta1.GetProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetProductRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.GetProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetProductRequest 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.vision.v1p3beta1.GetProductRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetProductRequest 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.vision.v1p3beta1.GetProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetProductRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.GetProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `GetProduct` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GetProductRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.GetProductRequest) + com.google.cloud.vision.v1p3beta1.GetProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GetProductRequest.class, com.google.cloud.vision.v1p3beta1.GetProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.GetProductRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.GetProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.GetProductRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.GetProductRequest build() { + com.google.cloud.vision.v1p3beta1.GetProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.GetProductRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.GetProductRequest result = new com.google.cloud.vision.v1p3beta1.GetProductRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.GetProductRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.GetProductRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.GetProductRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.GetProductRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.GetProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.GetProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of the Product to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + } + /** + *
+     * Resource name of the Product to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + } + /** + *
+     * Resource name of the Product to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * 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 Product to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the Product to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.GetProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GetProductRequest) + private static final com.google.cloud.vision.v1p3beta1.GetProductRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.GetProductRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.GetProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GetProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProductRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.GetProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductRequestOrBuilder.java new file mode 100644 index 000000000000..157e72234a92 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface GetProductRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.GetProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the Product to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of the Product to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductSetRequest.java new file mode 100644 index 000000000000..fa2dbc740fee --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductSetRequest.java @@ -0,0 +1,566 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `GetProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GetProductSetRequest} + */ +public final class GetProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.GetProductSetRequest) + GetProductSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetProductSetRequest.newBuilder() to construct. + private GetProductSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetProductSetRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetProductSetRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GetProductSetRequest.class, com.google.cloud.vision.v1p3beta1.GetProductSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of the ProductSet to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+   * Resource name of the ProductSet to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.vision.v1p3beta1.GetProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.GetProductSetRequest other = (com.google.cloud.vision.v1p3beta1.GetProductSetRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.vision.v1p3beta1.GetProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetProductSetRequest 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.vision.v1p3beta1.GetProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetProductSetRequest 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.vision.v1p3beta1.GetProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetProductSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.GetProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetProductSetRequest 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.vision.v1p3beta1.GetProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetProductSetRequest 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.vision.v1p3beta1.GetProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.GetProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `GetProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GetProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.GetProductSetRequest) + com.google.cloud.vision.v1p3beta1.GetProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GetProductSetRequest.class, com.google.cloud.vision.v1p3beta1.GetProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.GetProductSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.GetProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.GetProductSetRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.GetProductSetRequest build() { + com.google.cloud.vision.v1p3beta1.GetProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.GetProductSetRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.GetProductSetRequest result = new com.google.cloud.vision.v1p3beta1.GetProductSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.GetProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.GetProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.GetProductSetRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.GetProductSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.GetProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.GetProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of the ProductSet to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * Resource name of the ProductSet to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * Resource name of the ProductSet to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * 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 ProductSet to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the ProductSet to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.GetProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GetProductSetRequest) + private static final com.google.cloud.vision.v1p3beta1.GetProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.GetProductSetRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.GetProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GetProductSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProductSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.GetProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..d5d7b50c760f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetProductSetRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface GetProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.GetProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the ProductSet to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of the ProductSet to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetReferenceImageRequest.java new file mode 100644 index 000000000000..794c1f9f3cfe --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetReferenceImageRequest.java @@ -0,0 +1,566 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `GetReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GetReferenceImageRequest} + */ +public final class GetReferenceImageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.GetReferenceImageRequest) + GetReferenceImageRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetReferenceImageRequest.newBuilder() to construct. + private GetReferenceImageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetReferenceImageRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetReferenceImageRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest.class, com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the ReferenceImage to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + } + /** + *
+   * The resource name of the ReferenceImage to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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); + } + + 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.vision.v1p3beta1.GetReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest other = (com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.vision.v1p3beta1.GetReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest 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.vision.v1p3beta1.GetReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest 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.vision.v1p3beta1.GetReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest 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.vision.v1p3beta1.GetReferenceImageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest 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.vision.v1p3beta1.GetReferenceImageRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `GetReferenceImage` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.GetReferenceImageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.GetReferenceImageRequest) + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest.class, com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest build() { + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest result = new com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the ReferenceImage to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + } + /** + *
+     * The resource name of the ReferenceImage to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + } + /** + *
+     * The resource name of the ReferenceImage to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+     * 
+ * + * 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 ReferenceImage to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the ReferenceImage to get.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.GetReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GetReferenceImageRequest) + private static final com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GetReferenceImageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetReferenceImageRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..28f0c3946951 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/GetReferenceImageRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface GetReferenceImageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.GetReferenceImageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the ReferenceImage to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The resource name of the ReferenceImage to get.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Image.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Image.java new file mode 100644 index 000000000000..5f6d7780395a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Image.java @@ -0,0 +1,735 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Client image to perform Google Cloud Vision API tasks over.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Image} + */ +public final class Image extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Image) + ImageOrBuilder { +private static final long serialVersionUID = 0L; + // Use Image.newBuilder() to construct. + private Image(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Image() { + content_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Image( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + + content_ = input.readBytes(); + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.ImageSource.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ImageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Image_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Image.class, com.google.cloud.vision.v1p3beta1.Image.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString content_; + /** + *
+   * Image content, represented as a stream of bytes.
+   * Note: As with all `bytes` fields, protobuffers use a pure binary
+   * representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + + public static final int SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.ImageSource source_; + /** + *
+   * Google Cloud Storage image location, or publicly-accessible image
+   * URL. If both `content` and `source` are provided for an image, `content`
+   * takes precedence and is used to perform the image annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public boolean hasSource() { + return source_ != null; + } + /** + *
+   * Google Cloud Storage image location, or publicly-accessible image
+   * URL. If both `content` and `source` are provided for an image, `content`
+   * takes precedence and is used to perform the image annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImageSource getSource() { + return source_ == null ? com.google.cloud.vision.v1p3beta1.ImageSource.getDefaultInstance() : source_; + } + /** + *
+   * Google Cloud Storage image location, or publicly-accessible image
+   * URL. If both `content` and `source` are provided for an image, `content`
+   * takes precedence and is used to perform the image annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImageSourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!content_.isEmpty()) { + output.writeBytes(1, content_); + } + if (source_ != null) { + output.writeMessage(2, getSource()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!content_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, content_); + } + if (source_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSource()); + } + 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.vision.v1p3beta1.Image)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Image other = (com.google.cloud.vision.v1p3beta1.Image) obj; + + boolean result = true; + result = result && getContent() + .equals(other.getContent()); + result = result && (hasSource() == other.hasSource()); + if (hasSource()) { + result = result && getSource() + .equals(other.getSource()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Image parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Image parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Image parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Image parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Image prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Client image to perform Google Cloud Vision API tasks over.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Image} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Image) + com.google.cloud.vision.v1p3beta1.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Image_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Image.class, com.google.cloud.vision.v1p3beta1.Image.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Image.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + content_ = com.google.protobuf.ByteString.EMPTY; + + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Image_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Image getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Image.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Image build() { + com.google.cloud.vision.v1p3beta1.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Image buildPartial() { + com.google.cloud.vision.v1p3beta1.Image result = new com.google.cloud.vision.v1p3beta1.Image(this); + result.content_ = content_; + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Image) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Image)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Image other) { + if (other == com.google.cloud.vision.v1p3beta1.Image.getDefaultInstance()) return this; + if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { + setContent(other.getContent()); + } + if (other.hasSource()) { + mergeSource(other.getSource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Image parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Image) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * Image content, represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + /** + *
+     * Image content, represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+     * Image content, represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + private com.google.cloud.vision.v1p3beta1.ImageSource source_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageSource, com.google.cloud.vision.v1p3beta1.ImageSource.Builder, com.google.cloud.vision.v1p3beta1.ImageSourceOrBuilder> sourceBuilder_; + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImageSource getSource() { + if (sourceBuilder_ == null) { + return source_ == null ? com.google.cloud.vision.v1p3beta1.ImageSource.getDefaultInstance() : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public Builder setSource(com.google.cloud.vision.v1p3beta1.ImageSource value) { + if (sourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + sourceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public Builder setSource( + com.google.cloud.vision.v1p3beta1.ImageSource.Builder builderForValue) { + if (sourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + sourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public Builder mergeSource(com.google.cloud.vision.v1p3beta1.ImageSource value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.vision.v1p3beta1.ImageSource.newBuilder(source_).mergeFrom(value).buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public Builder clearSource() { + if (sourceBuilder_ == null) { + source_ = null; + onChanged(); + } else { + source_ = null; + sourceBuilder_ = null; + } + + return this; + } + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImageSource.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImageSourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null ? + com.google.cloud.vision.v1p3beta1.ImageSource.getDefaultInstance() : source_; + } + } + /** + *
+     * Google Cloud Storage image location, or publicly-accessible image
+     * URL. If both `content` and `source` are provided for an image, `content`
+     * takes precedence and is used to perform the image annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageSource, com.google.cloud.vision.v1p3beta1.ImageSource.Builder, com.google.cloud.vision.v1p3beta1.ImageSourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImageSource, com.google.cloud.vision.v1p3beta1.ImageSource.Builder, com.google.cloud.vision.v1p3beta1.ImageSourceOrBuilder>( + getSource(), + getParentForChildren(), + isClean()); + source_ = null; + } + return sourceBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Image) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Image) + private static final com.google.cloud.vision.v1p3beta1.Image DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Image(); + } + + public static com.google.cloud.vision.v1p3beta1.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Image(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotationContext.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotationContext.java new file mode 100644 index 000000000000..d2a97767e9de --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotationContext.java @@ -0,0 +1,632 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * If an image was produced from a file (e.g. a PDF), this message gives
+ * information about the source of that image.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImageAnnotationContext} + */ +public final class ImageAnnotationContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ImageAnnotationContext) + ImageAnnotationContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImageAnnotationContext.newBuilder() to construct. + private ImageAnnotationContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImageAnnotationContext() { + uri_ = ""; + pageNumber_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImageAnnotationContext( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 16: { + + pageNumber_ = input.readInt32(); + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.class, com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + *
+   * The URI of the file used to produce the image.
+   * 
+ * + * string uri = 1; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + *
+   * The URI of the file used to produce the image.
+   * 
+ * + * string uri = 1; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_NUMBER_FIELD_NUMBER = 2; + private int pageNumber_; + /** + *
+   * If the file was a PDF or TIFF, this field gives the page number within
+   * the file used to produce the image.
+   * 
+ * + * int32 page_number = 2; + */ + public int getPageNumber() { + return pageNumber_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (pageNumber_ != 0) { + output.writeInt32(2, pageNumber_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (pageNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageNumber_); + } + 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.vision.v1p3beta1.ImageAnnotationContext)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext other = (com.google.cloud.vision.v1p3beta1.ImageAnnotationContext) obj; + + boolean result = true; + result = result && getUri() + .equals(other.getUri()); + result = result && (getPageNumber() + == other.getPageNumber()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + PAGE_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getPageNumber(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext 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.vision.v1p3beta1.ImageAnnotationContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext 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.vision.v1p3beta1.ImageAnnotationContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext 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.vision.v1p3beta1.ImageAnnotationContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext 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.vision.v1p3beta1.ImageAnnotationContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ImageAnnotationContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * If an image was produced from a file (e.g. a PDF), this message gives
+   * information about the source of that image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImageAnnotationContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ImageAnnotationContext) + com.google.cloud.vision.v1p3beta1.ImageAnnotationContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.class, com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + uri_ = ""; + + pageNumber_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContext getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContext build() { + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContext buildPartial() { + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext result = new com.google.cloud.vision.v1p3beta1.ImageAnnotationContext(this); + result.uri_ = uri_; + result.pageNumber_ = pageNumber_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ImageAnnotationContext) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ImageAnnotationContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ImageAnnotationContext other) { + if (other == com.google.cloud.vision.v1p3beta1.ImageAnnotationContext.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.getPageNumber() != 0) { + setPageNumber(other.getPageNumber()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ImageAnnotationContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ImageAnnotationContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uri_ = ""; + /** + *
+     * The URI of the file used to produce the image.
+     * 
+ * + * string uri = 1; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URI of the file used to produce the image.
+     * 
+ * + * string uri = 1; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URI of the file used to produce the image.
+     * 
+ * + * string uri = 1; + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + *
+     * The URI of the file used to produce the image.
+     * 
+ * + * string uri = 1; + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + *
+     * The URI of the file used to produce the image.
+     * 
+ * + * string uri = 1; + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private int pageNumber_ ; + /** + *
+     * If the file was a PDF or TIFF, this field gives the page number within
+     * the file used to produce the image.
+     * 
+ * + * int32 page_number = 2; + */ + public int getPageNumber() { + return pageNumber_; + } + /** + *
+     * If the file was a PDF or TIFF, this field gives the page number within
+     * the file used to produce the image.
+     * 
+ * + * int32 page_number = 2; + */ + public Builder setPageNumber(int value) { + + pageNumber_ = value; + onChanged(); + return this; + } + /** + *
+     * If the file was a PDF or TIFF, this field gives the page number within
+     * the file used to produce the image.
+     * 
+ * + * int32 page_number = 2; + */ + public Builder clearPageNumber() { + + pageNumber_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ImageAnnotationContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImageAnnotationContext) + private static final com.google.cloud.vision.v1p3beta1.ImageAnnotationContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ImageAnnotationContext(); + } + + public static com.google.cloud.vision.v1p3beta1.ImageAnnotationContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImageAnnotationContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageAnnotationContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ImageAnnotationContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotationContextOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotationContextOrBuilder.java new file mode 100644 index 000000000000..751dab7dd14c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotationContextOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImageAnnotationContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ImageAnnotationContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The URI of the file used to produce the image.
+   * 
+ * + * string uri = 1; + */ + java.lang.String getUri(); + /** + *
+   * The URI of the file used to produce the image.
+   * 
+ * + * string uri = 1; + */ + com.google.protobuf.ByteString + getUriBytes(); + + /** + *
+   * If the file was a PDF or TIFF, this field gives the page number within
+   * the file used to produce the image.
+   * 
+ * + * int32 page_number = 2; + */ + int getPageNumber(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorProto.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorProto.java new file mode 100644 index 000000000000..6b6fd2536fa3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorProto.java @@ -0,0 +1,648 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public final class ImageAnnotatorProto { + private ImageAnnotatorProto() {} + 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_vision_v1p3beta1_Feature_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Feature_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ImageSource_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ImageSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Image_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Image_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_LocationInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_LocationInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Property_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Property_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_LatLongRect_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_LatLongRect_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ColorInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ColorInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ImageProperties_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ImageProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_CropHint_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_CropHint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ImageContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ImageContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_InputConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_InputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_OutputConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_GcsSource_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_GcsDestination_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_GcsDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/vision/v1p3beta1/image_an" + + "notator.proto\022\035google.cloud.vision.v1p3b" + + "eta1\032\034google/api/annotations.proto\032,goog" + + "le/cloud/vision/v1p3beta1/geometry.proto" + + "\0322google/cloud/vision/v1p3beta1/product_" + + "search.proto\0323google/cloud/vision/v1p3be" + + "ta1/text_annotation.proto\0321google/cloud/" + + "vision/v1p3beta1/web_detection.proto\032#go" + + "ogle/longrunning/operations.proto\032\037googl" + + "e/protobuf/timestamp.proto\032\027google/rpc/s" + + "tatus.proto\032\027google/type/color.proto\032\030go" + + "ogle/type/latlng.proto\"\216\003\n\007Feature\0229\n\004ty" + + "pe\030\001 \001(\0162+.google.cloud.vision.v1p3beta1" + + ".Feature.Type\022\023\n\013max_results\030\002 \001(\005\022\r\n\005mo" + + "del\030\003 \001(\t\"\243\002\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000" + + "\022\022\n\016FACE_DETECTION\020\001\022\026\n\022LANDMARK_DETECTI" + + "ON\020\002\022\022\n\016LOGO_DETECTION\020\003\022\023\n\017LABEL_DETECT" + + "ION\020\004\022\022\n\016TEXT_DETECTION\020\005\022\033\n\027DOCUMENT_TE" + + "XT_DETECTION\020\013\022\031\n\025SAFE_SEARCH_DETECTION\020" + + "\006\022\024\n\020IMAGE_PROPERTIES\020\007\022\016\n\nCROP_HINTS\020\t\022" + + "\021\n\rWEB_DETECTION\020\n\022\022\n\016PRODUCT_SEARCH\020\014\022\027" + + "\n\023OBJECT_LOCALIZATION\020\023\"7\n\013ImageSource\022\025" + + "\n\rgcs_image_uri\030\001 \001(\t\022\021\n\timage_uri\030\002 \001(\t" + + "\"T\n\005Image\022\017\n\007content\030\001 \001(\014\022:\n\006source\030\002 \001" + + "(\0132*.google.cloud.vision.v1p3beta1.Image" + + "Source\"\233\016\n\016FaceAnnotation\022B\n\rbounding_po" + + "ly\030\001 \001(\0132+.google.cloud.vision.v1p3beta1" + + ".BoundingPoly\022E\n\020fd_bounding_poly\030\002 \001(\0132" + + "+.google.cloud.vision.v1p3beta1.Bounding" + + "Poly\022I\n\tlandmarks\030\003 \003(\01326.google.cloud.v" + + "ision.v1p3beta1.FaceAnnotation.Landmark\022" + + "\022\n\nroll_angle\030\004 \001(\002\022\021\n\tpan_angle\030\005 \001(\002\022\022" + + "\n\ntilt_angle\030\006 \001(\002\022\034\n\024detection_confiden" + + "ce\030\007 \001(\002\022\036\n\026landmarking_confidence\030\010 \001(\002" + + "\022A\n\016joy_likelihood\030\t \001(\0162).google.cloud." + + "vision.v1p3beta1.Likelihood\022D\n\021sorrow_li" + + "kelihood\030\n \001(\0162).google.cloud.vision.v1p" + + "3beta1.Likelihood\022C\n\020anger_likelihood\030\013 " + + "\001(\0162).google.cloud.vision.v1p3beta1.Like" + + "lihood\022F\n\023surprise_likelihood\030\014 \001(\0162).go" + + "ogle.cloud.vision.v1p3beta1.Likelihood\022K" + + "\n\030under_exposed_likelihood\030\r \001(\0162).googl" + + "e.cloud.vision.v1p3beta1.Likelihood\022E\n\022b" + + "lurred_likelihood\030\016 \001(\0162).google.cloud.v" + + "ision.v1p3beta1.Likelihood\022F\n\023headwear_l" + + "ikelihood\030\017 \001(\0162).google.cloud.vision.v1" + + "p3beta1.Likelihood\032\307\007\n\010Landmark\022I\n\004type\030" + + "\003 \001(\0162;.google.cloud.vision.v1p3beta1.Fa" + + "ceAnnotation.Landmark.Type\0229\n\010position\030\004" + + " \001(\0132\'.google.cloud.vision.v1p3beta1.Pos" + + "ition\"\264\006\n\004Type\022\024\n\020UNKNOWN_LANDMARK\020\000\022\014\n\010" + + "LEFT_EYE\020\001\022\r\n\tRIGHT_EYE\020\002\022\030\n\024LEFT_OF_LEF" + + "T_EYEBROW\020\003\022\031\n\025RIGHT_OF_LEFT_EYEBROW\020\004\022\031" + + "\n\025LEFT_OF_RIGHT_EYEBROW\020\005\022\032\n\026RIGHT_OF_RI" + + "GHT_EYEBROW\020\006\022\031\n\025MIDPOINT_BETWEEN_EYES\020\007" + + "\022\014\n\010NOSE_TIP\020\010\022\r\n\tUPPER_LIP\020\t\022\r\n\tLOWER_L" + + "IP\020\n\022\016\n\nMOUTH_LEFT\020\013\022\017\n\013MOUTH_RIGHT\020\014\022\020\n" + + "\014MOUTH_CENTER\020\r\022\025\n\021NOSE_BOTTOM_RIGHT\020\016\022\024" + + "\n\020NOSE_BOTTOM_LEFT\020\017\022\026\n\022NOSE_BOTTOM_CENT" + + "ER\020\020\022\031\n\025LEFT_EYE_TOP_BOUNDARY\020\021\022\031\n\025LEFT_" + + "EYE_RIGHT_CORNER\020\022\022\034\n\030LEFT_EYE_BOTTOM_BO" + + "UNDARY\020\023\022\030\n\024LEFT_EYE_LEFT_CORNER\020\024\022\032\n\026RI" + + "GHT_EYE_TOP_BOUNDARY\020\025\022\032\n\026RIGHT_EYE_RIGH" + + "T_CORNER\020\026\022\035\n\031RIGHT_EYE_BOTTOM_BOUNDARY\020" + + "\027\022\031\n\025RIGHT_EYE_LEFT_CORNER\020\030\022\037\n\033LEFT_EYE" + + "BROW_UPPER_MIDPOINT\020\031\022 \n\034RIGHT_EYEBROW_U" + + "PPER_MIDPOINT\020\032\022\024\n\020LEFT_EAR_TRAGION\020\033\022\025\n" + + "\021RIGHT_EAR_TRAGION\020\034\022\022\n\016LEFT_EYE_PUPIL\020\035" + + "\022\023\n\017RIGHT_EYE_PUPIL\020\036\022\025\n\021FOREHEAD_GLABEL" + + "LA\020\037\022\021\n\rCHIN_GNATHION\020 \022\024\n\020CHIN_LEFT_GON" + + "ION\020!\022\025\n\021CHIN_RIGHT_GONION\020\"\"4\n\014Location" + + "Info\022$\n\007lat_lng\030\001 \001(\0132\023.google.type.LatL" + + "ng\"=\n\010Property\022\014\n\004name\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t\022\024\n\014uint64_value\030\003 \001(\004\"\274\002\n\020EntityAnno" + + "tation\022\013\n\003mid\030\001 \001(\t\022\016\n\006locale\030\002 \001(\t\022\023\n\013d" + + "escription\030\003 \001(\t\022\r\n\005score\030\004 \001(\002\022\022\n\nconfi" + + "dence\030\005 \001(\002\022\022\n\ntopicality\030\006 \001(\002\022B\n\rbound" + + "ing_poly\030\007 \001(\0132+.google.cloud.vision.v1p" + + "3beta1.BoundingPoly\022>\n\tlocations\030\010 \003(\0132+" + + ".google.cloud.vision.v1p3beta1.LocationI" + + "nfo\022;\n\nproperties\030\t \003(\0132\'.google.cloud.v" + + "ision.v1p3beta1.Property\"\240\001\n\031LocalizedOb" + + "jectAnnotation\022\013\n\003mid\030\001 \001(\t\022\025\n\rlanguage_" + + "code\030\002 \001(\t\022\014\n\004name\030\003 \001(\t\022\r\n\005score\030\004 \001(\002\022" + + "B\n\rbounding_poly\030\005 \001(\0132+.google.cloud.vi" + + "sion.v1p3beta1.BoundingPoly\"\274\002\n\024SafeSear" + + "chAnnotation\0228\n\005adult\030\001 \001(\0162).google.clo" + + "ud.vision.v1p3beta1.Likelihood\0228\n\005spoof\030" + + "\002 \001(\0162).google.cloud.vision.v1p3beta1.Li" + + "kelihood\022:\n\007medical\030\003 \001(\0162).google.cloud" + + ".vision.v1p3beta1.Likelihood\022;\n\010violence" + + "\030\004 \001(\0162).google.cloud.vision.v1p3beta1.L" + + "ikelihood\0227\n\004racy\030\t \001(\0162).google.cloud.v" + + "ision.v1p3beta1.Likelihood\"a\n\013LatLongRec" + + "t\022(\n\013min_lat_lng\030\001 \001(\0132\023.google.type.Lat" + + "Lng\022(\n\013max_lat_lng\030\002 \001(\0132\023.google.type.L" + + "atLng\"U\n\tColorInfo\022!\n\005color\030\001 \001(\0132\022.goog" + + "le.type.Color\022\r\n\005score\030\002 \001(\002\022\026\n\016pixel_fr" + + "action\030\003 \001(\002\"T\n\030DominantColorsAnnotation" + + "\0228\n\006colors\030\001 \003(\0132(.google.cloud.vision.v" + + "1p3beta1.ColorInfo\"c\n\017ImageProperties\022P\n" + + "\017dominant_colors\030\001 \001(\01327.google.cloud.vi" + + "sion.v1p3beta1.DominantColorsAnnotation\"" + + "\177\n\010CropHint\022B\n\rbounding_poly\030\001 \001(\0132+.goo" + + "gle.cloud.vision.v1p3beta1.BoundingPoly\022" + + "\022\n\nconfidence\030\002 \001(\002\022\033\n\023importance_fracti" + + "on\030\003 \001(\002\"R\n\023CropHintsAnnotation\022;\n\ncrop_" + + "hints\030\001 \003(\0132\'.google.cloud.vision.v1p3be" + + "ta1.CropHint\"(\n\017CropHintsParams\022\025\n\raspec" + + "t_ratios\030\001 \003(\002\"1\n\022WebDetectionParams\022\033\n\023" + + "include_geo_results\030\002 \001(\010\"\330\002\n\014ImageConte" + + "xt\022A\n\rlat_long_rect\030\001 \001(\0132*.google.cloud" + + ".vision.v1p3beta1.LatLongRect\022\026\n\016languag" + + "e_hints\030\002 \003(\t\022I\n\021crop_hints_params\030\004 \001(\013" + + "2..google.cloud.vision.v1p3beta1.CropHin" + + "tsParams\022Q\n\025product_search_params\030\005 \001(\0132" + + "2.google.cloud.vision.v1p3beta1.ProductS" + + "earchParams\022O\n\024web_detection_params\030\006 \001(" + + "\01321.google.cloud.vision.v1p3beta1.WebDet" + + "ectionParams\"\311\001\n\024AnnotateImageRequest\0223\n" + + "\005image\030\001 \001(\0132$.google.cloud.vision.v1p3b" + + "eta1.Image\0228\n\010features\030\002 \003(\0132&.google.cl" + + "oud.vision.v1p3beta1.Feature\022B\n\rimage_co" + + "ntext\030\003 \001(\0132+.google.cloud.vision.v1p3be" + + "ta1.ImageContext\":\n\026ImageAnnotationConte" + + "xt\022\013\n\003uri\030\001 \001(\t\022\023\n\013page_number\030\002 \001(\005\"\277\010\n" + + "\025AnnotateImageResponse\022G\n\020face_annotatio" + + "ns\030\001 \003(\0132-.google.cloud.vision.v1p3beta1" + + ".FaceAnnotation\022M\n\024landmark_annotations\030" + + "\002 \003(\0132/.google.cloud.vision.v1p3beta1.En" + + "tityAnnotation\022I\n\020logo_annotations\030\003 \003(\013" + + "2/.google.cloud.vision.v1p3beta1.EntityA" + + "nnotation\022J\n\021label_annotations\030\004 \003(\0132/.g" + + "oogle.cloud.vision.v1p3beta1.EntityAnnot" + + "ation\022^\n\034localized_object_annotations\030\026 " + + "\003(\01328.google.cloud.vision.v1p3beta1.Loca" + + "lizedObjectAnnotation\022I\n\020text_annotation" + + "s\030\005 \003(\0132/.google.cloud.vision.v1p3beta1." + + "EntityAnnotation\022K\n\024full_text_annotation" + + "\030\014 \001(\0132-.google.cloud.vision.v1p3beta1.T" + + "extAnnotation\022S\n\026safe_search_annotation\030" + + "\006 \001(\01323.google.cloud.vision.v1p3beta1.Sa" + + "feSearchAnnotation\022S\n\033image_properties_a" + + "nnotation\030\010 \001(\0132..google.cloud.vision.v1" + + "p3beta1.ImageProperties\022Q\n\025crop_hints_an" + + "notation\030\013 \001(\01322.google.cloud.vision.v1p" + + "3beta1.CropHintsAnnotation\022B\n\rweb_detect" + + "ion\030\r \001(\0132+.google.cloud.vision.v1p3beta" + + "1.WebDetection\022S\n\026product_search_results" + + "\030\016 \001(\01323.google.cloud.vision.v1p3beta1.P" + + "roductSearchResults\022!\n\005error\030\t \001(\0132\022.goo" + + "gle.rpc.Status\022F\n\007context\030\025 \001(\01325.google" + + ".cloud.vision.v1p3beta1.ImageAnnotationC" + + "ontext\"\241\001\n\024AnnotateFileResponse\022@\n\014input" + + "_config\030\001 \001(\0132*.google.cloud.vision.v1p3" + + "beta1.InputConfig\022G\n\tresponses\030\002 \003(\01324.g" + + "oogle.cloud.vision.v1p3beta1.AnnotateIma" + + "geResponse\"c\n\032BatchAnnotateImagesRequest" + + "\022E\n\010requests\030\001 \003(\01323.google.cloud.vision" + + ".v1p3beta1.AnnotateImageRequest\"f\n\033Batch" + + "AnnotateImagesResponse\022G\n\tresponses\030\001 \003(" + + "\01324.google.cloud.vision.v1p3beta1.Annota" + + "teImageResponse\"\236\002\n\030AsyncAnnotateFileReq" + + "uest\022@\n\014input_config\030\001 \001(\0132*.google.clou" + + "d.vision.v1p3beta1.InputConfig\0228\n\010featur" + + "es\030\002 \003(\0132&.google.cloud.vision.v1p3beta1" + + ".Feature\022B\n\rimage_context\030\003 \001(\0132+.google" + + ".cloud.vision.v1p3beta1.ImageContext\022B\n\r" + + "output_config\030\004 \001(\0132+.google.cloud.visio" + + "n.v1p3beta1.OutputConfig\"_\n\031AsyncAnnotat" + + "eFileResponse\022B\n\routput_config\030\001 \001(\0132+.g" + + "oogle.cloud.vision.v1p3beta1.OutputConfi" + + "g\"k\n\036AsyncBatchAnnotateFilesRequest\022I\n\010r" + + "equests\030\001 \003(\01327.google.cloud.vision.v1p3" + + "beta1.AsyncAnnotateFileRequest\"n\n\037AsyncB" + + "atchAnnotateFilesResponse\022K\n\tresponses\030\001" + + " \003(\01328.google.cloud.vision.v1p3beta1.Asy" + + "ncAnnotateFileResponse\"^\n\013InputConfig\022<\n" + + "\ngcs_source\030\001 \001(\0132(.google.cloud.vision." + + "v1p3beta1.GcsSource\022\021\n\tmime_type\030\002 \001(\t\"j" + + "\n\014OutputConfig\022F\n\017gcs_destination\030\001 \001(\0132" + + "-.google.cloud.vision.v1p3beta1.GcsDesti" + + "nation\022\022\n\nbatch_size\030\002 \001(\005\"\030\n\tGcsSource\022" + + "\013\n\003uri\030\001 \001(\t\"\035\n\016GcsDestination\022\013\n\003uri\030\001 " + + "\001(\t\"\217\002\n\021OperationMetadata\022E\n\005state\030\001 \001(\016" + + "26.google.cloud.vision.v1p3beta1.Operati" + + "onMetadata.State\022/\n\013create_time\030\005 \001(\0132\032." + + "google.protobuf.Timestamp\022/\n\013update_time" + + "\030\006 \001(\0132\032.google.protobuf.Timestamp\"Q\n\005St" + + "ate\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007CREATED\020\001\022" + + "\013\n\007RUNNING\020\002\022\010\n\004DONE\020\003\022\r\n\tCANCELLED\020\004*e\n" + + "\nLikelihood\022\013\n\007UNKNOWN\020\000\022\021\n\rVERY_UNLIKEL" + + "Y\020\001\022\014\n\010UNLIKELY\020\002\022\014\n\010POSSIBLE\020\003\022\n\n\006LIKEL" + + "Y\020\004\022\017\n\013VERY_LIKELY\020\0052\360\002\n\016ImageAnnotator\022" + + "\263\001\n\023BatchAnnotateImages\0229.google.cloud.v" + + "ision.v1p3beta1.BatchAnnotateImagesReque" + + "st\032:.google.cloud.vision.v1p3beta1.Batch" + + "AnnotateImagesResponse\"%\202\323\344\223\002\037\"\032/v1p3bet" + + "a1/images:annotate:\001*\022\247\001\n\027AsyncBatchAnno" + + "tateFiles\022=.google.cloud.vision.v1p3beta" + + "1.AsyncBatchAnnotateFilesRequest\032\035.googl" + + "e.longrunning.Operation\".\202\323\344\223\002(\"#/v1p3be" + + "ta1/files:asyncBatchAnnotate:\001*B\202\001\n!com." + + "google.cloud.vision.v1p3beta1B\023ImageAnno" + + "tatorProtoP\001ZCgoogle.golang.org/genproto" + + "/googleapis/cloud/vision/v1p3beta1;visio" + + "n\370\001\001b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.vision.v1p3beta1.GeometryProto.getDescriptor(), + com.google.cloud.vision.v1p3beta1.ProductSearchProto.getDescriptor(), + com.google.cloud.vision.v1p3beta1.TextAnnotationProto.getDescriptor(), + com.google.cloud.vision.v1p3beta1.WebDetectionProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.type.ColorProto.getDescriptor(), + com.google.type.LatLngProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_vision_v1p3beta1_Feature_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_Feature_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Feature_descriptor, + new java.lang.String[] { "Type", "MaxResults", "Model", }); + internal_static_google_cloud_vision_v1p3beta1_ImageSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p3beta1_ImageSource_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ImageSource_descriptor, + new java.lang.String[] { "GcsImageUri", "ImageUri", }); + internal_static_google_cloud_vision_v1p3beta1_Image_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vision_v1p3beta1_Image_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Image_descriptor, + new java.lang.String[] { "Content", "Source", }); + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_descriptor, + new java.lang.String[] { "BoundingPoly", "FdBoundingPoly", "Landmarks", "RollAngle", "PanAngle", "TiltAngle", "DetectionConfidence", "LandmarkingConfidence", "JoyLikelihood", "SorrowLikelihood", "AngerLikelihood", "SurpriseLikelihood", "UnderExposedLikelihood", "BlurredLikelihood", "HeadwearLikelihood", }); + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_descriptor = + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_FaceAnnotation_Landmark_descriptor, + new java.lang.String[] { "Type", "Position", }); + internal_static_google_cloud_vision_v1p3beta1_LocationInfo_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vision_v1p3beta1_LocationInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_LocationInfo_descriptor, + new java.lang.String[] { "LatLng", }); + internal_static_google_cloud_vision_v1p3beta1_Property_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vision_v1p3beta1_Property_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Property_descriptor, + new java.lang.String[] { "Name", "Value", "Uint64Value", }); + internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_EntityAnnotation_descriptor, + new java.lang.String[] { "Mid", "Locale", "Description", "Score", "Confidence", "Topicality", "BoundingPoly", "Locations", "Properties", }); + internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_descriptor, + new java.lang.String[] { "Mid", "LanguageCode", "Name", "Score", "BoundingPoly", }); + internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_descriptor, + new java.lang.String[] { "Adult", "Spoof", "Medical", "Violence", "Racy", }); + internal_static_google_cloud_vision_v1p3beta1_LatLongRect_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_vision_v1p3beta1_LatLongRect_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_LatLongRect_descriptor, + new java.lang.String[] { "MinLatLng", "MaxLatLng", }); + internal_static_google_cloud_vision_v1p3beta1_ColorInfo_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_vision_v1p3beta1_ColorInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ColorInfo_descriptor, + new java.lang.String[] { "Color", "Score", "PixelFraction", }); + internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_DominantColorsAnnotation_descriptor, + new java.lang.String[] { "Colors", }); + internal_static_google_cloud_vision_v1p3beta1_ImageProperties_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_vision_v1p3beta1_ImageProperties_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ImageProperties_descriptor, + new java.lang.String[] { "DominantColors", }); + internal_static_google_cloud_vision_v1p3beta1_CropHint_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_vision_v1p3beta1_CropHint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_CropHint_descriptor, + new java.lang.String[] { "BoundingPoly", "Confidence", "ImportanceFraction", }); + internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_CropHintsAnnotation_descriptor, + new java.lang.String[] { "CropHints", }); + internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_CropHintsParams_descriptor, + new java.lang.String[] { "AspectRatios", }); + internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_descriptor, + new java.lang.String[] { "IncludeGeoResults", }); + internal_static_google_cloud_vision_v1p3beta1_ImageContext_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_vision_v1p3beta1_ImageContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ImageContext_descriptor, + new java.lang.String[] { "LatLongRect", "LanguageHints", "CropHintsParams", "ProductSearchParams", "WebDetectionParams", }); + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageRequest_descriptor, + new java.lang.String[] { "Image", "Features", "ImageContext", }); + internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ImageAnnotationContext_descriptor, + new java.lang.String[] { "Uri", "PageNumber", }); + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_AnnotateImageResponse_descriptor, + new java.lang.String[] { "FaceAnnotations", "LandmarkAnnotations", "LogoAnnotations", "LabelAnnotations", "LocalizedObjectAnnotations", "TextAnnotations", "FullTextAnnotation", "SafeSearchAnnotation", "ImagePropertiesAnnotation", "CropHintsAnnotation", "WebDetection", "ProductSearchResults", "Error", "Context", }); + internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_AnnotateFileResponse_descriptor, + new java.lang.String[] { "InputConfig", "Responses", }); + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesRequest_descriptor, + new java.lang.String[] { "Requests", }); + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_BatchAnnotateImagesResponse_descriptor, + new java.lang.String[] { "Responses", }); + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileRequest_descriptor, + new java.lang.String[] { "InputConfig", "Features", "ImageContext", "OutputConfig", }); + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_AsyncAnnotateFileResponse_descriptor, + new java.lang.String[] { "OutputConfig", }); + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesRequest_descriptor, + new java.lang.String[] { "Requests", }); + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_AsyncBatchAnnotateFilesResponse_descriptor, + new java.lang.String[] { "Responses", }); + internal_static_google_cloud_vision_v1p3beta1_InputConfig_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_vision_v1p3beta1_InputConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_InputConfig_descriptor, + new java.lang.String[] { "GcsSource", "MimeType", }); + internal_static_google_cloud_vision_v1p3beta1_OutputConfig_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_cloud_vision_v1p3beta1_OutputConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_OutputConfig_descriptor, + new java.lang.String[] { "GcsDestination", "BatchSize", }); + internal_static_google_cloud_vision_v1p3beta1_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_cloud_vision_v1p3beta1_GcsSource_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_GcsSource_descriptor, + new java.lang.String[] { "Uri", }); + internal_static_google_cloud_vision_v1p3beta1_GcsDestination_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_google_cloud_vision_v1p3beta1_GcsDestination_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_GcsDestination_descriptor, + new java.lang.String[] { "Uri", }); + internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_descriptor, + new java.lang.String[] { "State", "CreateTime", "UpdateTime", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.vision.v1p3beta1.GeometryProto.getDescriptor(); + com.google.cloud.vision.v1p3beta1.ProductSearchProto.getDescriptor(); + com.google.cloud.vision.v1p3beta1.TextAnnotationProto.getDescriptor(); + com.google.cloud.vision.v1p3beta1.WebDetectionProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.type.ColorProto.getDescriptor(); + com.google.type.LatLngProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageContext.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageContext.java new file mode 100644 index 000000000000..7e8398dd0d48 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageContext.java @@ -0,0 +1,1631 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Image context and/or feature-specific parameters.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImageContext} + */ +public final class ImageContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ImageContext) + ImageContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImageContext.newBuilder() to construct. + private ImageContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImageContext() { + languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImageContext( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.LatLongRect.Builder subBuilder = null; + if (latLongRect_ != null) { + subBuilder = latLongRect_.toBuilder(); + } + latLongRect_ = input.readMessage(com.google.cloud.vision.v1p3beta1.LatLongRect.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(latLongRect_); + latLongRect_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + languageHints_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + languageHints_.add(s); + break; + } + case 34: { + com.google.cloud.vision.v1p3beta1.CropHintsParams.Builder subBuilder = null; + if (cropHintsParams_ != null) { + subBuilder = cropHintsParams_.toBuilder(); + } + cropHintsParams_ = input.readMessage(com.google.cloud.vision.v1p3beta1.CropHintsParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cropHintsParams_); + cropHintsParams_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + com.google.cloud.vision.v1p3beta1.ProductSearchParams.Builder subBuilder = null; + if (productSearchParams_ != null) { + subBuilder = productSearchParams_.toBuilder(); + } + productSearchParams_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ProductSearchParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productSearchParams_); + productSearchParams_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + com.google.cloud.vision.v1p3beta1.WebDetectionParams.Builder subBuilder = null; + if (webDetectionParams_ != null) { + subBuilder = webDetectionParams_.toBuilder(); + } + webDetectionParams_ = input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetectionParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(webDetectionParams_); + webDetectionParams_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + languageHints_ = languageHints_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageContext_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImageContext.class, com.google.cloud.vision.v1p3beta1.ImageContext.Builder.class); + } + + private int bitField0_; + public static final int LAT_LONG_RECT_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.LatLongRect latLongRect_; + /** + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public boolean hasLatLongRect() { + return latLongRect_ != null; + } + /** + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p3beta1.LatLongRect getLatLongRect() { + return latLongRect_ == null ? com.google.cloud.vision.v1p3beta1.LatLongRect.getDefaultInstance() : latLongRect_; + } + /** + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p3beta1.LatLongRectOrBuilder getLatLongRectOrBuilder() { + return getLatLongRect(); + } + + public static final int LANGUAGE_HINTS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList languageHints_; + /** + *
+   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+   * yields the best results since it enables automatic language detection. For
+   * languages based on the Latin alphabet, setting `language_hints` is not
+   * needed. In rare cases, when the language of the text in the image is known,
+   * setting a hint will help get better results (although it will be a
+   * significant hindrance if the hint is wrong). Text detection returns an
+   * error if one or more of the specified languages is not one of the
+   * [supported languages](/vision/docs/languages).
+   * 
+ * + * repeated string language_hints = 2; + */ + public com.google.protobuf.ProtocolStringList + getLanguageHintsList() { + return languageHints_; + } + /** + *
+   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+   * yields the best results since it enables automatic language detection. For
+   * languages based on the Latin alphabet, setting `language_hints` is not
+   * needed. In rare cases, when the language of the text in the image is known,
+   * setting a hint will help get better results (although it will be a
+   * significant hindrance if the hint is wrong). Text detection returns an
+   * error if one or more of the specified languages is not one of the
+   * [supported languages](/vision/docs/languages).
+   * 
+ * + * repeated string language_hints = 2; + */ + public int getLanguageHintsCount() { + return languageHints_.size(); + } + /** + *
+   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+   * yields the best results since it enables automatic language detection. For
+   * languages based on the Latin alphabet, setting `language_hints` is not
+   * needed. In rare cases, when the language of the text in the image is known,
+   * setting a hint will help get better results (although it will be a
+   * significant hindrance if the hint is wrong). Text detection returns an
+   * error if one or more of the specified languages is not one of the
+   * [supported languages](/vision/docs/languages).
+   * 
+ * + * repeated string language_hints = 2; + */ + public java.lang.String getLanguageHints(int index) { + return languageHints_.get(index); + } + /** + *
+   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+   * yields the best results since it enables automatic language detection. For
+   * languages based on the Latin alphabet, setting `language_hints` is not
+   * needed. In rare cases, when the language of the text in the image is known,
+   * setting a hint will help get better results (although it will be a
+   * significant hindrance if the hint is wrong). Text detection returns an
+   * error if one or more of the specified languages is not one of the
+   * [supported languages](/vision/docs/languages).
+   * 
+ * + * repeated string language_hints = 2; + */ + public com.google.protobuf.ByteString + getLanguageHintsBytes(int index) { + return languageHints_.getByteString(index); + } + + public static final int CROP_HINTS_PARAMS_FIELD_NUMBER = 4; + private com.google.cloud.vision.v1p3beta1.CropHintsParams cropHintsParams_; + /** + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public boolean hasCropHintsParams() { + return cropHintsParams_ != null; + } + /** + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsParams getCropHintsParams() { + return cropHintsParams_ == null ? com.google.cloud.vision.v1p3beta1.CropHintsParams.getDefaultInstance() : cropHintsParams_; + } + /** + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsParamsOrBuilder getCropHintsParamsOrBuilder() { + return getCropHintsParams(); + } + + public static final int PRODUCT_SEARCH_PARAMS_FIELD_NUMBER = 5; + private com.google.cloud.vision.v1p3beta1.ProductSearchParams productSearchParams_; + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public boolean hasProductSearchParams() { + return productSearchParams_ != null; + } + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchParams getProductSearchParams() { + return productSearchParams_ == null ? com.google.cloud.vision.v1p3beta1.ProductSearchParams.getDefaultInstance() : productSearchParams_; + } + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder() { + return getProductSearchParams(); + } + + public static final int WEB_DETECTION_PARAMS_FIELD_NUMBER = 6; + private com.google.cloud.vision.v1p3beta1.WebDetectionParams webDetectionParams_; + /** + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public boolean hasWebDetectionParams() { + return webDetectionParams_ != null; + } + /** + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetectionParams getWebDetectionParams() { + return webDetectionParams_ == null ? com.google.cloud.vision.v1p3beta1.WebDetectionParams.getDefaultInstance() : webDetectionParams_; + } + /** + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder() { + return getWebDetectionParams(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (latLongRect_ != null) { + output.writeMessage(1, getLatLongRect()); + } + for (int i = 0; i < languageHints_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageHints_.getRaw(i)); + } + if (cropHintsParams_ != null) { + output.writeMessage(4, getCropHintsParams()); + } + if (productSearchParams_ != null) { + output.writeMessage(5, getProductSearchParams()); + } + if (webDetectionParams_ != null) { + output.writeMessage(6, getWebDetectionParams()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (latLongRect_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getLatLongRect()); + } + { + int dataSize = 0; + for (int i = 0; i < languageHints_.size(); i++) { + dataSize += computeStringSizeNoTag(languageHints_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguageHintsList().size(); + } + if (cropHintsParams_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getCropHintsParams()); + } + if (productSearchParams_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getProductSearchParams()); + } + if (webDetectionParams_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getWebDetectionParams()); + } + 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.vision.v1p3beta1.ImageContext)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ImageContext other = (com.google.cloud.vision.v1p3beta1.ImageContext) obj; + + boolean result = true; + result = result && (hasLatLongRect() == other.hasLatLongRect()); + if (hasLatLongRect()) { + result = result && getLatLongRect() + .equals(other.getLatLongRect()); + } + result = result && getLanguageHintsList() + .equals(other.getLanguageHintsList()); + result = result && (hasCropHintsParams() == other.hasCropHintsParams()); + if (hasCropHintsParams()) { + result = result && getCropHintsParams() + .equals(other.getCropHintsParams()); + } + result = result && (hasProductSearchParams() == other.hasProductSearchParams()); + if (hasProductSearchParams()) { + result = result && getProductSearchParams() + .equals(other.getProductSearchParams()); + } + result = result && (hasWebDetectionParams() == other.hasWebDetectionParams()); + if (hasWebDetectionParams()) { + result = result && getWebDetectionParams() + .equals(other.getWebDetectionParams()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasLatLongRect()) { + hash = (37 * hash) + LAT_LONG_RECT_FIELD_NUMBER; + hash = (53 * hash) + getLatLongRect().hashCode(); + } + if (getLanguageHintsCount() > 0) { + hash = (37 * hash) + LANGUAGE_HINTS_FIELD_NUMBER; + hash = (53 * hash) + getLanguageHintsList().hashCode(); + } + if (hasCropHintsParams()) { + hash = (37 * hash) + CROP_HINTS_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCropHintsParams().hashCode(); + } + if (hasProductSearchParams()) { + hash = (37 * hash) + PRODUCT_SEARCH_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getProductSearchParams().hashCode(); + } + if (hasWebDetectionParams()) { + hash = (37 * hash) + WEB_DETECTION_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getWebDetectionParams().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ImageContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageContext 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.vision.v1p3beta1.ImageContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageContext 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.vision.v1p3beta1.ImageContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ImageContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageContext 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.vision.v1p3beta1.ImageContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageContext 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.vision.v1p3beta1.ImageContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ImageContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Image context and/or feature-specific parameters.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImageContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ImageContext) + com.google.cloud.vision.v1p3beta1.ImageContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageContext_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImageContext.class, com.google.cloud.vision.v1p3beta1.ImageContext.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ImageContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (latLongRectBuilder_ == null) { + latLongRect_ = null; + } else { + latLongRect_ = null; + latLongRectBuilder_ = null; + } + languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (cropHintsParamsBuilder_ == null) { + cropHintsParams_ = null; + } else { + cropHintsParams_ = null; + cropHintsParamsBuilder_ = null; + } + if (productSearchParamsBuilder_ == null) { + productSearchParams_ = null; + } else { + productSearchParams_ = null; + productSearchParamsBuilder_ = null; + } + if (webDetectionParamsBuilder_ == null) { + webDetectionParams_ = null; + } else { + webDetectionParams_ = null; + webDetectionParamsBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageContext_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ImageContext getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ImageContext.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ImageContext build() { + com.google.cloud.vision.v1p3beta1.ImageContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ImageContext buildPartial() { + com.google.cloud.vision.v1p3beta1.ImageContext result = new com.google.cloud.vision.v1p3beta1.ImageContext(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (latLongRectBuilder_ == null) { + result.latLongRect_ = latLongRect_; + } else { + result.latLongRect_ = latLongRectBuilder_.build(); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + languageHints_ = languageHints_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.languageHints_ = languageHints_; + if (cropHintsParamsBuilder_ == null) { + result.cropHintsParams_ = cropHintsParams_; + } else { + result.cropHintsParams_ = cropHintsParamsBuilder_.build(); + } + if (productSearchParamsBuilder_ == null) { + result.productSearchParams_ = productSearchParams_; + } else { + result.productSearchParams_ = productSearchParamsBuilder_.build(); + } + if (webDetectionParamsBuilder_ == null) { + result.webDetectionParams_ = webDetectionParams_; + } else { + result.webDetectionParams_ = webDetectionParamsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ImageContext) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ImageContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ImageContext other) { + if (other == com.google.cloud.vision.v1p3beta1.ImageContext.getDefaultInstance()) return this; + if (other.hasLatLongRect()) { + mergeLatLongRect(other.getLatLongRect()); + } + if (!other.languageHints_.isEmpty()) { + if (languageHints_.isEmpty()) { + languageHints_ = other.languageHints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLanguageHintsIsMutable(); + languageHints_.addAll(other.languageHints_); + } + onChanged(); + } + if (other.hasCropHintsParams()) { + mergeCropHintsParams(other.getCropHintsParams()); + } + if (other.hasProductSearchParams()) { + mergeProductSearchParams(other.getProductSearchParams()); + } + if (other.hasWebDetectionParams()) { + mergeWebDetectionParams(other.getWebDetectionParams()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ImageContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ImageContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.LatLongRect latLongRect_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LatLongRect, com.google.cloud.vision.v1p3beta1.LatLongRect.Builder, com.google.cloud.vision.v1p3beta1.LatLongRectOrBuilder> latLongRectBuilder_; + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public boolean hasLatLongRect() { + return latLongRectBuilder_ != null || latLongRect_ != null; + } + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p3beta1.LatLongRect getLatLongRect() { + if (latLongRectBuilder_ == null) { + return latLongRect_ == null ? com.google.cloud.vision.v1p3beta1.LatLongRect.getDefaultInstance() : latLongRect_; + } else { + return latLongRectBuilder_.getMessage(); + } + } + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public Builder setLatLongRect(com.google.cloud.vision.v1p3beta1.LatLongRect value) { + if (latLongRectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latLongRect_ = value; + onChanged(); + } else { + latLongRectBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public Builder setLatLongRect( + com.google.cloud.vision.v1p3beta1.LatLongRect.Builder builderForValue) { + if (latLongRectBuilder_ == null) { + latLongRect_ = builderForValue.build(); + onChanged(); + } else { + latLongRectBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public Builder mergeLatLongRect(com.google.cloud.vision.v1p3beta1.LatLongRect value) { + if (latLongRectBuilder_ == null) { + if (latLongRect_ != null) { + latLongRect_ = + com.google.cloud.vision.v1p3beta1.LatLongRect.newBuilder(latLongRect_).mergeFrom(value).buildPartial(); + } else { + latLongRect_ = value; + } + onChanged(); + } else { + latLongRectBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public Builder clearLatLongRect() { + if (latLongRectBuilder_ == null) { + latLongRect_ = null; + onChanged(); + } else { + latLongRect_ = null; + latLongRectBuilder_ = null; + } + + return this; + } + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p3beta1.LatLongRect.Builder getLatLongRectBuilder() { + + onChanged(); + return getLatLongRectFieldBuilder().getBuilder(); + } + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p3beta1.LatLongRectOrBuilder getLatLongRectOrBuilder() { + if (latLongRectBuilder_ != null) { + return latLongRectBuilder_.getMessageOrBuilder(); + } else { + return latLongRect_ == null ? + com.google.cloud.vision.v1p3beta1.LatLongRect.getDefaultInstance() : latLongRect_; + } + } + /** + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LatLongRect, com.google.cloud.vision.v1p3beta1.LatLongRect.Builder, com.google.cloud.vision.v1p3beta1.LatLongRectOrBuilder> + getLatLongRectFieldBuilder() { + if (latLongRectBuilder_ == null) { + latLongRectBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.LatLongRect, com.google.cloud.vision.v1p3beta1.LatLongRect.Builder, com.google.cloud.vision.v1p3beta1.LatLongRectOrBuilder>( + getLatLongRect(), + getParentForChildren(), + isClean()); + latLongRect_ = null; + } + return latLongRectBuilder_; + } + + private com.google.protobuf.LazyStringList languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureLanguageHintsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + languageHints_ = new com.google.protobuf.LazyStringArrayList(languageHints_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public com.google.protobuf.ProtocolStringList + getLanguageHintsList() { + return languageHints_.getUnmodifiableView(); + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public int getLanguageHintsCount() { + return languageHints_.size(); + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public java.lang.String getLanguageHints(int index) { + return languageHints_.get(index); + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public com.google.protobuf.ByteString + getLanguageHintsBytes(int index) { + return languageHints_.getByteString(index); + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public Builder setLanguageHints( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageHintsIsMutable(); + languageHints_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public Builder addLanguageHints( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageHintsIsMutable(); + languageHints_.add(value); + onChanged(); + return this; + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public Builder addAllLanguageHints( + java.lang.Iterable values) { + ensureLanguageHintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, languageHints_); + onChanged(); + return this; + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public Builder clearLanguageHints() { + languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+     * yields the best results since it enables automatic language detection. For
+     * languages based on the Latin alphabet, setting `language_hints` is not
+     * needed. In rare cases, when the language of the text in the image is known,
+     * setting a hint will help get better results (although it will be a
+     * significant hindrance if the hint is wrong). Text detection returns an
+     * error if one or more of the specified languages is not one of the
+     * [supported languages](/vision/docs/languages).
+     * 
+ * + * repeated string language_hints = 2; + */ + public Builder addLanguageHintsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguageHintsIsMutable(); + languageHints_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.vision.v1p3beta1.CropHintsParams cropHintsParams_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHintsParams, com.google.cloud.vision.v1p3beta1.CropHintsParams.Builder, com.google.cloud.vision.v1p3beta1.CropHintsParamsOrBuilder> cropHintsParamsBuilder_; + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public boolean hasCropHintsParams() { + return cropHintsParamsBuilder_ != null || cropHintsParams_ != null; + } + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsParams getCropHintsParams() { + if (cropHintsParamsBuilder_ == null) { + return cropHintsParams_ == null ? com.google.cloud.vision.v1p3beta1.CropHintsParams.getDefaultInstance() : cropHintsParams_; + } else { + return cropHintsParamsBuilder_.getMessage(); + } + } + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public Builder setCropHintsParams(com.google.cloud.vision.v1p3beta1.CropHintsParams value) { + if (cropHintsParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cropHintsParams_ = value; + onChanged(); + } else { + cropHintsParamsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public Builder setCropHintsParams( + com.google.cloud.vision.v1p3beta1.CropHintsParams.Builder builderForValue) { + if (cropHintsParamsBuilder_ == null) { + cropHintsParams_ = builderForValue.build(); + onChanged(); + } else { + cropHintsParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public Builder mergeCropHintsParams(com.google.cloud.vision.v1p3beta1.CropHintsParams value) { + if (cropHintsParamsBuilder_ == null) { + if (cropHintsParams_ != null) { + cropHintsParams_ = + com.google.cloud.vision.v1p3beta1.CropHintsParams.newBuilder(cropHintsParams_).mergeFrom(value).buildPartial(); + } else { + cropHintsParams_ = value; + } + onChanged(); + } else { + cropHintsParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public Builder clearCropHintsParams() { + if (cropHintsParamsBuilder_ == null) { + cropHintsParams_ = null; + onChanged(); + } else { + cropHintsParams_ = null; + cropHintsParamsBuilder_ = null; + } + + return this; + } + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsParams.Builder getCropHintsParamsBuilder() { + + onChanged(); + return getCropHintsParamsFieldBuilder().getBuilder(); + } + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p3beta1.CropHintsParamsOrBuilder getCropHintsParamsOrBuilder() { + if (cropHintsParamsBuilder_ != null) { + return cropHintsParamsBuilder_.getMessageOrBuilder(); + } else { + return cropHintsParams_ == null ? + com.google.cloud.vision.v1p3beta1.CropHintsParams.getDefaultInstance() : cropHintsParams_; + } + } + /** + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHintsParams, com.google.cloud.vision.v1p3beta1.CropHintsParams.Builder, com.google.cloud.vision.v1p3beta1.CropHintsParamsOrBuilder> + getCropHintsParamsFieldBuilder() { + if (cropHintsParamsBuilder_ == null) { + cropHintsParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.CropHintsParams, com.google.cloud.vision.v1p3beta1.CropHintsParams.Builder, com.google.cloud.vision.v1p3beta1.CropHintsParamsOrBuilder>( + getCropHintsParams(), + getParentForChildren(), + isClean()); + cropHintsParams_ = null; + } + return cropHintsParamsBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.ProductSearchParams productSearchParams_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchParams, com.google.cloud.vision.v1p3beta1.ProductSearchParams.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchParamsOrBuilder> productSearchParamsBuilder_; + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public boolean hasProductSearchParams() { + return productSearchParamsBuilder_ != null || productSearchParams_ != null; + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchParams getProductSearchParams() { + if (productSearchParamsBuilder_ == null) { + return productSearchParams_ == null ? com.google.cloud.vision.v1p3beta1.ProductSearchParams.getDefaultInstance() : productSearchParams_; + } else { + return productSearchParamsBuilder_.getMessage(); + } + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public Builder setProductSearchParams(com.google.cloud.vision.v1p3beta1.ProductSearchParams value) { + if (productSearchParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productSearchParams_ = value; + onChanged(); + } else { + productSearchParamsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public Builder setProductSearchParams( + com.google.cloud.vision.v1p3beta1.ProductSearchParams.Builder builderForValue) { + if (productSearchParamsBuilder_ == null) { + productSearchParams_ = builderForValue.build(); + onChanged(); + } else { + productSearchParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public Builder mergeProductSearchParams(com.google.cloud.vision.v1p3beta1.ProductSearchParams value) { + if (productSearchParamsBuilder_ == null) { + if (productSearchParams_ != null) { + productSearchParams_ = + com.google.cloud.vision.v1p3beta1.ProductSearchParams.newBuilder(productSearchParams_).mergeFrom(value).buildPartial(); + } else { + productSearchParams_ = value; + } + onChanged(); + } else { + productSearchParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public Builder clearProductSearchParams() { + if (productSearchParamsBuilder_ == null) { + productSearchParams_ = null; + onChanged(); + } else { + productSearchParams_ = null; + productSearchParamsBuilder_ = null; + } + + return this; + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchParams.Builder getProductSearchParamsBuilder() { + + onChanged(); + return getProductSearchParamsFieldBuilder().getBuilder(); + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder() { + if (productSearchParamsBuilder_ != null) { + return productSearchParamsBuilder_.getMessageOrBuilder(); + } else { + return productSearchParams_ == null ? + com.google.cloud.vision.v1p3beta1.ProductSearchParams.getDefaultInstance() : productSearchParams_; + } + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchParams, com.google.cloud.vision.v1p3beta1.ProductSearchParams.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchParamsOrBuilder> + getProductSearchParamsFieldBuilder() { + if (productSearchParamsBuilder_ == null) { + productSearchParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchParams, com.google.cloud.vision.v1p3beta1.ProductSearchParams.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchParamsOrBuilder>( + getProductSearchParams(), + getParentForChildren(), + isClean()); + productSearchParams_ = null; + } + return productSearchParamsBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.WebDetectionParams webDetectionParams_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetectionParams, com.google.cloud.vision.v1p3beta1.WebDetectionParams.Builder, com.google.cloud.vision.v1p3beta1.WebDetectionParamsOrBuilder> webDetectionParamsBuilder_; + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public boolean hasWebDetectionParams() { + return webDetectionParamsBuilder_ != null || webDetectionParams_ != null; + } + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetectionParams getWebDetectionParams() { + if (webDetectionParamsBuilder_ == null) { + return webDetectionParams_ == null ? com.google.cloud.vision.v1p3beta1.WebDetectionParams.getDefaultInstance() : webDetectionParams_; + } else { + return webDetectionParamsBuilder_.getMessage(); + } + } + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public Builder setWebDetectionParams(com.google.cloud.vision.v1p3beta1.WebDetectionParams value) { + if (webDetectionParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + webDetectionParams_ = value; + onChanged(); + } else { + webDetectionParamsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public Builder setWebDetectionParams( + com.google.cloud.vision.v1p3beta1.WebDetectionParams.Builder builderForValue) { + if (webDetectionParamsBuilder_ == null) { + webDetectionParams_ = builderForValue.build(); + onChanged(); + } else { + webDetectionParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public Builder mergeWebDetectionParams(com.google.cloud.vision.v1p3beta1.WebDetectionParams value) { + if (webDetectionParamsBuilder_ == null) { + if (webDetectionParams_ != null) { + webDetectionParams_ = + com.google.cloud.vision.v1p3beta1.WebDetectionParams.newBuilder(webDetectionParams_).mergeFrom(value).buildPartial(); + } else { + webDetectionParams_ = value; + } + onChanged(); + } else { + webDetectionParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public Builder clearWebDetectionParams() { + if (webDetectionParamsBuilder_ == null) { + webDetectionParams_ = null; + onChanged(); + } else { + webDetectionParams_ = null; + webDetectionParamsBuilder_ = null; + } + + return this; + } + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetectionParams.Builder getWebDetectionParamsBuilder() { + + onChanged(); + return getWebDetectionParamsFieldBuilder().getBuilder(); + } + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder() { + if (webDetectionParamsBuilder_ != null) { + return webDetectionParamsBuilder_.getMessageOrBuilder(); + } else { + return webDetectionParams_ == null ? + com.google.cloud.vision.v1p3beta1.WebDetectionParams.getDefaultInstance() : webDetectionParams_; + } + } + /** + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetectionParams, com.google.cloud.vision.v1p3beta1.WebDetectionParams.Builder, com.google.cloud.vision.v1p3beta1.WebDetectionParamsOrBuilder> + getWebDetectionParamsFieldBuilder() { + if (webDetectionParamsBuilder_ == null) { + webDetectionParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetectionParams, com.google.cloud.vision.v1p3beta1.WebDetectionParams.Builder, com.google.cloud.vision.v1p3beta1.WebDetectionParamsOrBuilder>( + getWebDetectionParams(), + getParentForChildren(), + isClean()); + webDetectionParams_ = null; + } + return webDetectionParamsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ImageContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImageContext) + private static final com.google.cloud.vision.v1p3beta1.ImageContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ImageContext(); + } + + public static com.google.cloud.vision.v1p3beta1.ImageContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImageContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ImageContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageContextOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageContextOrBuilder.java new file mode 100644 index 000000000000..9c180a65856e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageContextOrBuilder.java @@ -0,0 +1,172 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImageContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ImageContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + boolean hasLatLongRect(); + /** + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + com.google.cloud.vision.v1p3beta1.LatLongRect getLatLongRect(); + /** + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.LatLongRect lat_long_rect = 1; + */ + com.google.cloud.vision.v1p3beta1.LatLongRectOrBuilder getLatLongRectOrBuilder(); + + /** + *
+   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+   * yields the best results since it enables automatic language detection. For
+   * languages based on the Latin alphabet, setting `language_hints` is not
+   * needed. In rare cases, when the language of the text in the image is known,
+   * setting a hint will help get better results (although it will be a
+   * significant hindrance if the hint is wrong). Text detection returns an
+   * error if one or more of the specified languages is not one of the
+   * [supported languages](/vision/docs/languages).
+   * 
+ * + * repeated string language_hints = 2; + */ + java.util.List + getLanguageHintsList(); + /** + *
+   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+   * yields the best results since it enables automatic language detection. For
+   * languages based on the Latin alphabet, setting `language_hints` is not
+   * needed. In rare cases, when the language of the text in the image is known,
+   * setting a hint will help get better results (although it will be a
+   * significant hindrance if the hint is wrong). Text detection returns an
+   * error if one or more of the specified languages is not one of the
+   * [supported languages](/vision/docs/languages).
+   * 
+ * + * repeated string language_hints = 2; + */ + int getLanguageHintsCount(); + /** + *
+   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+   * yields the best results since it enables automatic language detection. For
+   * languages based on the Latin alphabet, setting `language_hints` is not
+   * needed. In rare cases, when the language of the text in the image is known,
+   * setting a hint will help get better results (although it will be a
+   * significant hindrance if the hint is wrong). Text detection returns an
+   * error if one or more of the specified languages is not one of the
+   * [supported languages](/vision/docs/languages).
+   * 
+ * + * repeated string language_hints = 2; + */ + java.lang.String getLanguageHints(int index); + /** + *
+   * List of languages to use for TEXT_DETECTION. In most cases, an empty value
+   * yields the best results since it enables automatic language detection. For
+   * languages based on the Latin alphabet, setting `language_hints` is not
+   * needed. In rare cases, when the language of the text in the image is known,
+   * setting a hint will help get better results (although it will be a
+   * significant hindrance if the hint is wrong). Text detection returns an
+   * error if one or more of the specified languages is not one of the
+   * [supported languages](/vision/docs/languages).
+   * 
+ * + * repeated string language_hints = 2; + */ + com.google.protobuf.ByteString + getLanguageHintsBytes(int index); + + /** + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + boolean hasCropHintsParams(); + /** + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + com.google.cloud.vision.v1p3beta1.CropHintsParams getCropHintsParams(); + /** + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.CropHintsParams crop_hints_params = 4; + */ + com.google.cloud.vision.v1p3beta1.CropHintsParamsOrBuilder getCropHintsParamsOrBuilder(); + + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + boolean hasProductSearchParams(); + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchParams getProductSearchParams(); + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder(); + + /** + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + boolean hasWebDetectionParams(); + /** + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + com.google.cloud.vision.v1p3beta1.WebDetectionParams getWebDetectionParams(); + /** + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.WebDetectionParams web_detection_params = 6; + */ + com.google.cloud.vision.v1p3beta1.WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageOrBuilder.java new file mode 100644 index 000000000000..89e411f23a47 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageOrBuilder.java @@ -0,0 +1,51 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Image) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Image content, represented as a stream of bytes.
+   * Note: As with all `bytes` fields, protobuffers use a pure binary
+   * representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + */ + com.google.protobuf.ByteString getContent(); + + /** + *
+   * Google Cloud Storage image location, or publicly-accessible image
+   * URL. If both `content` and `source` are provided for an image, `content`
+   * takes precedence and is used to perform the image annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + boolean hasSource(); + /** + *
+   * Google Cloud Storage image location, or publicly-accessible image
+   * URL. If both `content` and `source` are provided for an image, `content`
+   * takes precedence and is used to perform the image annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + com.google.cloud.vision.v1p3beta1.ImageSource getSource(); + /** + *
+   * Google Cloud Storage image location, or publicly-accessible image
+   * URL. If both `content` and `source` are provided for an image, `content`
+   * takes precedence and is used to perform the image annotation request.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImageSource source = 2; + */ + com.google.cloud.vision.v1p3beta1.ImageSourceOrBuilder getSourceOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageProperties.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageProperties.java new file mode 100644 index 000000000000..d49c7bda6c8b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageProperties.java @@ -0,0 +1,626 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Stores image properties, such as dominant colors.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImageProperties} + */ +public final class ImageProperties extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ImageProperties) + ImagePropertiesOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImageProperties.newBuilder() to construct. + private ImageProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImageProperties() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImageProperties( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.Builder subBuilder = null; + if (dominantColors_ != null) { + subBuilder = dominantColors_.toBuilder(); + } + dominantColors_ = input.readMessage(com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dominantColors_); + dominantColors_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageProperties_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImageProperties.class, com.google.cloud.vision.v1p3beta1.ImageProperties.Builder.class); + } + + public static final int DOMINANT_COLORS_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominantColors_; + /** + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public boolean hasDominantColors() { + return dominantColors_ != null; + } + /** + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation getDominantColors() { + return dominantColors_ == null ? com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.getDefaultInstance() : dominantColors_; + } + /** + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotationOrBuilder getDominantColorsOrBuilder() { + return getDominantColors(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (dominantColors_ != null) { + output.writeMessage(1, getDominantColors()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dominantColors_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getDominantColors()); + } + 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.vision.v1p3beta1.ImageProperties)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ImageProperties other = (com.google.cloud.vision.v1p3beta1.ImageProperties) obj; + + boolean result = true; + result = result && (hasDominantColors() == other.hasDominantColors()); + if (hasDominantColors()) { + result = result && getDominantColors() + .equals(other.getDominantColors()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDominantColors()) { + hash = (37 * hash) + DOMINANT_COLORS_FIELD_NUMBER; + hash = (53 * hash) + getDominantColors().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ImageProperties parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageProperties 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.vision.v1p3beta1.ImageProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageProperties 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.vision.v1p3beta1.ImageProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageProperties parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ImageProperties parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageProperties 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.vision.v1p3beta1.ImageProperties parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageProperties 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.vision.v1p3beta1.ImageProperties parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageProperties parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ImageProperties prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Stores image properties, such as dominant colors.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImageProperties} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ImageProperties) + com.google.cloud.vision.v1p3beta1.ImagePropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageProperties_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImageProperties.class, com.google.cloud.vision.v1p3beta1.ImageProperties.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ImageProperties.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (dominantColorsBuilder_ == null) { + dominantColors_ = null; + } else { + dominantColors_ = null; + dominantColorsBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageProperties_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ImageProperties getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ImageProperties.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ImageProperties build() { + com.google.cloud.vision.v1p3beta1.ImageProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ImageProperties buildPartial() { + com.google.cloud.vision.v1p3beta1.ImageProperties result = new com.google.cloud.vision.v1p3beta1.ImageProperties(this); + if (dominantColorsBuilder_ == null) { + result.dominantColors_ = dominantColors_; + } else { + result.dominantColors_ = dominantColorsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ImageProperties) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ImageProperties)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ImageProperties other) { + if (other == com.google.cloud.vision.v1p3beta1.ImageProperties.getDefaultInstance()) return this; + if (other.hasDominantColors()) { + mergeDominantColors(other.getDominantColors()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ImageProperties parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ImageProperties) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominantColors_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation, com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.Builder, com.google.cloud.vision.v1p3beta1.DominantColorsAnnotationOrBuilder> dominantColorsBuilder_; + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public boolean hasDominantColors() { + return dominantColorsBuilder_ != null || dominantColors_ != null; + } + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation getDominantColors() { + if (dominantColorsBuilder_ == null) { + return dominantColors_ == null ? com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.getDefaultInstance() : dominantColors_; + } else { + return dominantColorsBuilder_.getMessage(); + } + } + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public Builder setDominantColors(com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation value) { + if (dominantColorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dominantColors_ = value; + onChanged(); + } else { + dominantColorsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public Builder setDominantColors( + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.Builder builderForValue) { + if (dominantColorsBuilder_ == null) { + dominantColors_ = builderForValue.build(); + onChanged(); + } else { + dominantColorsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public Builder mergeDominantColors(com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation value) { + if (dominantColorsBuilder_ == null) { + if (dominantColors_ != null) { + dominantColors_ = + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.newBuilder(dominantColors_).mergeFrom(value).buildPartial(); + } else { + dominantColors_ = value; + } + onChanged(); + } else { + dominantColorsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public Builder clearDominantColors() { + if (dominantColorsBuilder_ == null) { + dominantColors_ = null; + onChanged(); + } else { + dominantColors_ = null; + dominantColorsBuilder_ = null; + } + + return this; + } + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.Builder getDominantColorsBuilder() { + + onChanged(); + return getDominantColorsFieldBuilder().getBuilder(); + } + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p3beta1.DominantColorsAnnotationOrBuilder getDominantColorsOrBuilder() { + if (dominantColorsBuilder_ != null) { + return dominantColorsBuilder_.getMessageOrBuilder(); + } else { + return dominantColors_ == null ? + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.getDefaultInstance() : dominantColors_; + } + } + /** + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation, com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.Builder, com.google.cloud.vision.v1p3beta1.DominantColorsAnnotationOrBuilder> + getDominantColorsFieldBuilder() { + if (dominantColorsBuilder_ == null) { + dominantColorsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation, com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.Builder, com.google.cloud.vision.v1p3beta1.DominantColorsAnnotationOrBuilder>( + getDominantColors(), + getParentForChildren(), + isClean()); + dominantColors_ = null; + } + return dominantColorsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ImageProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImageProperties) + private static final com.google.cloud.vision.v1p3beta1.ImageProperties DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ImageProperties(); + } + + public static com.google.cloud.vision.v1p3beta1.ImageProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImageProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageProperties(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ImageProperties getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImagePropertiesOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImagePropertiesOrBuilder.java new file mode 100644 index 000000000000..13163cdf6a70 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImagePropertiesOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImagePropertiesOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ImageProperties) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + boolean hasDominantColors(); + /** + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotation getDominantColors(); + /** + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.DominantColorsAnnotation dominant_colors = 1; + */ + com.google.cloud.vision.v1p3beta1.DominantColorsAnnotationOrBuilder getDominantColorsOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageSource.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageSource.java new file mode 100644 index 000000000000..184fa25e03e1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageSource.java @@ -0,0 +1,826 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * External image source (Google Cloud Storage or web URL image location).
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImageSource} + */ +public final class ImageSource extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ImageSource) + ImageSourceOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImageSource.newBuilder() to construct. + private ImageSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImageSource() { + gcsImageUri_ = ""; + imageUri_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImageSource( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + gcsImageUri_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + imageUri_ = s; + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageSource_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImageSource.class, com.google.cloud.vision.v1p3beta1.ImageSource.Builder.class); + } + + public static final int GCS_IMAGE_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object gcsImageUri_; + /** + *
+   * **Use `image_uri` instead.**
+   * The Google Cloud Storage  URI of the form
+   * `gs://bucket_name/object_name`. Object versioning is not supported. See
+   * [Google Cloud Storage Request
+   * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+   * 
+ * + * string gcs_image_uri = 1; + */ + public java.lang.String getGcsImageUri() { + java.lang.Object ref = gcsImageUri_; + 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(); + gcsImageUri_ = s; + return s; + } + } + /** + *
+   * **Use `image_uri` instead.**
+   * The Google Cloud Storage  URI of the form
+   * `gs://bucket_name/object_name`. Object versioning is not supported. See
+   * [Google Cloud Storage Request
+   * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+   * 
+ * + * string gcs_image_uri = 1; + */ + public com.google.protobuf.ByteString + getGcsImageUriBytes() { + java.lang.Object ref = gcsImageUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gcsImageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGE_URI_FIELD_NUMBER = 2; + private volatile java.lang.Object imageUri_; + /** + *
+   * The URI of the source image. Can be either:
+   * 1. A Google Cloud Storage URI of the form
+   *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+   *    [Google Cloud Storage Request
+   *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+   *    info.
+   * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+   *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+   *    completed. Your request may fail if the specified host denies the
+   *    request (e.g. due to request throttling or DOS prevention), or if Google
+   *    throttles requests to the site for abuse prevention. You should not
+   *    depend on externally-hosted images for production applications.
+   * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+   * precedence.
+   * 
+ * + * string image_uri = 2; + */ + public java.lang.String getImageUri() { + java.lang.Object ref = imageUri_; + 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(); + imageUri_ = s; + return s; + } + } + /** + *
+   * The URI of the source image. Can be either:
+   * 1. A Google Cloud Storage URI of the form
+   *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+   *    [Google Cloud Storage Request
+   *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+   *    info.
+   * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+   *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+   *    completed. Your request may fail if the specified host denies the
+   *    request (e.g. due to request throttling or DOS prevention), or if Google
+   *    throttles requests to the site for abuse prevention. You should not
+   *    depend on externally-hosted images for production applications.
+   * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+   * precedence.
+   * 
+ * + * string image_uri = 2; + */ + public com.google.protobuf.ByteString + getImageUriBytes() { + java.lang.Object ref = imageUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + imageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getGcsImageUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gcsImageUri_); + } + if (!getImageUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, imageUri_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getGcsImageUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gcsImageUri_); + } + if (!getImageUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, imageUri_); + } + 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.vision.v1p3beta1.ImageSource)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ImageSource other = (com.google.cloud.vision.v1p3beta1.ImageSource) obj; + + boolean result = true; + result = result && getGcsImageUri() + .equals(other.getGcsImageUri()); + result = result && getImageUri() + .equals(other.getImageUri()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + GCS_IMAGE_URI_FIELD_NUMBER; + hash = (53 * hash) + getGcsImageUri().hashCode(); + hash = (37 * hash) + IMAGE_URI_FIELD_NUMBER; + hash = (53 * hash) + getImageUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ImageSource parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageSource 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.vision.v1p3beta1.ImageSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageSource 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.vision.v1p3beta1.ImageSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImageSource parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ImageSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageSource 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.vision.v1p3beta1.ImageSource parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageSource 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.vision.v1p3beta1.ImageSource parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImageSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ImageSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * External image source (Google Cloud Storage or web URL image location).
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImageSource} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ImageSource) + com.google.cloud.vision.v1p3beta1.ImageSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageSource_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImageSource.class, com.google.cloud.vision.v1p3beta1.ImageSource.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ImageSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + gcsImageUri_ = ""; + + imageUri_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_ImageSource_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ImageSource getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ImageSource.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ImageSource build() { + com.google.cloud.vision.v1p3beta1.ImageSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ImageSource buildPartial() { + com.google.cloud.vision.v1p3beta1.ImageSource result = new com.google.cloud.vision.v1p3beta1.ImageSource(this); + result.gcsImageUri_ = gcsImageUri_; + result.imageUri_ = imageUri_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ImageSource) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ImageSource)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ImageSource other) { + if (other == com.google.cloud.vision.v1p3beta1.ImageSource.getDefaultInstance()) return this; + if (!other.getGcsImageUri().isEmpty()) { + gcsImageUri_ = other.gcsImageUri_; + onChanged(); + } + if (!other.getImageUri().isEmpty()) { + imageUri_ = other.imageUri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ImageSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ImageSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object gcsImageUri_ = ""; + /** + *
+     * **Use `image_uri` instead.**
+     * The Google Cloud Storage  URI of the form
+     * `gs://bucket_name/object_name`. Object versioning is not supported. See
+     * [Google Cloud Storage Request
+     * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+     * 
+ * + * string gcs_image_uri = 1; + */ + public java.lang.String getGcsImageUri() { + java.lang.Object ref = gcsImageUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcsImageUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * **Use `image_uri` instead.**
+     * The Google Cloud Storage  URI of the form
+     * `gs://bucket_name/object_name`. Object versioning is not supported. See
+     * [Google Cloud Storage Request
+     * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+     * 
+ * + * string gcs_image_uri = 1; + */ + public com.google.protobuf.ByteString + getGcsImageUriBytes() { + java.lang.Object ref = gcsImageUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gcsImageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * **Use `image_uri` instead.**
+     * The Google Cloud Storage  URI of the form
+     * `gs://bucket_name/object_name`. Object versioning is not supported. See
+     * [Google Cloud Storage Request
+     * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+     * 
+ * + * string gcs_image_uri = 1; + */ + public Builder setGcsImageUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gcsImageUri_ = value; + onChanged(); + return this; + } + /** + *
+     * **Use `image_uri` instead.**
+     * The Google Cloud Storage  URI of the form
+     * `gs://bucket_name/object_name`. Object versioning is not supported. See
+     * [Google Cloud Storage Request
+     * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+     * 
+ * + * string gcs_image_uri = 1; + */ + public Builder clearGcsImageUri() { + + gcsImageUri_ = getDefaultInstance().getGcsImageUri(); + onChanged(); + return this; + } + /** + *
+     * **Use `image_uri` instead.**
+     * The Google Cloud Storage  URI of the form
+     * `gs://bucket_name/object_name`. Object versioning is not supported. See
+     * [Google Cloud Storage Request
+     * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+     * 
+ * + * string gcs_image_uri = 1; + */ + public Builder setGcsImageUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gcsImageUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object imageUri_ = ""; + /** + *
+     * The URI of the source image. Can be either:
+     * 1. A Google Cloud Storage URI of the form
+     *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+     *    [Google Cloud Storage Request
+     *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+     *    info.
+     * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+     *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+     *    completed. Your request may fail if the specified host denies the
+     *    request (e.g. due to request throttling or DOS prevention), or if Google
+     *    throttles requests to the site for abuse prevention. You should not
+     *    depend on externally-hosted images for production applications.
+     * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+     * precedence.
+     * 
+ * + * string image_uri = 2; + */ + public java.lang.String getImageUri() { + java.lang.Object ref = imageUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + imageUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URI of the source image. Can be either:
+     * 1. A Google Cloud Storage URI of the form
+     *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+     *    [Google Cloud Storage Request
+     *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+     *    info.
+     * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+     *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+     *    completed. Your request may fail if the specified host denies the
+     *    request (e.g. due to request throttling or DOS prevention), or if Google
+     *    throttles requests to the site for abuse prevention. You should not
+     *    depend on externally-hosted images for production applications.
+     * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+     * precedence.
+     * 
+ * + * string image_uri = 2; + */ + public com.google.protobuf.ByteString + getImageUriBytes() { + java.lang.Object ref = imageUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + imageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URI of the source image. Can be either:
+     * 1. A Google Cloud Storage URI of the form
+     *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+     *    [Google Cloud Storage Request
+     *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+     *    info.
+     * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+     *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+     *    completed. Your request may fail if the specified host denies the
+     *    request (e.g. due to request throttling or DOS prevention), or if Google
+     *    throttles requests to the site for abuse prevention. You should not
+     *    depend on externally-hosted images for production applications.
+     * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+     * precedence.
+     * 
+ * + * string image_uri = 2; + */ + public Builder setImageUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + imageUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The URI of the source image. Can be either:
+     * 1. A Google Cloud Storage URI of the form
+     *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+     *    [Google Cloud Storage Request
+     *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+     *    info.
+     * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+     *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+     *    completed. Your request may fail if the specified host denies the
+     *    request (e.g. due to request throttling or DOS prevention), or if Google
+     *    throttles requests to the site for abuse prevention. You should not
+     *    depend on externally-hosted images for production applications.
+     * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+     * precedence.
+     * 
+ * + * string image_uri = 2; + */ + public Builder clearImageUri() { + + imageUri_ = getDefaultInstance().getImageUri(); + onChanged(); + return this; + } + /** + *
+     * The URI of the source image. Can be either:
+     * 1. A Google Cloud Storage URI of the form
+     *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+     *    [Google Cloud Storage Request
+     *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+     *    info.
+     * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+     *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+     *    completed. Your request may fail if the specified host denies the
+     *    request (e.g. due to request throttling or DOS prevention), or if Google
+     *    throttles requests to the site for abuse prevention. You should not
+     *    depend on externally-hosted images for production applications.
+     * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+     * precedence.
+     * 
+ * + * string image_uri = 2; + */ + public Builder setImageUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + imageUri_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ImageSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImageSource) + private static final com.google.cloud.vision.v1p3beta1.ImageSource DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ImageSource(); + } + + public static com.google.cloud.vision.v1p3beta1.ImageSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImageSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ImageSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageSourceOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageSourceOrBuilder.java new file mode 100644 index 000000000000..c02f0e265e58 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImageSourceOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImageSourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ImageSource) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * **Use `image_uri` instead.**
+   * The Google Cloud Storage  URI of the form
+   * `gs://bucket_name/object_name`. Object versioning is not supported. See
+   * [Google Cloud Storage Request
+   * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+   * 
+ * + * string gcs_image_uri = 1; + */ + java.lang.String getGcsImageUri(); + /** + *
+   * **Use `image_uri` instead.**
+   * The Google Cloud Storage  URI of the form
+   * `gs://bucket_name/object_name`. Object versioning is not supported. See
+   * [Google Cloud Storage Request
+   * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
+   * 
+ * + * string gcs_image_uri = 1; + */ + com.google.protobuf.ByteString + getGcsImageUriBytes(); + + /** + *
+   * The URI of the source image. Can be either:
+   * 1. A Google Cloud Storage URI of the form
+   *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+   *    [Google Cloud Storage Request
+   *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+   *    info.
+   * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+   *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+   *    completed. Your request may fail if the specified host denies the
+   *    request (e.g. due to request throttling or DOS prevention), or if Google
+   *    throttles requests to the site for abuse prevention. You should not
+   *    depend on externally-hosted images for production applications.
+   * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+   * precedence.
+   * 
+ * + * string image_uri = 2; + */ + java.lang.String getImageUri(); + /** + *
+   * The URI of the source image. Can be either:
+   * 1. A Google Cloud Storage URI of the form
+   *    `gs://bucket_name/object_name`. Object versioning is not supported. See
+   *    [Google Cloud Storage Request
+   *    URIs](https://cloud.google.com/storage/docs/reference-uris) for more
+   *    info.
+   * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
+   *    HTTP/HTTPS URLs, Google cannot guarantee that the request will be
+   *    completed. Your request may fail if the specified host denies the
+   *    request (e.g. due to request throttling or DOS prevention), or if Google
+   *    throttles requests to the site for abuse prevention. You should not
+   *    depend on externally-hosted images for production applications.
+   * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
+   * precedence.
+   * 
+ * + * string image_uri = 2; + */ + com.google.protobuf.ByteString + getImageUriBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsGcsSource.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsGcsSource.java new file mode 100644 index 000000000000..0274cfefe7eb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsGcsSource.java @@ -0,0 +1,848 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * The Google Cloud Storage location for a csv file which preserves a list of
+ * ImportProductSetRequests in each line.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource} + */ +public final class ImportProductSetsGcsSource extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) + ImportProductSetsGcsSourceOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImportProductSetsGcsSource.newBuilder() to construct. + private ImportProductSetsGcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImportProductSetsGcsSource() { + csvFileUri_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImportProductSetsGcsSource( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + csvFileUri_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.class, com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.Builder.class); + } + + public static final int CSV_FILE_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object csvFileUri_; + /** + *
+   * The Google Cloud Storage URI of the input csv file.
+   * The URI must start with gs://
+   * The format of the input csv file should be one image per line.
+   * In each line, there are 6 columns.
+   * 1. image_uri
+   * 2, image_id
+   * 3. product_set_id
+   * 4. product_id
+   * 5, product_category
+   * 6, product_display_name
+   * 7, labels
+   * 8. bounding_poly
+   * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+   * ProductSet/Product with the same id will be created on the fly
+   * if the ProductSet/Product specified by product_set_id/product_id does not
+   * exist.
+   * The image_id field is optional but has to be unique if provided. If it is
+   * empty, we will automatically assign an unique id to the image.
+   * The product_display_name field is optional. If it is empty, a space (" ")
+   * is used as the place holder for the product display_name, which can
+   * be updated later through the realtime API.
+   * If the Product with product_id already exists, the fields
+   * product_display_name, product_category and labels are ignored.
+   * If a Product doesn't exist and needs to be created on the fly, the
+   * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+   * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+   * labels field refers to [Product.labels][].
+   * Labels (optional) should be a line containing a list of comma-separated
+   * key-value pairs, with the format
+   *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+   * The bounding_poly (optional) field is used to identify one region of
+   * interest from the image in the same manner as CreateReferenceImage. If no
+   * bounding_poly is specified, the system will try to detect regions of
+   * interest automatically.
+   * Note that the pipeline will resize the image if the image resolution is too
+   * large to process (above 20MP).
+   * Also note that at most one bounding_poly is allowed per line. If the image
+   * contains multiple regions of interest, the csv should contain one line per
+   * region of interest.
+   * The bounding_poly column should contain an even number of comma-separated
+   * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+   * integers should be used for absolute bounding polygons, and float values
+   * in [0, 1] should be used for normalized bounding polygons.
+   * 
+ * + * string csv_file_uri = 1; + */ + public java.lang.String getCsvFileUri() { + java.lang.Object ref = csvFileUri_; + 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(); + csvFileUri_ = s; + return s; + } + } + /** + *
+   * The Google Cloud Storage URI of the input csv file.
+   * The URI must start with gs://
+   * The format of the input csv file should be one image per line.
+   * In each line, there are 6 columns.
+   * 1. image_uri
+   * 2, image_id
+   * 3. product_set_id
+   * 4. product_id
+   * 5, product_category
+   * 6, product_display_name
+   * 7, labels
+   * 8. bounding_poly
+   * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+   * ProductSet/Product with the same id will be created on the fly
+   * if the ProductSet/Product specified by product_set_id/product_id does not
+   * exist.
+   * The image_id field is optional but has to be unique if provided. If it is
+   * empty, we will automatically assign an unique id to the image.
+   * The product_display_name field is optional. If it is empty, a space (" ")
+   * is used as the place holder for the product display_name, which can
+   * be updated later through the realtime API.
+   * If the Product with product_id already exists, the fields
+   * product_display_name, product_category and labels are ignored.
+   * If a Product doesn't exist and needs to be created on the fly, the
+   * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+   * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+   * labels field refers to [Product.labels][].
+   * Labels (optional) should be a line containing a list of comma-separated
+   * key-value pairs, with the format
+   *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+   * The bounding_poly (optional) field is used to identify one region of
+   * interest from the image in the same manner as CreateReferenceImage. If no
+   * bounding_poly is specified, the system will try to detect regions of
+   * interest automatically.
+   * Note that the pipeline will resize the image if the image resolution is too
+   * large to process (above 20MP).
+   * Also note that at most one bounding_poly is allowed per line. If the image
+   * contains multiple regions of interest, the csv should contain one line per
+   * region of interest.
+   * The bounding_poly column should contain an even number of comma-separated
+   * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+   * integers should be used for absolute bounding polygons, and float values
+   * in [0, 1] should be used for normalized bounding polygons.
+   * 
+ * + * string csv_file_uri = 1; + */ + public com.google.protobuf.ByteString + getCsvFileUriBytes() { + java.lang.Object ref = csvFileUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + csvFileUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getCsvFileUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, csvFileUri_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCsvFileUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, csvFileUri_); + } + 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.vision.v1p3beta1.ImportProductSetsGcsSource)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource other = (com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) obj; + + boolean result = true; + result = result && getCsvFileUri() + .equals(other.getCsvFileUri()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CSV_FILE_URI_FIELD_NUMBER; + hash = (53 * hash) + getCsvFileUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource 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.vision.v1p3beta1.ImportProductSetsGcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource 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.vision.v1p3beta1.ImportProductSetsGcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource 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.vision.v1p3beta1.ImportProductSetsGcsSource parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource 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.vision.v1p3beta1.ImportProductSetsGcsSource parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 a csv file which preserves a list of
+   * ImportProductSetRequests in each line.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.class, com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + csvFileUri_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource build() { + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource buildPartial() { + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource result = new com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource(this); + result.csvFileUri_ = csvFileUri_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource other) { + if (other == com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance()) return this; + if (!other.getCsvFileUri().isEmpty()) { + csvFileUri_ = other.csvFileUri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object csvFileUri_ = ""; + /** + *
+     * The Google Cloud Storage URI of the input csv file.
+     * The URI must start with gs://
+     * The format of the input csv file should be one image per line.
+     * In each line, there are 6 columns.
+     * 1. image_uri
+     * 2, image_id
+     * 3. product_set_id
+     * 4. product_id
+     * 5, product_category
+     * 6, product_display_name
+     * 7, labels
+     * 8. bounding_poly
+     * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+     * ProductSet/Product with the same id will be created on the fly
+     * if the ProductSet/Product specified by product_set_id/product_id does not
+     * exist.
+     * The image_id field is optional but has to be unique if provided. If it is
+     * empty, we will automatically assign an unique id to the image.
+     * The product_display_name field is optional. If it is empty, a space (" ")
+     * is used as the place holder for the product display_name, which can
+     * be updated later through the realtime API.
+     * If the Product with product_id already exists, the fields
+     * product_display_name, product_category and labels are ignored.
+     * If a Product doesn't exist and needs to be created on the fly, the
+     * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+     * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+     * labels field refers to [Product.labels][].
+     * Labels (optional) should be a line containing a list of comma-separated
+     * key-value pairs, with the format
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+     * The bounding_poly (optional) field is used to identify one region of
+     * interest from the image in the same manner as CreateReferenceImage. If no
+     * bounding_poly is specified, the system will try to detect regions of
+     * interest automatically.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 20MP).
+     * Also note that at most one bounding_poly is allowed per line. If the image
+     * contains multiple regions of interest, the csv should contain one line per
+     * region of interest.
+     * The bounding_poly column should contain an even number of comma-separated
+     * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+     * integers should be used for absolute bounding polygons, and float values
+     * in [0, 1] should be used for normalized bounding polygons.
+     * 
+ * + * string csv_file_uri = 1; + */ + public java.lang.String getCsvFileUri() { + java.lang.Object ref = csvFileUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + csvFileUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The Google Cloud Storage URI of the input csv file.
+     * The URI must start with gs://
+     * The format of the input csv file should be one image per line.
+     * In each line, there are 6 columns.
+     * 1. image_uri
+     * 2, image_id
+     * 3. product_set_id
+     * 4. product_id
+     * 5, product_category
+     * 6, product_display_name
+     * 7, labels
+     * 8. bounding_poly
+     * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+     * ProductSet/Product with the same id will be created on the fly
+     * if the ProductSet/Product specified by product_set_id/product_id does not
+     * exist.
+     * The image_id field is optional but has to be unique if provided. If it is
+     * empty, we will automatically assign an unique id to the image.
+     * The product_display_name field is optional. If it is empty, a space (" ")
+     * is used as the place holder for the product display_name, which can
+     * be updated later through the realtime API.
+     * If the Product with product_id already exists, the fields
+     * product_display_name, product_category and labels are ignored.
+     * If a Product doesn't exist and needs to be created on the fly, the
+     * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+     * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+     * labels field refers to [Product.labels][].
+     * Labels (optional) should be a line containing a list of comma-separated
+     * key-value pairs, with the format
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+     * The bounding_poly (optional) field is used to identify one region of
+     * interest from the image in the same manner as CreateReferenceImage. If no
+     * bounding_poly is specified, the system will try to detect regions of
+     * interest automatically.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 20MP).
+     * Also note that at most one bounding_poly is allowed per line. If the image
+     * contains multiple regions of interest, the csv should contain one line per
+     * region of interest.
+     * The bounding_poly column should contain an even number of comma-separated
+     * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+     * integers should be used for absolute bounding polygons, and float values
+     * in [0, 1] should be used for normalized bounding polygons.
+     * 
+ * + * string csv_file_uri = 1; + */ + public com.google.protobuf.ByteString + getCsvFileUriBytes() { + java.lang.Object ref = csvFileUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + csvFileUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The Google Cloud Storage URI of the input csv file.
+     * The URI must start with gs://
+     * The format of the input csv file should be one image per line.
+     * In each line, there are 6 columns.
+     * 1. image_uri
+     * 2, image_id
+     * 3. product_set_id
+     * 4. product_id
+     * 5, product_category
+     * 6, product_display_name
+     * 7, labels
+     * 8. bounding_poly
+     * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+     * ProductSet/Product with the same id will be created on the fly
+     * if the ProductSet/Product specified by product_set_id/product_id does not
+     * exist.
+     * The image_id field is optional but has to be unique if provided. If it is
+     * empty, we will automatically assign an unique id to the image.
+     * The product_display_name field is optional. If it is empty, a space (" ")
+     * is used as the place holder for the product display_name, which can
+     * be updated later through the realtime API.
+     * If the Product with product_id already exists, the fields
+     * product_display_name, product_category and labels are ignored.
+     * If a Product doesn't exist and needs to be created on the fly, the
+     * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+     * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+     * labels field refers to [Product.labels][].
+     * Labels (optional) should be a line containing a list of comma-separated
+     * key-value pairs, with the format
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+     * The bounding_poly (optional) field is used to identify one region of
+     * interest from the image in the same manner as CreateReferenceImage. If no
+     * bounding_poly is specified, the system will try to detect regions of
+     * interest automatically.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 20MP).
+     * Also note that at most one bounding_poly is allowed per line. If the image
+     * contains multiple regions of interest, the csv should contain one line per
+     * region of interest.
+     * The bounding_poly column should contain an even number of comma-separated
+     * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+     * integers should be used for absolute bounding polygons, and float values
+     * in [0, 1] should be used for normalized bounding polygons.
+     * 
+ * + * string csv_file_uri = 1; + */ + public Builder setCsvFileUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + csvFileUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The Google Cloud Storage URI of the input csv file.
+     * The URI must start with gs://
+     * The format of the input csv file should be one image per line.
+     * In each line, there are 6 columns.
+     * 1. image_uri
+     * 2, image_id
+     * 3. product_set_id
+     * 4. product_id
+     * 5, product_category
+     * 6, product_display_name
+     * 7, labels
+     * 8. bounding_poly
+     * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+     * ProductSet/Product with the same id will be created on the fly
+     * if the ProductSet/Product specified by product_set_id/product_id does not
+     * exist.
+     * The image_id field is optional but has to be unique if provided. If it is
+     * empty, we will automatically assign an unique id to the image.
+     * The product_display_name field is optional. If it is empty, a space (" ")
+     * is used as the place holder for the product display_name, which can
+     * be updated later through the realtime API.
+     * If the Product with product_id already exists, the fields
+     * product_display_name, product_category and labels are ignored.
+     * If a Product doesn't exist and needs to be created on the fly, the
+     * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+     * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+     * labels field refers to [Product.labels][].
+     * Labels (optional) should be a line containing a list of comma-separated
+     * key-value pairs, with the format
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+     * The bounding_poly (optional) field is used to identify one region of
+     * interest from the image in the same manner as CreateReferenceImage. If no
+     * bounding_poly is specified, the system will try to detect regions of
+     * interest automatically.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 20MP).
+     * Also note that at most one bounding_poly is allowed per line. If the image
+     * contains multiple regions of interest, the csv should contain one line per
+     * region of interest.
+     * The bounding_poly column should contain an even number of comma-separated
+     * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+     * integers should be used for absolute bounding polygons, and float values
+     * in [0, 1] should be used for normalized bounding polygons.
+     * 
+ * + * string csv_file_uri = 1; + */ + public Builder clearCsvFileUri() { + + csvFileUri_ = getDefaultInstance().getCsvFileUri(); + onChanged(); + return this; + } + /** + *
+     * The Google Cloud Storage URI of the input csv file.
+     * The URI must start with gs://
+     * The format of the input csv file should be one image per line.
+     * In each line, there are 6 columns.
+     * 1. image_uri
+     * 2, image_id
+     * 3. product_set_id
+     * 4. product_id
+     * 5, product_category
+     * 6, product_display_name
+     * 7, labels
+     * 8. bounding_poly
+     * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+     * ProductSet/Product with the same id will be created on the fly
+     * if the ProductSet/Product specified by product_set_id/product_id does not
+     * exist.
+     * The image_id field is optional but has to be unique if provided. If it is
+     * empty, we will automatically assign an unique id to the image.
+     * The product_display_name field is optional. If it is empty, a space (" ")
+     * is used as the place holder for the product display_name, which can
+     * be updated later through the realtime API.
+     * If the Product with product_id already exists, the fields
+     * product_display_name, product_category and labels are ignored.
+     * If a Product doesn't exist and needs to be created on the fly, the
+     * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+     * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+     * labels field refers to [Product.labels][].
+     * Labels (optional) should be a line containing a list of comma-separated
+     * key-value pairs, with the format
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+     * The bounding_poly (optional) field is used to identify one region of
+     * interest from the image in the same manner as CreateReferenceImage. If no
+     * bounding_poly is specified, the system will try to detect regions of
+     * interest automatically.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 20MP).
+     * Also note that at most one bounding_poly is allowed per line. If the image
+     * contains multiple regions of interest, the csv should contain one line per
+     * region of interest.
+     * The bounding_poly column should contain an even number of comma-separated
+     * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+     * integers should be used for absolute bounding polygons, and float values
+     * in [0, 1] should be used for normalized bounding polygons.
+     * 
+ * + * string csv_file_uri = 1; + */ + public Builder setCsvFileUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + csvFileUri_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) + private static final com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource(); + } + + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImportProductSetsGcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportProductSetsGcsSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsGcsSourceOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsGcsSourceOrBuilder.java new file mode 100644 index 000000000000..f0d20d70db16 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsGcsSourceOrBuilder.java @@ -0,0 +1,111 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImportProductSetsGcsSourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The Google Cloud Storage URI of the input csv file.
+   * The URI must start with gs://
+   * The format of the input csv file should be one image per line.
+   * In each line, there are 6 columns.
+   * 1. image_uri
+   * 2, image_id
+   * 3. product_set_id
+   * 4. product_id
+   * 5, product_category
+   * 6, product_display_name
+   * 7, labels
+   * 8. bounding_poly
+   * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+   * ProductSet/Product with the same id will be created on the fly
+   * if the ProductSet/Product specified by product_set_id/product_id does not
+   * exist.
+   * The image_id field is optional but has to be unique if provided. If it is
+   * empty, we will automatically assign an unique id to the image.
+   * The product_display_name field is optional. If it is empty, a space (" ")
+   * is used as the place holder for the product display_name, which can
+   * be updated later through the realtime API.
+   * If the Product with product_id already exists, the fields
+   * product_display_name, product_category and labels are ignored.
+   * If a Product doesn't exist and needs to be created on the fly, the
+   * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+   * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+   * labels field refers to [Product.labels][].
+   * Labels (optional) should be a line containing a list of comma-separated
+   * key-value pairs, with the format
+   *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+   * The bounding_poly (optional) field is used to identify one region of
+   * interest from the image in the same manner as CreateReferenceImage. If no
+   * bounding_poly is specified, the system will try to detect regions of
+   * interest automatically.
+   * Note that the pipeline will resize the image if the image resolution is too
+   * large to process (above 20MP).
+   * Also note that at most one bounding_poly is allowed per line. If the image
+   * contains multiple regions of interest, the csv should contain one line per
+   * region of interest.
+   * The bounding_poly column should contain an even number of comma-separated
+   * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+   * integers should be used for absolute bounding polygons, and float values
+   * in [0, 1] should be used for normalized bounding polygons.
+   * 
+ * + * string csv_file_uri = 1; + */ + java.lang.String getCsvFileUri(); + /** + *
+   * The Google Cloud Storage URI of the input csv file.
+   * The URI must start with gs://
+   * The format of the input csv file should be one image per line.
+   * In each line, there are 6 columns.
+   * 1. image_uri
+   * 2, image_id
+   * 3. product_set_id
+   * 4. product_id
+   * 5, product_category
+   * 6, product_display_name
+   * 7, labels
+   * 8. bounding_poly
+   * Columns 1, 3, 4, and 5 are required, other columns are optional. A new
+   * ProductSet/Product with the same id will be created on the fly
+   * if the ProductSet/Product specified by product_set_id/product_id does not
+   * exist.
+   * The image_id field is optional but has to be unique if provided. If it is
+   * empty, we will automatically assign an unique id to the image.
+   * The product_display_name field is optional. If it is empty, a space (" ")
+   * is used as the place holder for the product display_name, which can
+   * be updated later through the realtime API.
+   * If the Product with product_id already exists, the fields
+   * product_display_name, product_category and labels are ignored.
+   * If a Product doesn't exist and needs to be created on the fly, the
+   * product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the
+   * product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the
+   * labels field refers to [Product.labels][].
+   * Labels (optional) should be a line containing a list of comma-separated
+   * key-value pairs, with the format
+   *     "key_1=value_1,key_2=value_2,...,key_n=value_n".
+   * The bounding_poly (optional) field is used to identify one region of
+   * interest from the image in the same manner as CreateReferenceImage. If no
+   * bounding_poly is specified, the system will try to detect regions of
+   * interest automatically.
+   * Note that the pipeline will resize the image if the image resolution is too
+   * large to process (above 20MP).
+   * Also note that at most one bounding_poly is allowed per line. If the image
+   * contains multiple regions of interest, the csv should contain one line per
+   * region of interest.
+   * The bounding_poly column should contain an even number of comma-separated
+   * numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
+   * integers should be used for absolute bounding polygons, and float values
+   * in [0, 1] should be used for normalized bounding polygons.
+   * 
+ * + * string csv_file_uri = 1; + */ + com.google.protobuf.ByteString + getCsvFileUriBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsInputConfig.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsInputConfig.java new file mode 100644 index 000000000000..7c4fd8f19888 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsInputConfig.java @@ -0,0 +1,729 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * The input content for the `ImportProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig} + */ +public final class ImportProductSetsInputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) + ImportProductSetsInputConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImportProductSetsInputConfig.newBuilder() to construct. + private ImportProductSetsInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImportProductSetsInputConfig() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImportProductSetsInputConfig( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) source_).toBuilder(); + } + source_ = + input.readMessage(com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.class, com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + public enum SourceCase + implements com.google.protobuf.Internal.EnumLite { + GCS_SOURCE(1), + SOURCE_NOT_SET(0); + private final int value; + private SourceCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: return GCS_SOURCE; + case 0: return SOURCE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public SourceCase + getSourceCase() { + return SourceCase.forNumber( + sourceCase_); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + /** + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource getGcsSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + /** + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) source_); + } + unknownFields.writeTo(output); + } + + 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.vision.v1p3beta1.ImportProductSetsGcsSource) source_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig other = (com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) obj; + + boolean result = true; + result = result && getSourceCase().equals( + other.getSourceCase()); + if (!result) return false; + switch (sourceCase_) { + case 1: + result = result && getGcsSource() + .equals(other.getGcsSource()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig 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.vision.v1p3beta1.ImportProductSetsInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig 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.vision.v1p3beta1.ImportProductSetsInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig 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.vision.v1p3beta1.ImportProductSetsInputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig 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.vision.v1p3beta1.ImportProductSetsInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The input content for the `ImportProductSets` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.class, com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + sourceCase_ = 0; + source_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig build() { + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig buildPartial() { + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig result = new com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig(this); + if (sourceCase_ == 1) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig other) { + if (other == com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.getDefaultInstance()) return this; + switch (other.getSourceCase()) { + case GCS_SOURCE: { + mergeGcsSource(other.getGcsSource()); + break; + } + case SOURCE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int sourceCase_ = 0; + private java.lang.Object source_; + public SourceCase + getSourceCase() { + return SourceCase.forNumber( + sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource, com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.Builder, com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceOrBuilder> gcsSourceBuilder_; + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + } + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource 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 a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1 && + source_ != com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance()) { + source_ = com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.newBuilder((com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) 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 a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource 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 a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 1) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + } + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource, com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.Builder, com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource, com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.Builder, com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceOrBuilder>( + (com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged();; + return gcsSourceBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) + private static final com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig(); + } + + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImportProductSetsInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportProductSetsInputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsInputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsInputConfigOrBuilder.java new file mode 100644 index 000000000000..ae1e6b8159ed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsInputConfigOrBuilder.java @@ -0,0 +1,39 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImportProductSetsInputConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + boolean hasGcsSource(); + /** + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource getGcsSource(); + /** + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceOrBuilder getGcsSourceOrBuilder(); + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.SourceCase getSourceCase(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsRequest.java new file mode 100644 index 000000000000..276d4889c09b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsRequest.java @@ -0,0 +1,788 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `ImportProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImportProductSetsRequest} + */ +public final class ImportProductSetsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ImportProductSetsRequest) + ImportProductSetsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImportProductSetsRequest.newBuilder() to construct. + private ImportProductSetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImportProductSetsRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImportProductSetsRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest.class, com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The project in which the ProductSets should be imported.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * 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 project in which the ProductSets should be imported.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * 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 INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig inputConfig_; + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig getInputConfig() { + return inputConfig_ == null ? com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.getDefaultInstance() : inputConfig_; + } + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + unknownFields.writeTo(output); + } + + 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 (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, 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.vision.v1p3beta1.ImportProductSetsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest other = (com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasInputConfig() == other.hasInputConfig()); + if (hasInputConfig()) { + result = result && getInputConfig() + .equals(other.getInputConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 (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.vision.v1p3beta1.ImportProductSetsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest 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.vision.v1p3beta1.ImportProductSetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest 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.vision.v1p3beta1.ImportProductSetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest 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.vision.v1p3beta1.ImportProductSetsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest 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.vision.v1p3beta1.ImportProductSetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `ImportProductSets` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImportProductSetsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ImportProductSetsRequest) + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest.class, com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest build() { + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest result = new com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest(this); + result.parent_ = parent_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The project in which the ProductSets should be imported.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 project in which the ProductSets should be imported.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 project in which the ProductSets should be imported.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The project in which the ProductSets should be imported.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The project in which the ProductSets should be imported.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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.vision.v1p3beta1.ImportProductSetsInputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig, com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.Builder, com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigOrBuilder> inputConfigBuilder_; + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null ? com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.getDefaultInstance() : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder setInputConfig(com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder mergeInputConfig(com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.newBuilder(inputConfig_).mergeFrom(value).buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null ? + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.getDefaultInstance() : inputConfig_; + } + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig, com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.Builder, com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig, com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.Builder, com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigOrBuilder>( + getInputConfig(), + getParentForChildren(), + isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ImportProductSetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImportProductSetsRequest) + private static final com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImportProductSetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportProductSetsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsRequestOrBuilder.java new file mode 100644 index 000000000000..80472f0ee5a4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsRequestOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImportProductSetsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ImportProductSetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The project in which the ProductSets should be imported.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The project in which the ProductSets should be imported.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + boolean hasInputConfig(); + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig getInputConfig(); + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig input_config = 2; + */ + com.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigOrBuilder getInputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsResponse.java new file mode 100644 index 000000000000..d9ef86250857 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsResponse.java @@ -0,0 +1,1367 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response message for the `ImportProductSets` method.
+ * This message is returned by the
+ * [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned
+ * [google.longrunning.Operation.response][google.longrunning.Operation.response] field.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImportProductSetsResponse} + */ +public final class ImportProductSetsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ImportProductSetsResponse) + ImportProductSetsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ImportProductSetsResponse.newBuilder() to construct. + private ImportProductSetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ImportProductSetsResponse() { + referenceImages_ = java.util.Collections.emptyList(); + statuses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ImportProductSetsResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + referenceImages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + referenceImages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.ReferenceImage.parser(), extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + statuses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + statuses_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + 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) == 0x00000001)) { + referenceImages_ = java.util.Collections.unmodifiableList(referenceImages_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + statuses_ = java.util.Collections.unmodifiableList(statuses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse.class, com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse.Builder.class); + } + + public static final int REFERENCE_IMAGES_FIELD_NUMBER = 1; + private java.util.List referenceImages_; + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List getReferenceImagesList() { + return referenceImages_; + } + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesOrBuilderList() { + return referenceImages_; + } + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public int getReferenceImagesCount() { + return referenceImages_.size(); + } + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImages(int index) { + return referenceImages_.get(index); + } + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImagesOrBuilder( + int index) { + return referenceImages_.get(index); + } + + public static final int STATUSES_FIELD_NUMBER = 2; + private java.util.List statuses_; + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public java.util.List getStatusesList() { + return statuses_; + } + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public java.util.List + getStatusesOrBuilderList() { + return statuses_; + } + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public int getStatusesCount() { + return statuses_.size(); + } + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public com.google.rpc.Status getStatuses(int index) { + return statuses_.get(index); + } + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public com.google.rpc.StatusOrBuilder getStatusesOrBuilder( + int index) { + return statuses_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < referenceImages_.size(); i++) { + output.writeMessage(1, referenceImages_.get(i)); + } + for (int i = 0; i < statuses_.size(); i++) { + output.writeMessage(2, statuses_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < referenceImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, referenceImages_.get(i)); + } + for (int i = 0; i < statuses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, statuses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse other = (com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse) obj; + + boolean result = true; + result = result && getReferenceImagesList() + .equals(other.getReferenceImagesList()); + result = result && getStatusesList() + .equals(other.getStatusesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getReferenceImagesCount() > 0) { + hash = (37 * hash) + REFERENCE_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getReferenceImagesList().hashCode(); + } + if (getStatusesCount() > 0) { + hash = (37 * hash) + STATUSES_FIELD_NUMBER; + hash = (53 * hash) + getStatusesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse 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.vision.v1p3beta1.ImportProductSetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse 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.vision.v1p3beta1.ImportProductSetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse 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.vision.v1p3beta1.ImportProductSetsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse 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.vision.v1p3beta1.ImportProductSetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response message for the `ImportProductSets` method.
+   * This message is returned by the
+   * [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned
+   * [google.longrunning.Operation.response][google.longrunning.Operation.response] field.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ImportProductSetsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ImportProductSetsResponse) + com.google.cloud.vision.v1p3beta1.ImportProductSetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse.class, com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getReferenceImagesFieldBuilder(); + getStatusesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (referenceImagesBuilder_ == null) { + referenceImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + referenceImagesBuilder_.clear(); + } + if (statusesBuilder_ == null) { + statuses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + statusesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse build() { + com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse result = new com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse(this); + int from_bitField0_ = bitField0_; + if (referenceImagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + referenceImages_ = java.util.Collections.unmodifiableList(referenceImages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.referenceImages_ = referenceImages_; + } else { + result.referenceImages_ = referenceImagesBuilder_.build(); + } + if (statusesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + statuses_ = java.util.Collections.unmodifiableList(statuses_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.statuses_ = statuses_; + } else { + result.statuses_ = statusesBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse.getDefaultInstance()) return this; + if (referenceImagesBuilder_ == null) { + if (!other.referenceImages_.isEmpty()) { + if (referenceImages_.isEmpty()) { + referenceImages_ = other.referenceImages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReferenceImagesIsMutable(); + referenceImages_.addAll(other.referenceImages_); + } + onChanged(); + } + } else { + if (!other.referenceImages_.isEmpty()) { + if (referenceImagesBuilder_.isEmpty()) { + referenceImagesBuilder_.dispose(); + referenceImagesBuilder_ = null; + referenceImages_ = other.referenceImages_; + bitField0_ = (bitField0_ & ~0x00000001); + referenceImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getReferenceImagesFieldBuilder() : null; + } else { + referenceImagesBuilder_.addAllMessages(other.referenceImages_); + } + } + } + if (statusesBuilder_ == null) { + if (!other.statuses_.isEmpty()) { + if (statuses_.isEmpty()) { + statuses_ = other.statuses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureStatusesIsMutable(); + statuses_.addAll(other.statuses_); + } + onChanged(); + } + } else { + if (!other.statuses_.isEmpty()) { + if (statusesBuilder_.isEmpty()) { + statusesBuilder_.dispose(); + statusesBuilder_ = null; + statuses_ = other.statuses_; + bitField0_ = (bitField0_ & ~0x00000002); + statusesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getStatusesFieldBuilder() : null; + } else { + statusesBuilder_.addAllMessages(other.statuses_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List referenceImages_ = + java.util.Collections.emptyList(); + private void ensureReferenceImagesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + referenceImages_ = new java.util.ArrayList(referenceImages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder> referenceImagesBuilder_; + + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List getReferenceImagesList() { + if (referenceImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(referenceImages_); + } else { + return referenceImagesBuilder_.getMessageList(); + } + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public int getReferenceImagesCount() { + if (referenceImagesBuilder_ == null) { + return referenceImages_.size(); + } else { + return referenceImagesBuilder_.getCount(); + } + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImages(int index) { + if (referenceImagesBuilder_ == null) { + return referenceImages_.get(index); + } else { + return referenceImagesBuilder_.getMessage(index); + } + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1p3beta1.ReferenceImage value) { + if (referenceImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferenceImagesIsMutable(); + referenceImages_.set(index, value); + onChanged(); + } else { + referenceImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder builderForValue) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + referenceImages_.set(index, builderForValue.build()); + onChanged(); + } else { + referenceImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages(com.google.cloud.vision.v1p3beta1.ReferenceImage value) { + if (referenceImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferenceImagesIsMutable(); + referenceImages_.add(value); + onChanged(); + } else { + referenceImagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1p3beta1.ReferenceImage value) { + if (referenceImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferenceImagesIsMutable(); + referenceImages_.add(index, value); + onChanged(); + } else { + referenceImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder builderForValue) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + referenceImages_.add(builderForValue.build()); + onChanged(); + } else { + referenceImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder builderForValue) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + referenceImages_.add(index, builderForValue.build()); + onChanged(); + } else { + referenceImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addAllReferenceImages( + java.lang.Iterable values) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, referenceImages_); + onChanged(); + } else { + referenceImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder clearReferenceImages() { + if (referenceImagesBuilder_ == null) { + referenceImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + referenceImagesBuilder_.clear(); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder removeReferenceImages(int index) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + referenceImages_.remove(index); + onChanged(); + } else { + referenceImagesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder getReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImagesOrBuilder( + int index) { + if (referenceImagesBuilder_ == null) { + return referenceImages_.get(index); } else { + return referenceImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesOrBuilderList() { + if (referenceImagesBuilder_ != null) { + return referenceImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(referenceImages_); + } + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder addReferenceImagesBuilder() { + return getReferenceImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance()); + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder addReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance()); + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesBuilderList() { + return getReferenceImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder> + getReferenceImagesFieldBuilder() { + if (referenceImagesBuilder_ == null) { + referenceImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder>( + referenceImages_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + referenceImages_ = null; + } + return referenceImagesBuilder_; + } + + private java.util.List statuses_ = + java.util.Collections.emptyList(); + private void ensureStatusesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + statuses_ = new java.util.ArrayList(statuses_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusesBuilder_; + + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public java.util.List getStatusesList() { + if (statusesBuilder_ == null) { + return java.util.Collections.unmodifiableList(statuses_); + } else { + return statusesBuilder_.getMessageList(); + } + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public int getStatusesCount() { + if (statusesBuilder_ == null) { + return statuses_.size(); + } else { + return statusesBuilder_.getCount(); + } + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public com.google.rpc.Status getStatuses(int index) { + if (statusesBuilder_ == null) { + return statuses_.get(index); + } else { + return statusesBuilder_.getMessage(index); + } + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder setStatuses( + int index, com.google.rpc.Status value) { + if (statusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatusesIsMutable(); + statuses_.set(index, value); + onChanged(); + } else { + statusesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder setStatuses( + int index, com.google.rpc.Status.Builder builderForValue) { + if (statusesBuilder_ == null) { + ensureStatusesIsMutable(); + statuses_.set(index, builderForValue.build()); + onChanged(); + } else { + statusesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder addStatuses(com.google.rpc.Status value) { + if (statusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatusesIsMutable(); + statuses_.add(value); + onChanged(); + } else { + statusesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder addStatuses( + int index, com.google.rpc.Status value) { + if (statusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatusesIsMutable(); + statuses_.add(index, value); + onChanged(); + } else { + statusesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder addStatuses( + com.google.rpc.Status.Builder builderForValue) { + if (statusesBuilder_ == null) { + ensureStatusesIsMutable(); + statuses_.add(builderForValue.build()); + onChanged(); + } else { + statusesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder addStatuses( + int index, com.google.rpc.Status.Builder builderForValue) { + if (statusesBuilder_ == null) { + ensureStatusesIsMutable(); + statuses_.add(index, builderForValue.build()); + onChanged(); + } else { + statusesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder addAllStatuses( + java.lang.Iterable values) { + if (statusesBuilder_ == null) { + ensureStatusesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, statuses_); + onChanged(); + } else { + statusesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder clearStatuses() { + if (statusesBuilder_ == null) { + statuses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + statusesBuilder_.clear(); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public Builder removeStatuses(int index) { + if (statusesBuilder_ == null) { + ensureStatusesIsMutable(); + statuses_.remove(index); + onChanged(); + } else { + statusesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public com.google.rpc.Status.Builder getStatusesBuilder( + int index) { + return getStatusesFieldBuilder().getBuilder(index); + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public com.google.rpc.StatusOrBuilder getStatusesOrBuilder( + int index) { + if (statusesBuilder_ == null) { + return statuses_.get(index); } else { + return statusesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public java.util.List + getStatusesOrBuilderList() { + if (statusesBuilder_ != null) { + return statusesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(statuses_); + } + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public com.google.rpc.Status.Builder addStatusesBuilder() { + return getStatusesFieldBuilder().addBuilder( + com.google.rpc.Status.getDefaultInstance()); + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public com.google.rpc.Status.Builder addStatusesBuilder( + int index) { + return getStatusesFieldBuilder().addBuilder( + index, com.google.rpc.Status.getDefaultInstance()); + } + /** + *
+     * The rpc status for each ImportProductSet request, including both successes
+     * and errors.
+     * The number of statuses here matches the number of lines in the csv file,
+     * and statuses[i] stores the success or failure status of processing the i-th
+     * line of the csv, starting from line 0.
+     * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + public java.util.List + getStatusesBuilderList() { + return getStatusesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusesFieldBuilder() { + if (statusesBuilder_ == null) { + statusesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + statuses_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + statuses_ = null; + } + return statusesBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ImportProductSetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImportProductSetsResponse) + private static final com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ImportProductSetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportProductSetsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsResponseOrBuilder.java new file mode 100644 index 000000000000..cc734e56af59 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ImportProductSetsResponseOrBuilder.java @@ -0,0 +1,117 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ImportProductSetsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ImportProductSetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesList(); + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImages(int index); + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + int getReferenceImagesCount(); + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesOrBuilderList(); + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImagesOrBuilder( + int index); + + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + java.util.List + getStatusesList(); + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + com.google.rpc.Status getStatuses(int index); + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + int getStatusesCount(); + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + java.util.List + getStatusesOrBuilderList(); + /** + *
+   * The rpc status for each ImportProductSet request, including both successes
+   * and errors.
+   * The number of statuses here matches the number of lines in the csv file,
+   * and statuses[i] stores the success or failure status of processing the i-th
+   * line of the csv, starting from line 0.
+   * 
+ * + * repeated .google.rpc.Status statuses = 2; + */ + com.google.rpc.StatusOrBuilder getStatusesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/InputConfig.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/InputConfig.java new file mode 100644 index 000000000000..86595eeffe5c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/InputConfig.java @@ -0,0 +1,788 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * The desired input location and metadata.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.InputConfig} + */ +public final class InputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.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() { + mimeType_ = ""; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.GcsSource.Builder subBuilder = null; + if (gcsSource_ != null) { + subBuilder = gcsSource_.toBuilder(); + } + gcsSource_ = input.readMessage(com.google.cloud.vision.v1p3beta1.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gcsSource_); + gcsSource_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + mimeType_ = s; + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_InputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.InputConfig.class, com.google.cloud.vision.v1p3beta1.InputConfig.Builder.class); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.GcsSource gcsSource_; + /** + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return gcsSource_ != null; + } + /** + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsSource getGcsSource() { + return gcsSource_ == null ? com.google.cloud.vision.v1p3beta1.GcsSource.getDefaultInstance() : gcsSource_; + } + /** + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return getGcsSource(); + } + + public static final int MIME_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object mimeType_; + /** + *
+   * The type of the file. Currently only "application/pdf" and "image/tiff"
+   * are supported. Wildcards are not supported.
+   * 
+ * + * 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; + } + } + /** + *
+   * The type of the file. Currently only "application/pdf" and "image/tiff"
+   * are supported. Wildcards are not supported.
+   * 
+ * + * 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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (gcsSource_ != null) { + output.writeMessage(1, getGcsSource()); + } + if (!getMimeTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsSource_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getGcsSource()); + } + if (!getMimeTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); + } + 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.vision.v1p3beta1.InputConfig)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.InputConfig other = (com.google.cloud.vision.v1p3beta1.InputConfig) obj; + + boolean result = true; + result = result && (hasGcsSource() == other.hasGcsSource()); + if (hasGcsSource()) { + result = result && getGcsSource() + .equals(other.getGcsSource()); + } + result = result && getMimeType() + .equals(other.getMimeType()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcsSource()) { + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + } + hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.InputConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.InputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.InputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.InputConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.InputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.InputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.InputConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.InputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 desired input location and metadata.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.InputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.InputConfig) + com.google.cloud.vision.v1p3beta1.InputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_InputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.InputConfig.class, com.google.cloud.vision.v1p3beta1.InputConfig.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.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) { + } + } + public Builder clear() { + super.clear(); + if (gcsSourceBuilder_ == null) { + gcsSource_ = null; + } else { + gcsSource_ = null; + gcsSourceBuilder_ = null; + } + mimeType_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_InputConfig_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.InputConfig getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.InputConfig.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.InputConfig build() { + com.google.cloud.vision.v1p3beta1.InputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.InputConfig buildPartial() { + com.google.cloud.vision.v1p3beta1.InputConfig result = new com.google.cloud.vision.v1p3beta1.InputConfig(this); + if (gcsSourceBuilder_ == null) { + result.gcsSource_ = gcsSource_; + } else { + result.gcsSource_ = gcsSourceBuilder_.build(); + } + result.mimeType_ = mimeType_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.InputConfig) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.InputConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.InputConfig other) { + if (other == com.google.cloud.vision.v1p3beta1.InputConfig.getDefaultInstance()) return this; + if (other.hasGcsSource()) { + mergeGcsSource(other.getGcsSource()); + } + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.InputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.InputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.GcsSource gcsSource_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.GcsSource, com.google.cloud.vision.v1p3beta1.GcsSource.Builder, com.google.cloud.vision.v1p3beta1.GcsSourceOrBuilder> gcsSourceBuilder_; + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return gcsSourceBuilder_ != null || gcsSource_ != null; + } + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null ? com.google.cloud.vision.v1p3beta1.GcsSource.getDefaultInstance() : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.vision.v1p3beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsSource_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.cloud.vision.v1p3beta1.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + gcsSource_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.vision.v1p3beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (gcsSource_ != null) { + gcsSource_ = + com.google.cloud.vision.v1p3beta1.GcsSource.newBuilder(gcsSource_).mergeFrom(value).buildPartial(); + } else { + gcsSource_ = value; + } + onChanged(); + } else { + gcsSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + gcsSource_ = null; + onChanged(); + } else { + gcsSource_ = null; + gcsSourceBuilder_ = null; + } + + return this; + } + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsSource.Builder getGcsSourceBuilder() { + + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null ? + com.google.cloud.vision.v1p3beta1.GcsSource.getDefaultInstance() : gcsSource_; + } + } + /** + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.GcsSource, com.google.cloud.vision.v1p3beta1.GcsSource.Builder, com.google.cloud.vision.v1p3beta1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.GcsSource, com.google.cloud.vision.v1p3beta1.GcsSource.Builder, com.google.cloud.vision.v1p3beta1.GcsSourceOrBuilder>( + getGcsSource(), + getParentForChildren(), + isClean()); + gcsSource_ = null; + } + return gcsSourceBuilder_; + } + + private java.lang.Object mimeType_ = ""; + /** + *
+     * The type of the file. Currently only "application/pdf" and "image/tiff"
+     * are supported. Wildcards are not supported.
+     * 
+ * + * 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; + } + } + /** + *
+     * The type of the file. Currently only "application/pdf" and "image/tiff"
+     * are supported. Wildcards are not supported.
+     * 
+ * + * 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; + } + } + /** + *
+     * The type of the file. Currently only "application/pdf" and "image/tiff"
+     * are supported. Wildcards are not supported.
+     * 
+ * + * string mime_type = 2; + */ + public Builder setMimeType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mimeType_ = value; + onChanged(); + return this; + } + /** + *
+     * The type of the file. Currently only "application/pdf" and "image/tiff"
+     * are supported. Wildcards are not supported.
+     * 
+ * + * string mime_type = 2; + */ + public Builder clearMimeType() { + + mimeType_ = getDefaultInstance().getMimeType(); + onChanged(); + return this; + } + /** + *
+     * The type of the file. Currently only "application/pdf" and "image/tiff"
+     * are supported. Wildcards are not supported.
+     * 
+ * + * 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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.InputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.InputConfig) + private static final com.google.cloud.vision.v1p3beta1.InputConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.InputConfig(); + } + + public static com.google.cloud.vision.v1p3beta1.InputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.vision.v1p3beta1.InputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/InputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/InputConfigOrBuilder.java new file mode 100644 index 000000000000..e47688fd5adb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/InputConfigOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface InputConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.InputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + boolean hasGcsSource(); + /** + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1p3beta1.GcsSource getGcsSource(); + /** + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1p3beta1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + *
+   * The type of the file. Currently only "application/pdf" and "image/tiff"
+   * are supported. Wildcards are not supported.
+   * 
+ * + * string mime_type = 2; + */ + java.lang.String getMimeType(); + /** + *
+   * The type of the file. Currently only "application/pdf" and "image/tiff"
+   * are supported. Wildcards are not supported.
+   * 
+ * + * string mime_type = 2; + */ + com.google.protobuf.ByteString + getMimeTypeBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LatLongRect.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LatLongRect.java new file mode 100644 index 000000000000..31eb51166ba3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LatLongRect.java @@ -0,0 +1,855 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Rectangle determined by min and max `LatLng` pairs.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.LatLongRect} + */ +public final class LatLongRect extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.LatLongRect) + LatLongRectOrBuilder { +private static final long serialVersionUID = 0L; + // Use LatLongRect.newBuilder() to construct. + private LatLongRect(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LatLongRect() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LatLongRect( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.type.LatLng.Builder subBuilder = null; + if (minLatLng_ != null) { + subBuilder = minLatLng_.toBuilder(); + } + minLatLng_ = input.readMessage(com.google.type.LatLng.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(minLatLng_); + minLatLng_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.type.LatLng.Builder subBuilder = null; + if (maxLatLng_ != null) { + subBuilder = maxLatLng_.toBuilder(); + } + maxLatLng_ = input.readMessage(com.google.type.LatLng.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(maxLatLng_); + maxLatLng_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LatLongRect_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LatLongRect_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.LatLongRect.class, com.google.cloud.vision.v1p3beta1.LatLongRect.Builder.class); + } + + public static final int MIN_LAT_LNG_FIELD_NUMBER = 1; + private com.google.type.LatLng minLatLng_; + /** + *
+   * Min lat/long pair.
+   * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public boolean hasMinLatLng() { + return minLatLng_ != null; + } + /** + *
+   * Min lat/long pair.
+   * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public com.google.type.LatLng getMinLatLng() { + return minLatLng_ == null ? com.google.type.LatLng.getDefaultInstance() : minLatLng_; + } + /** + *
+   * Min lat/long pair.
+   * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public com.google.type.LatLngOrBuilder getMinLatLngOrBuilder() { + return getMinLatLng(); + } + + public static final int MAX_LAT_LNG_FIELD_NUMBER = 2; + private com.google.type.LatLng maxLatLng_; + /** + *
+   * Max lat/long pair.
+   * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public boolean hasMaxLatLng() { + return maxLatLng_ != null; + } + /** + *
+   * Max lat/long pair.
+   * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public com.google.type.LatLng getMaxLatLng() { + return maxLatLng_ == null ? com.google.type.LatLng.getDefaultInstance() : maxLatLng_; + } + /** + *
+   * Max lat/long pair.
+   * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public com.google.type.LatLngOrBuilder getMaxLatLngOrBuilder() { + return getMaxLatLng(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (minLatLng_ != null) { + output.writeMessage(1, getMinLatLng()); + } + if (maxLatLng_ != null) { + output.writeMessage(2, getMaxLatLng()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minLatLng_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getMinLatLng()); + } + if (maxLatLng_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getMaxLatLng()); + } + 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.vision.v1p3beta1.LatLongRect)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.LatLongRect other = (com.google.cloud.vision.v1p3beta1.LatLongRect) obj; + + boolean result = true; + result = result && (hasMinLatLng() == other.hasMinLatLng()); + if (hasMinLatLng()) { + result = result && getMinLatLng() + .equals(other.getMinLatLng()); + } + result = result && (hasMaxLatLng() == other.hasMaxLatLng()); + if (hasMaxLatLng()) { + result = result && getMaxLatLng() + .equals(other.getMaxLatLng()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMinLatLng()) { + hash = (37 * hash) + MIN_LAT_LNG_FIELD_NUMBER; + hash = (53 * hash) + getMinLatLng().hashCode(); + } + if (hasMaxLatLng()) { + hash = (37 * hash) + MAX_LAT_LNG_FIELD_NUMBER; + hash = (53 * hash) + getMaxLatLng().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.LatLongRect parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LatLongRect 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.vision.v1p3beta1.LatLongRect parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LatLongRect 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.vision.v1p3beta1.LatLongRect parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LatLongRect parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.LatLongRect parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LatLongRect 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.vision.v1p3beta1.LatLongRect parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LatLongRect 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.vision.v1p3beta1.LatLongRect parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LatLongRect parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.LatLongRect prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Rectangle determined by min and max `LatLng` pairs.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.LatLongRect} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.LatLongRect) + com.google.cloud.vision.v1p3beta1.LatLongRectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LatLongRect_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LatLongRect_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.LatLongRect.class, com.google.cloud.vision.v1p3beta1.LatLongRect.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.LatLongRect.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (minLatLngBuilder_ == null) { + minLatLng_ = null; + } else { + minLatLng_ = null; + minLatLngBuilder_ = null; + } + if (maxLatLngBuilder_ == null) { + maxLatLng_ = null; + } else { + maxLatLng_ = null; + maxLatLngBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LatLongRect_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.LatLongRect getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.LatLongRect.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.LatLongRect build() { + com.google.cloud.vision.v1p3beta1.LatLongRect result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.LatLongRect buildPartial() { + com.google.cloud.vision.v1p3beta1.LatLongRect result = new com.google.cloud.vision.v1p3beta1.LatLongRect(this); + if (minLatLngBuilder_ == null) { + result.minLatLng_ = minLatLng_; + } else { + result.minLatLng_ = minLatLngBuilder_.build(); + } + if (maxLatLngBuilder_ == null) { + result.maxLatLng_ = maxLatLng_; + } else { + result.maxLatLng_ = maxLatLngBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.LatLongRect) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.LatLongRect)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.LatLongRect other) { + if (other == com.google.cloud.vision.v1p3beta1.LatLongRect.getDefaultInstance()) return this; + if (other.hasMinLatLng()) { + mergeMinLatLng(other.getMinLatLng()); + } + if (other.hasMaxLatLng()) { + mergeMaxLatLng(other.getMaxLatLng()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.LatLongRect parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.LatLongRect) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.type.LatLng minLatLng_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> minLatLngBuilder_; + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public boolean hasMinLatLng() { + return minLatLngBuilder_ != null || minLatLng_ != null; + } + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public com.google.type.LatLng getMinLatLng() { + if (minLatLngBuilder_ == null) { + return minLatLng_ == null ? com.google.type.LatLng.getDefaultInstance() : minLatLng_; + } else { + return minLatLngBuilder_.getMessage(); + } + } + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public Builder setMinLatLng(com.google.type.LatLng value) { + if (minLatLngBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minLatLng_ = value; + onChanged(); + } else { + minLatLngBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public Builder setMinLatLng( + com.google.type.LatLng.Builder builderForValue) { + if (minLatLngBuilder_ == null) { + minLatLng_ = builderForValue.build(); + onChanged(); + } else { + minLatLngBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public Builder mergeMinLatLng(com.google.type.LatLng value) { + if (minLatLngBuilder_ == null) { + if (minLatLng_ != null) { + minLatLng_ = + com.google.type.LatLng.newBuilder(minLatLng_).mergeFrom(value).buildPartial(); + } else { + minLatLng_ = value; + } + onChanged(); + } else { + minLatLngBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public Builder clearMinLatLng() { + if (minLatLngBuilder_ == null) { + minLatLng_ = null; + onChanged(); + } else { + minLatLng_ = null; + minLatLngBuilder_ = null; + } + + return this; + } + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public com.google.type.LatLng.Builder getMinLatLngBuilder() { + + onChanged(); + return getMinLatLngFieldBuilder().getBuilder(); + } + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + public com.google.type.LatLngOrBuilder getMinLatLngOrBuilder() { + if (minLatLngBuilder_ != null) { + return minLatLngBuilder_.getMessageOrBuilder(); + } else { + return minLatLng_ == null ? + com.google.type.LatLng.getDefaultInstance() : minLatLng_; + } + } + /** + *
+     * Min lat/long pair.
+     * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + getMinLatLngFieldBuilder() { + if (minLatLngBuilder_ == null) { + minLatLngBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>( + getMinLatLng(), + getParentForChildren(), + isClean()); + minLatLng_ = null; + } + return minLatLngBuilder_; + } + + private com.google.type.LatLng maxLatLng_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> maxLatLngBuilder_; + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public boolean hasMaxLatLng() { + return maxLatLngBuilder_ != null || maxLatLng_ != null; + } + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public com.google.type.LatLng getMaxLatLng() { + if (maxLatLngBuilder_ == null) { + return maxLatLng_ == null ? com.google.type.LatLng.getDefaultInstance() : maxLatLng_; + } else { + return maxLatLngBuilder_.getMessage(); + } + } + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public Builder setMaxLatLng(com.google.type.LatLng value) { + if (maxLatLngBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxLatLng_ = value; + onChanged(); + } else { + maxLatLngBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public Builder setMaxLatLng( + com.google.type.LatLng.Builder builderForValue) { + if (maxLatLngBuilder_ == null) { + maxLatLng_ = builderForValue.build(); + onChanged(); + } else { + maxLatLngBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public Builder mergeMaxLatLng(com.google.type.LatLng value) { + if (maxLatLngBuilder_ == null) { + if (maxLatLng_ != null) { + maxLatLng_ = + com.google.type.LatLng.newBuilder(maxLatLng_).mergeFrom(value).buildPartial(); + } else { + maxLatLng_ = value; + } + onChanged(); + } else { + maxLatLngBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public Builder clearMaxLatLng() { + if (maxLatLngBuilder_ == null) { + maxLatLng_ = null; + onChanged(); + } else { + maxLatLng_ = null; + maxLatLngBuilder_ = null; + } + + return this; + } + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public com.google.type.LatLng.Builder getMaxLatLngBuilder() { + + onChanged(); + return getMaxLatLngFieldBuilder().getBuilder(); + } + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + public com.google.type.LatLngOrBuilder getMaxLatLngOrBuilder() { + if (maxLatLngBuilder_ != null) { + return maxLatLngBuilder_.getMessageOrBuilder(); + } else { + return maxLatLng_ == null ? + com.google.type.LatLng.getDefaultInstance() : maxLatLng_; + } + } + /** + *
+     * Max lat/long pair.
+     * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + getMaxLatLngFieldBuilder() { + if (maxLatLngBuilder_ == null) { + maxLatLngBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>( + getMaxLatLng(), + getParentForChildren(), + isClean()); + maxLatLng_ = null; + } + return maxLatLngBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.LatLongRect) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.LatLongRect) + private static final com.google.cloud.vision.v1p3beta1.LatLongRect DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.LatLongRect(); + } + + public static com.google.cloud.vision.v1p3beta1.LatLongRect getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LatLongRect parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LatLongRect(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.LatLongRect getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LatLongRectOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LatLongRectOrBuilder.java new file mode 100644 index 000000000000..46270d0fca59 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LatLongRectOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface LatLongRectOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.LatLongRect) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Min lat/long pair.
+   * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + boolean hasMinLatLng(); + /** + *
+   * Min lat/long pair.
+   * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + com.google.type.LatLng getMinLatLng(); + /** + *
+   * Min lat/long pair.
+   * 
+ * + * .google.type.LatLng min_lat_lng = 1; + */ + com.google.type.LatLngOrBuilder getMinLatLngOrBuilder(); + + /** + *
+   * Max lat/long pair.
+   * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + boolean hasMaxLatLng(); + /** + *
+   * Max lat/long pair.
+   * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + com.google.type.LatLng getMaxLatLng(); + /** + *
+   * Max lat/long pair.
+   * 
+ * + * .google.type.LatLng max_lat_lng = 2; + */ + com.google.type.LatLngOrBuilder getMaxLatLngOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Likelihood.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Likelihood.java new file mode 100644 index 000000000000..5f3851f1666b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Likelihood.java @@ -0,0 +1,192 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A bucketized representation of likelihood, which is intended to give clients
+ * highly stable results across model upgrades.
+ * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.Likelihood} + */ +public enum Likelihood + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Unknown likelihood.
+   * 
+ * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + *
+   * It is very unlikely that the image belongs to the specified vertical.
+   * 
+ * + * VERY_UNLIKELY = 1; + */ + VERY_UNLIKELY(1), + /** + *
+   * It is unlikely that the image belongs to the specified vertical.
+   * 
+ * + * UNLIKELY = 2; + */ + UNLIKELY(2), + /** + *
+   * It is possible that the image belongs to the specified vertical.
+   * 
+ * + * POSSIBLE = 3; + */ + POSSIBLE(3), + /** + *
+   * It is likely that the image belongs to the specified vertical.
+   * 
+ * + * LIKELY = 4; + */ + LIKELY(4), + /** + *
+   * It is very likely that the image belongs to the specified vertical.
+   * 
+ * + * VERY_LIKELY = 5; + */ + VERY_LIKELY(5), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Unknown likelihood.
+   * 
+ * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + *
+   * It is very unlikely that the image belongs to the specified vertical.
+   * 
+ * + * VERY_UNLIKELY = 1; + */ + public static final int VERY_UNLIKELY_VALUE = 1; + /** + *
+   * It is unlikely that the image belongs to the specified vertical.
+   * 
+ * + * UNLIKELY = 2; + */ + public static final int UNLIKELY_VALUE = 2; + /** + *
+   * It is possible that the image belongs to the specified vertical.
+   * 
+ * + * POSSIBLE = 3; + */ + public static final int POSSIBLE_VALUE = 3; + /** + *
+   * It is likely that the image belongs to the specified vertical.
+   * 
+ * + * LIKELY = 4; + */ + public static final int LIKELY_VALUE = 4; + /** + *
+   * It is very likely that the image belongs to the specified vertical.
+   * 
+ * + * VERY_LIKELY = 5; + */ + public static final int VERY_LIKELY_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Likelihood valueOf(int value) { + return forNumber(value); + } + + public static Likelihood forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return VERY_UNLIKELY; + case 2: return UNLIKELY; + case 3: return POSSIBLE; + case 4: return LIKELY; + case 5: return VERY_LIKELY; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Likelihood> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Likelihood findValueByNumber(int number) { + return Likelihood.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.vision.v1p3beta1.ImageAnnotatorProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Likelihood[] VALUES = values(); + + public static Likelihood 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 Likelihood(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.Likelihood) +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsRequest.java new file mode 100644 index 000000000000..8465c256ba8a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsRequest.java @@ -0,0 +1,788 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `ListProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductSetsRequest} + */ +public final class ListProductSetsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ListProductSetsRequest) + ListProductSetsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListProductSetsRequest.newBuilder() to construct. + private ListProductSetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListProductSetsRequest() { + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListProductSetsRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + } + } + } 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest.class, com.google.cloud.vision.v1p3beta1.ListProductSetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The project from which ProductSets should be listed.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * 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 project from which ProductSets should be listed.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ListProductSetsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest other = (com.google.cloud.vision.v1p3beta1.ListProductSetsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest 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.vision.v1p3beta1.ListProductSetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest 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.vision.v1p3beta1.ListProductSetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest 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.vision.v1p3beta1.ListProductSetsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest 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.vision.v1p3beta1.ListProductSetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ListProductSetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `ListProductSets` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductSetsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ListProductSetsRequest) + com.google.cloud.vision.v1p3beta1.ListProductSetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest.class, com.google.cloud.vision.v1p3beta1.ListProductSetsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ListProductSetsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ListProductSetsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ListProductSetsRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ListProductSetsRequest build() { + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ListProductSetsRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest result = new com.google.cloud.vision.v1p3beta1.ListProductSetsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ListProductSetsRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ListProductSetsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ListProductSetsRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.ListProductSetsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ListProductSetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ListProductSetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The project from which ProductSets should be listed.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 project from which ProductSets should be listed.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 project from which ProductSets should be listed.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The project from which ProductSets should be listed.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The project from which ProductSets should be listed.
+     * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+     * 
+ * + * 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 int pageSize_ ; + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ListProductSetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductSetsRequest) + private static final com.google.cloud.vision.v1p3beta1.ListProductSetsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ListProductSetsRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.ListProductSetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListProductSetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductSetsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ListProductSetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsRequestOrBuilder.java new file mode 100644 index 000000000000..6b77a52c413f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsRequestOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ListProductSetsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ListProductSetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The project from which ProductSets should be listed.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The project from which ProductSets should be listed.
+   * Format is `projects/PROJECT_ID/locations/LOC_ID`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsResponse.java new file mode 100644 index 000000000000..5607290a2002 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsResponse.java @@ -0,0 +1,999 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response message for the `ListProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductSetsResponse} + */ +public final class ListProductSetsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ListProductSetsResponse) + ListProductSetsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListProductSetsResponse.newBuilder() to construct. + private ListProductSetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListProductSetsResponse() { + productSets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListProductSetsResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + productSets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + productSets_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.ProductSet.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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) == 0x00000001)) { + productSets_ = java.util.Collections.unmodifiableList(productSets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductSetsResponse.class, com.google.cloud.vision.v1p3beta1.ListProductSetsResponse.Builder.class); + } + + private int bitField0_; + public static final int PRODUCT_SETS_FIELD_NUMBER = 1; + private java.util.List productSets_; + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public java.util.List getProductSetsList() { + return productSets_; + } + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public java.util.List + getProductSetsOrBuilderList() { + return productSets_; + } + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public int getProductSetsCount() { + return productSets_.size(); + } + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet getProductSets(int index) { + return productSets_.get(index); + } + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetsOrBuilder( + int index) { + return productSets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + } + } + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < productSets_.size(); i++) { + output.writeMessage(1, productSets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < productSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, productSets_.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.vision.v1p3beta1.ListProductSetsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ListProductSetsResponse other = (com.google.cloud.vision.v1p3beta1.ListProductSetsResponse) obj; + + boolean result = true; + result = result && getProductSetsList() + .equals(other.getProductSetsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProductSetsCount() > 0) { + hash = (37 * hash) + PRODUCT_SETS_FIELD_NUMBER; + hash = (53 * hash) + getProductSetsList().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.vision.v1p3beta1.ListProductSetsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsResponse 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.vision.v1p3beta1.ListProductSetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsResponse 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.vision.v1p3beta1.ListProductSetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsResponse 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.vision.v1p3beta1.ListProductSetsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsResponse 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.vision.v1p3beta1.ListProductSetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductSetsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ListProductSetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response message for the `ListProductSets` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductSetsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ListProductSetsResponse) + com.google.cloud.vision.v1p3beta1.ListProductSetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductSetsResponse.class, com.google.cloud.vision.v1p3beta1.ListProductSetsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ListProductSetsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getProductSetsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (productSetsBuilder_ == null) { + productSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productSetsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ListProductSetsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ListProductSetsResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ListProductSetsResponse build() { + com.google.cloud.vision.v1p3beta1.ListProductSetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ListProductSetsResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.ListProductSetsResponse result = new com.google.cloud.vision.v1p3beta1.ListProductSetsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (productSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + productSets_ = java.util.Collections.unmodifiableList(productSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.productSets_ = productSets_; + } else { + result.productSets_ = productSetsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ListProductSetsResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ListProductSetsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ListProductSetsResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.ListProductSetsResponse.getDefaultInstance()) return this; + if (productSetsBuilder_ == null) { + if (!other.productSets_.isEmpty()) { + if (productSets_.isEmpty()) { + productSets_ = other.productSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductSetsIsMutable(); + productSets_.addAll(other.productSets_); + } + onChanged(); + } + } else { + if (!other.productSets_.isEmpty()) { + if (productSetsBuilder_.isEmpty()) { + productSetsBuilder_.dispose(); + productSetsBuilder_ = null; + productSets_ = other.productSets_; + bitField0_ = (bitField0_ & ~0x00000001); + productSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getProductSetsFieldBuilder() : null; + } else { + productSetsBuilder_.addAllMessages(other.productSets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ListProductSetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ListProductSetsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List productSets_ = + java.util.Collections.emptyList(); + private void ensureProductSetsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + productSets_ = new java.util.ArrayList(productSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder> productSetsBuilder_; + + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public java.util.List getProductSetsList() { + if (productSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(productSets_); + } else { + return productSetsBuilder_.getMessageList(); + } + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public int getProductSetsCount() { + if (productSetsBuilder_ == null) { + return productSets_.size(); + } else { + return productSetsBuilder_.getCount(); + } + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet getProductSets(int index) { + if (productSetsBuilder_ == null) { + return productSets_.get(index); + } else { + return productSetsBuilder_.getMessage(index); + } + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder setProductSets( + int index, com.google.cloud.vision.v1p3beta1.ProductSet value) { + if (productSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductSetsIsMutable(); + productSets_.set(index, value); + onChanged(); + } else { + productSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder setProductSets( + int index, com.google.cloud.vision.v1p3beta1.ProductSet.Builder builderForValue) { + if (productSetsBuilder_ == null) { + ensureProductSetsIsMutable(); + productSets_.set(index, builderForValue.build()); + onChanged(); + } else { + productSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder addProductSets(com.google.cloud.vision.v1p3beta1.ProductSet value) { + if (productSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductSetsIsMutable(); + productSets_.add(value); + onChanged(); + } else { + productSetsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder addProductSets( + int index, com.google.cloud.vision.v1p3beta1.ProductSet value) { + if (productSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductSetsIsMutable(); + productSets_.add(index, value); + onChanged(); + } else { + productSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder addProductSets( + com.google.cloud.vision.v1p3beta1.ProductSet.Builder builderForValue) { + if (productSetsBuilder_ == null) { + ensureProductSetsIsMutable(); + productSets_.add(builderForValue.build()); + onChanged(); + } else { + productSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder addProductSets( + int index, com.google.cloud.vision.v1p3beta1.ProductSet.Builder builderForValue) { + if (productSetsBuilder_ == null) { + ensureProductSetsIsMutable(); + productSets_.add(index, builderForValue.build()); + onChanged(); + } else { + productSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder addAllProductSets( + java.lang.Iterable values) { + if (productSetsBuilder_ == null) { + ensureProductSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, productSets_); + onChanged(); + } else { + productSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder clearProductSets() { + if (productSetsBuilder_ == null) { + productSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productSetsBuilder_.clear(); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public Builder removeProductSets(int index) { + if (productSetsBuilder_ == null) { + ensureProductSetsIsMutable(); + productSets_.remove(index); + onChanged(); + } else { + productSetsBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet.Builder getProductSetsBuilder( + int index) { + return getProductSetsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetsOrBuilder( + int index) { + if (productSetsBuilder_ == null) { + return productSets_.get(index); } else { + return productSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public java.util.List + getProductSetsOrBuilderList() { + if (productSetsBuilder_ != null) { + return productSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(productSets_); + } + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet.Builder addProductSetsBuilder() { + return getProductSetsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance()); + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet.Builder addProductSetsBuilder( + int index) { + return getProductSetsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance()); + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + public java.util.List + getProductSetsBuilderList() { + return getProductSetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder> + getProductSetsFieldBuilder() { + if (productSetsBuilder_ == null) { + productSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder>( + productSets_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + productSets_ = null; + } + return productSetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ListProductSetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductSetsResponse) + private static final com.google.cloud.vision.v1p3beta1.ListProductSetsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ListProductSetsResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.ListProductSetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListProductSetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductSetsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ListProductSetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsResponseOrBuilder.java new file mode 100644 index 000000000000..20e8a11b4083 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductSetsResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ListProductSetsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ListProductSetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + java.util.List + getProductSetsList(); + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductSet getProductSets(int index); + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + int getProductSetsCount(); + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + java.util.List + getProductSetsOrBuilderList(); + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSet product_sets = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetsOrBuilder( + int index); + + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetRequest.java new file mode 100644 index 000000000000..fc20b7a620b1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetRequest.java @@ -0,0 +1,795 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `ListProductsInProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest} + */ +public final class ListProductsInProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) + ListProductsInProductSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListProductsInProductSetRequest.newBuilder() to construct. + private ListProductsInProductSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListProductsInProductSetRequest() { + name_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListProductsInProductSetRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.class, com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The ProductSet resource for which to retrieve Products.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+   * The ProductSet resource for which to retrieve Products.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest other = (com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + 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.vision.v1p3beta1.ListProductsInProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest 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.vision.v1p3beta1.ListProductsInProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest 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.vision.v1p3beta1.ListProductsInProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest 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.vision.v1p3beta1.ListProductsInProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest 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.vision.v1p3beta1.ListProductsInProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `ListProductsInProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.class, com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest build() { + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest result = new com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest(this); + result.name_ = name_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The ProductSet resource for which to retrieve Products.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * The ProductSet resource for which to retrieve Products.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * The ProductSet resource for which to retrieve Products.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The ProductSet resource for which to retrieve Products.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The ProductSet resource for which to retrieve Products.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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 int pageSize_ ; + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) + private static final com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListProductsInProductSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsInProductSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..578c3c2cd7e9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ListProductsInProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The ProductSet resource for which to retrieve Products.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The ProductSet resource for which to retrieve Products.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetResponse.java new file mode 100644 index 000000000000..b60c3742020a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetResponse.java @@ -0,0 +1,999 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response message for the `ListProductsInProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse} + */ +public final class ListProductsInProductSetResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) + ListProductsInProductSetResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListProductsInProductSetResponse.newBuilder() to construct. + private ListProductsInProductSetResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListProductsInProductSetResponse() { + products_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListProductsInProductSetResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Product.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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) == 0x00000001)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.class, com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.Builder.class); + } + + private int bitField0_; + public static final int PRODUCTS_FIELD_NUMBER = 1; + private java.util.List products_; + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List getProductsList() { + return products_; + } + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public int getProductsCount() { + return products_.size(); + } + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product getProducts(int index) { + return products_.get(index); + } + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductsOrBuilder( + int index) { + return products_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + } + } + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, products_.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.vision.v1p3beta1.ListProductsInProductSetResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse other = (com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) obj; + + boolean result = true; + result = result && getProductsList() + .equals(other.getProductsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().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.vision.v1p3beta1.ListProductsInProductSetResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse 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.vision.v1p3beta1.ListProductsInProductSetResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse 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.vision.v1p3beta1.ListProductsInProductSetResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse 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.vision.v1p3beta1.ListProductsInProductSetResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse 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.vision.v1p3beta1.ListProductsInProductSetResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response message for the `ListProductsInProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.class, com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse build() { + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse result = new com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.getDefaultInstance()) return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getProductsFieldBuilder() : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + products_ = new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> productsBuilder_; + + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1p3beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.vision.v1p3beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1p3beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addProducts( + com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder getProductsBuilder( + int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductsOrBuilder( + int index) { + if (productsBuilder_ == null) { + return products_.get(index); } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance()); + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder addProductsBuilder( + int index) { + return getProductsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance()); + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder>( + products_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + products_ = null; + } + return productsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) + private static final com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListProductsInProductSetResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsInProductSetResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetResponseOrBuilder.java new file mode 100644 index 000000000000..032e7d6b6649 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsInProductSetResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ListProductsInProductSetResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + java.util.List + getProductsList(); + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + com.google.cloud.vision.v1p3beta1.Product getProducts(int index); + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + int getProductsCount(); + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductsOrBuilder( + int index); + + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsRequest.java new file mode 100644 index 000000000000..f92c19770540 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsRequest.java @@ -0,0 +1,795 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `ListProducts` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductsRequest} + */ +public final class ListProductsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ListProductsRequest) + ListProductsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListProductsRequest.newBuilder() to construct. + private ListProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListProductsRequest() { + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListProductsRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + } + } + } 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductsRequest.class, com.google.cloud.vision.v1p3beta1.ListProductsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The project OR ProductSet from which Products should be listed.
+   * Format:
+   * `projects/PROJECT_ID/locations/LOC_ID`
+   * 
+ * + * 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 project OR ProductSet from which Products should be listed.
+   * Format:
+   * `projects/PROJECT_ID/locations/LOC_ID`
+   * 
+ * + * 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ListProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ListProductsRequest other = (com.google.cloud.vision.v1p3beta1.ListProductsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest 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.vision.v1p3beta1.ListProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest 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.vision.v1p3beta1.ListProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest 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.vision.v1p3beta1.ListProductsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest 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.vision.v1p3beta1.ListProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ListProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `ListProducts` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ListProductsRequest) + com.google.cloud.vision.v1p3beta1.ListProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductsRequest.class, com.google.cloud.vision.v1p3beta1.ListProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ListProductsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ListProductsRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ListProductsRequest build() { + com.google.cloud.vision.v1p3beta1.ListProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.ListProductsRequest result = new com.google.cloud.vision.v1p3beta1.ListProductsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ListProductsRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ListProductsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ListProductsRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.ListProductsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ListProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ListProductsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The project OR ProductSet from which Products should be listed.
+     * Format:
+     * `projects/PROJECT_ID/locations/LOC_ID`
+     * 
+ * + * 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 project OR ProductSet from which Products should be listed.
+     * Format:
+     * `projects/PROJECT_ID/locations/LOC_ID`
+     * 
+ * + * 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 project OR ProductSet from which Products should be listed.
+     * Format:
+     * `projects/PROJECT_ID/locations/LOC_ID`
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The project OR ProductSet from which Products should be listed.
+     * Format:
+     * `projects/PROJECT_ID/locations/LOC_ID`
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The project OR ProductSet from which Products should be listed.
+     * Format:
+     * `projects/PROJECT_ID/locations/LOC_ID`
+     * 
+ * + * 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 int pageSize_ ; + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + 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; + } + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ListProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductsRequest) + private static final com.google.cloud.vision.v1p3beta1.ListProductsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ListProductsRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.ListProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsRequestOrBuilder.java new file mode 100644 index 000000000000..6660647b18c0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ListProductsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ListProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The project OR ProductSet from which Products should be listed.
+   * Format:
+   * `projects/PROJECT_ID/locations/LOC_ID`
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The project OR ProductSet from which Products should be listed.
+   * Format:
+   * `projects/PROJECT_ID/locations/LOC_ID`
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsResponse.java new file mode 100644 index 000000000000..2a940afb2fc7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsResponse.java @@ -0,0 +1,999 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response message for the `ListProducts` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductsResponse} + */ +public final class ListProductsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ListProductsResponse) + ListProductsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListProductsResponse.newBuilder() to construct. + private ListProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListProductsResponse() { + products_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListProductsResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Product.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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) == 0x00000001)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductsResponse.class, com.google.cloud.vision.v1p3beta1.ListProductsResponse.Builder.class); + } + + private int bitField0_; + public static final int PRODUCTS_FIELD_NUMBER = 1; + private java.util.List products_; + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List getProductsList() { + return products_; + } + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public int getProductsCount() { + return products_.size(); + } + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product getProducts(int index) { + return products_.get(index); + } + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductsOrBuilder( + int index) { + return products_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + } + } + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, products_.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.vision.v1p3beta1.ListProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ListProductsResponse other = (com.google.cloud.vision.v1p3beta1.ListProductsResponse) obj; + + boolean result = true; + result = result && getProductsList() + .equals(other.getProductsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().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.vision.v1p3beta1.ListProductsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsResponse 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.vision.v1p3beta1.ListProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsResponse 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.vision.v1p3beta1.ListProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsResponse 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.vision.v1p3beta1.ListProductsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsResponse 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.vision.v1p3beta1.ListProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ListProductsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response message for the `ListProducts` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListProductsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ListProductsResponse) + com.google.cloud.vision.v1p3beta1.ListProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListProductsResponse.class, com.google.cloud.vision.v1p3beta1.ListProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ListProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ListProductsResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ListProductsResponse build() { + com.google.cloud.vision.v1p3beta1.ListProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.ListProductsResponse result = new com.google.cloud.vision.v1p3beta1.ListProductsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ListProductsResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ListProductsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ListProductsResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.ListProductsResponse.getDefaultInstance()) return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getProductsFieldBuilder() : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ListProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ListProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + products_ = new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> productsBuilder_; + + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1p3beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.vision.v1p3beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1p3beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addProducts( + com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder getProductsBuilder( + int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductsOrBuilder( + int index) { + if (productsBuilder_ == null) { + return products_.get(index); } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance()); + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder addProductsBuilder( + int index) { + return getProductsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance()); + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder>( + products_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + products_ = null; + } + return productsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ListProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductsResponse) + private static final com.google.cloud.vision.v1p3beta1.ListProductsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ListProductsResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.ListProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ListProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsResponseOrBuilder.java new file mode 100644 index 000000000000..751e545a2fad --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListProductsResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ListProductsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ListProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + java.util.List + getProductsList(); + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + com.google.cloud.vision.v1p3beta1.Product getProducts(int index); + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + int getProductsCount(); + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product products = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductsOrBuilder( + int index); + + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesRequest.java new file mode 100644 index 000000000000..af5037435f17 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesRequest.java @@ -0,0 +1,809 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `ListReferenceImages` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListReferenceImagesRequest} + */ +public final class ListReferenceImagesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) + ListReferenceImagesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListReferenceImagesRequest.newBuilder() to construct. + private ListReferenceImagesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListReferenceImagesRequest() { + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListReferenceImagesRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + } + } + } 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.class, com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Resource name of the product containing the reference images.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * 
+ * + * 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 product containing the reference images.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * 
+ * + * 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * A token identifying a page of results to be returned. This is the value
+   * of `nextPageToken` returned in a previous reference image list request.
+   * Defaults to the first page if not specified.
+   * 
+ * + * string page_token = 3; + */ + 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 to be returned. This is the value
+   * of `nextPageToken` returned in a previous reference image list request.
+   * Defaults to the first page if not specified.
+   * 
+ * + * string page_token = 3; + */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest other = (com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest 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.vision.v1p3beta1.ListReferenceImagesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest 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.vision.v1p3beta1.ListReferenceImagesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest 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.vision.v1p3beta1.ListReferenceImagesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest 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.vision.v1p3beta1.ListReferenceImagesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `ListReferenceImages` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListReferenceImagesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.class, com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest build() { + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest result = new com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Resource name of the product containing the reference images.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * 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 product containing the reference images.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * 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 product containing the reference images.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * 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 product containing the reference images.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the product containing the reference images.
+     * Format is
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * 
+ * + * 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 int pageSize_ ; + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * A token identifying a page of results to be returned. This is the value
+     * of `nextPageToken` returned in a previous reference image list request.
+     * Defaults to the first page if not specified.
+     * 
+ * + * string page_token = 3; + */ + 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 to be returned. This is the value
+     * of `nextPageToken` returned in a previous reference image list request.
+     * Defaults to the first page if not specified.
+     * 
+ * + * string page_token = 3; + */ + 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 to be returned. This is the value
+     * of `nextPageToken` returned in a previous reference image list request.
+     * Defaults to the first page if not specified.
+     * 
+ * + * string page_token = 3; + */ + 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 to be returned. This is the value
+     * of `nextPageToken` returned in a previous reference image list request.
+     * Defaults to the first page if not specified.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token identifying a page of results to be returned. This is the value
+     * of `nextPageToken` returned in a previous reference image list request.
+     * Defaults to the first page if not specified.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) + private static final com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListReferenceImagesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListReferenceImagesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesRequestOrBuilder.java new file mode 100644 index 000000000000..e1079efd3123 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesRequestOrBuilder.java @@ -0,0 +1,62 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ListReferenceImagesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the product containing the reference images.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Resource name of the product containing the reference images.
+   * Format is
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + *
+   * A token identifying a page of results to be returned. This is the value
+   * of `nextPageToken` returned in a previous reference image list request.
+   * Defaults to the first page if not specified.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + *
+   * A token identifying a page of results to be returned. This is the value
+   * of `nextPageToken` returned in a previous reference image list request.
+   * Defaults to the first page if not specified.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesResponse.java new file mode 100644 index 000000000000..604a07467ded --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesResponse.java @@ -0,0 +1,1066 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Response message for the `ListReferenceImages` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListReferenceImagesResponse} + */ +public final class ListReferenceImagesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) + ListReferenceImagesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListReferenceImagesResponse.newBuilder() to construct. + private ListReferenceImagesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListReferenceImagesResponse() { + referenceImages_ = java.util.Collections.emptyList(); + pageSize_ = 0; + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListReferenceImagesResponse( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + referenceImages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + referenceImages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.ReferenceImage.parser(), extensionRegistry)); + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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) == 0x00000001)) { + referenceImages_ = java.util.Collections.unmodifiableList(referenceImages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.class, com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.Builder.class); + } + + private int bitField0_; + public static final int REFERENCE_IMAGES_FIELD_NUMBER = 1; + private java.util.List referenceImages_; + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List getReferenceImagesList() { + return referenceImages_; + } + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesOrBuilderList() { + return referenceImages_; + } + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public int getReferenceImagesCount() { + return referenceImages_.size(); + } + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImages(int index) { + return referenceImages_.get(index); + } + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImagesOrBuilder( + int index) { + return referenceImages_.get(index); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string next_page_token = 3; + */ + 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; + } + } + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string next_page_token = 3; + */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < referenceImages_.size(); i++) { + output.writeMessage(1, referenceImages_.get(i)); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < referenceImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, referenceImages_.get(i)); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.vision.v1p3beta1.ListReferenceImagesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse other = (com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) obj; + + boolean result = true; + result = result && getReferenceImagesList() + .equals(other.getReferenceImagesList()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getReferenceImagesCount() > 0) { + hash = (37 * hash) + REFERENCE_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getReferenceImagesList().hashCode(); + } + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + 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.vision.v1p3beta1.ListReferenceImagesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse 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.vision.v1p3beta1.ListReferenceImagesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse 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.vision.v1p3beta1.ListReferenceImagesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse 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.vision.v1p3beta1.ListReferenceImagesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse 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.vision.v1p3beta1.ListReferenceImagesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response message for the `ListReferenceImages` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ListReferenceImagesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.class, com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getReferenceImagesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (referenceImagesBuilder_ == null) { + referenceImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + referenceImagesBuilder_.clear(); + } + pageSize_ = 0; + + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse build() { + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse buildPartial() { + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse result = new com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (referenceImagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + referenceImages_ = java.util.Collections.unmodifiableList(referenceImages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.referenceImages_ = referenceImages_; + } else { + result.referenceImages_ = referenceImagesBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse other) { + if (other == com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.getDefaultInstance()) return this; + if (referenceImagesBuilder_ == null) { + if (!other.referenceImages_.isEmpty()) { + if (referenceImages_.isEmpty()) { + referenceImages_ = other.referenceImages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReferenceImagesIsMutable(); + referenceImages_.addAll(other.referenceImages_); + } + onChanged(); + } + } else { + if (!other.referenceImages_.isEmpty()) { + if (referenceImagesBuilder_.isEmpty()) { + referenceImagesBuilder_.dispose(); + referenceImagesBuilder_ = null; + referenceImages_ = other.referenceImages_; + bitField0_ = (bitField0_ & ~0x00000001); + referenceImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getReferenceImagesFieldBuilder() : null; + } else { + referenceImagesBuilder_.addAllMessages(other.referenceImages_); + } + } + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List referenceImages_ = + java.util.Collections.emptyList(); + private void ensureReferenceImagesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + referenceImages_ = new java.util.ArrayList(referenceImages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder> referenceImagesBuilder_; + + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List getReferenceImagesList() { + if (referenceImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(referenceImages_); + } else { + return referenceImagesBuilder_.getMessageList(); + } + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public int getReferenceImagesCount() { + if (referenceImagesBuilder_ == null) { + return referenceImages_.size(); + } else { + return referenceImagesBuilder_.getCount(); + } + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImages(int index) { + if (referenceImagesBuilder_ == null) { + return referenceImages_.get(index); + } else { + return referenceImagesBuilder_.getMessage(index); + } + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1p3beta1.ReferenceImage value) { + if (referenceImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferenceImagesIsMutable(); + referenceImages_.set(index, value); + onChanged(); + } else { + referenceImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder builderForValue) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + referenceImages_.set(index, builderForValue.build()); + onChanged(); + } else { + referenceImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages(com.google.cloud.vision.v1p3beta1.ReferenceImage value) { + if (referenceImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferenceImagesIsMutable(); + referenceImages_.add(value); + onChanged(); + } else { + referenceImagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1p3beta1.ReferenceImage value) { + if (referenceImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferenceImagesIsMutable(); + referenceImages_.add(index, value); + onChanged(); + } else { + referenceImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder builderForValue) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + referenceImages_.add(builderForValue.build()); + onChanged(); + } else { + referenceImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder builderForValue) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + referenceImages_.add(index, builderForValue.build()); + onChanged(); + } else { + referenceImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder addAllReferenceImages( + java.lang.Iterable values) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, referenceImages_); + onChanged(); + } else { + referenceImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder clearReferenceImages() { + if (referenceImagesBuilder_ == null) { + referenceImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + referenceImagesBuilder_.clear(); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public Builder removeReferenceImages(int index) { + if (referenceImagesBuilder_ == null) { + ensureReferenceImagesIsMutable(); + referenceImages_.remove(index); + onChanged(); + } else { + referenceImagesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder getReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImagesOrBuilder( + int index) { + if (referenceImagesBuilder_ == null) { + return referenceImages_.get(index); } else { + return referenceImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesOrBuilderList() { + if (referenceImagesBuilder_ != null) { + return referenceImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(referenceImages_); + } + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder addReferenceImagesBuilder() { + return getReferenceImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance()); + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder addReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance()); + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesBuilderList() { + return getReferenceImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder> + getReferenceImagesFieldBuilder() { + if (referenceImagesBuilder_ == null) { + referenceImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ReferenceImage, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder, com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder>( + referenceImages_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + referenceImages_ = null; + } + return referenceImagesBuilder_; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return. Default 10, maximum 100.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string next_page_token = 3; + */ + 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; + } + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string next_page_token = 3; + */ + 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; + } + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next_page_token returned from a previous List request, if any.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) + private static final com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse(); + } + + public static com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListReferenceImagesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListReferenceImagesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesResponseOrBuilder.java new file mode 100644 index 000000000000..ed765d4b4fc7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ListReferenceImagesResponseOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ListReferenceImagesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesList(); + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1p3beta1.ReferenceImage getReferenceImages(int index); + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + int getReferenceImagesCount(); + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesOrBuilderList(); + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder getReferenceImagesOrBuilder( + int index); + + /** + *
+   * The maximum number of items to return. Default 10, maximum 100.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string next_page_token = 3; + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next_page_token returned from a previous List request, if any.
+   * 
+ * + * string next_page_token = 3; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocalizedObjectAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocalizedObjectAnnotation.java new file mode 100644 index 000000000000..8ba3fc40e8fd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocalizedObjectAnnotation.java @@ -0,0 +1,1182 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Set of detected objects with bounding boxes.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation} + */ +public final class LocalizedObjectAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) + LocalizedObjectAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use LocalizedObjectAnnotation.newBuilder() to construct. + private LocalizedObjectAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LocalizedObjectAnnotation() { + mid_ = ""; + languageCode_ = ""; + name_ = ""; + score_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LocalizedObjectAnnotation( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + mid_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 37: { + + score_ = input.readFloat(); + break; + } + case 42: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.class, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder.class); + } + + public static final int MID_FIELD_NUMBER = 1; + private volatile java.lang.Object mid_; + /** + *
+   * Object ID that should align with EntityAnnotation mid.
+   * 
+ * + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + 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(); + mid_ = s; + return s; + } + } + /** + *
+   * Object ID that should align with EntityAnnotation mid.
+   * 
+ * + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + *
+   * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+   * information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+   * 
+ * + * string language_code = 2; + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + *
+   * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+   * information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+   * 
+ * + * string language_code = 2; + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object name_; + /** + *
+   * Object name, expressed in its `language_code` language.
+   * 
+ * + * string name = 3; + */ + 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; + } + } + /** + *
+   * Object name, expressed in its `language_code` language.
+   * 
+ * + * string name = 3; + */ + 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 SCORE_FIELD_NUMBER = 4; + private float score_; + /** + *
+   * Score of the result. Range [0, 1].
+   * 
+ * + * float score = 4; + */ + public float getScore() { + return score_; + } + + public static final int BOUNDING_POLY_FIELD_NUMBER = 5; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_; + /** + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + /** + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); + } + if (score_ != 0F) { + output.writeFloat(4, score_); + } + if (boundingPoly_ != null) { + output.writeMessage(5, getBoundingPoly()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, score_); + } + if (boundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getBoundingPoly()); + } + 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.vision.v1p3beta1.LocalizedObjectAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation other = (com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) obj; + + boolean result = true; + result = result && getMid() + .equals(other.getMid()); + result = result && getLanguageCode() + .equals(other.getLanguageCode()); + result = result && getName() + .equals(other.getName()); + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && (hasBoundingPoly() == other.hasBoundingPoly()); + if (hasBoundingPoly()) { + result = result && getBoundingPoly() + .equals(other.getBoundingPoly()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MID_FIELD_NUMBER; + hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation 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.vision.v1p3beta1.LocalizedObjectAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation 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.vision.v1p3beta1.LocalizedObjectAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation 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.vision.v1p3beta1.LocalizedObjectAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation 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.vision.v1p3beta1.LocalizedObjectAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Set of detected objects with bounding boxes.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.class, com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + mid_ = ""; + + languageCode_ = ""; + + name_ = ""; + + score_ = 0F; + + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocalizedObjectAnnotation_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation build() { + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation buildPartial() { + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation result = new com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation(this); + result.mid_ = mid_; + result.languageCode_ = languageCode_; + result.name_ = name_; + result.score_ = score_; + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation other) { + if (other == com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.getDefaultInstance()) return this; + if (!other.getMid().isEmpty()) { + mid_ = other.mid_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object mid_ = ""; + /** + *
+     * Object ID that should align with EntityAnnotation mid.
+     * 
+ * + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Object ID that should align with EntityAnnotation mid.
+     * 
+ * + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Object ID that should align with EntityAnnotation mid.
+     * 
+ * + * string mid = 1; + */ + public Builder setMid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mid_ = value; + onChanged(); + return this; + } + /** + *
+     * Object ID that should align with EntityAnnotation mid.
+     * 
+ * + * string mid = 1; + */ + public Builder clearMid() { + + mid_ = getDefaultInstance().getMid(); + onChanged(); + return this; + } + /** + *
+     * Object ID that should align with EntityAnnotation mid.
+     * 
+ * + * string mid = 1; + */ + public Builder setMidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mid_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Object name, expressed in its `language_code` language.
+     * 
+ * + * string name = 3; + */ + 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; + } + } + /** + *
+     * Object name, expressed in its `language_code` language.
+     * 
+ * + * string name = 3; + */ + 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; + } + } + /** + *
+     * Object name, expressed in its `language_code` language.
+     * 
+ * + * string name = 3; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Object name, expressed in its `language_code` language.
+     * 
+ * + * string name = 3; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Object name, expressed in its `language_code` language.
+     * 
+ * + * string name = 3; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private float score_ ; + /** + *
+     * Score of the result. Range [0, 1].
+     * 
+ * + * float score = 4; + */ + public float getScore() { + return score_; + } + /** + *
+     * Score of the result. Range [0, 1].
+     * 
+ * + * float score = 4; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+     * Score of the result. Range [0, 1].
+     * 
+ * + * float score = 4; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingPolyBuilder_; + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public boolean hasBoundingPoly() { + return boundingPolyBuilder_ != null || boundingPoly_ != null; + } + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingPoly_ = value; + onChanged(); + } else { + boundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = builderForValue.build(); + onChanged(); + } else { + boundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingPoly_).mergeFrom(value).buildPartial(); + } else { + boundingPoly_ = value; + } + onChanged(); + } else { + boundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public Builder clearBoundingPoly() { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + onChanged(); + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + + return this; + } + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + } + /** + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), + getParentForChildren(), + isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) + private static final com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation(); + } + + public static com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LocalizedObjectAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocalizedObjectAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocalizedObjectAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocalizedObjectAnnotationOrBuilder.java new file mode 100644 index 000000000000..31e77dc78b7b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocalizedObjectAnnotationOrBuilder.java @@ -0,0 +1,101 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface LocalizedObjectAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Object ID that should align with EntityAnnotation mid.
+   * 
+ * + * string mid = 1; + */ + java.lang.String getMid(); + /** + *
+   * Object ID that should align with EntityAnnotation mid.
+   * 
+ * + * string mid = 1; + */ + com.google.protobuf.ByteString + getMidBytes(); + + /** + *
+   * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+   * information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+   * 
+ * + * string language_code = 2; + */ + java.lang.String getLanguageCode(); + /** + *
+   * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+   * information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+   * 
+ * + * string language_code = 2; + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); + + /** + *
+   * Object name, expressed in its `language_code` language.
+   * 
+ * + * string name = 3; + */ + java.lang.String getName(); + /** + *
+   * Object name, expressed in its `language_code` language.
+   * 
+ * + * string name = 3; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Score of the result. Range [0, 1].
+   * 
+ * + * float score = 4; + */ + float getScore(); + + /** + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + boolean hasBoundingPoly(); + /** + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly(); + /** + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 5; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationInfo.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationInfo.java new file mode 100644 index 000000000000..1b99617ca03f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationInfo.java @@ -0,0 +1,626 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Detected entity location information.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.LocationInfo} + */ +public final class LocationInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.LocationInfo) + LocationInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use LocationInfo.newBuilder() to construct. + private LocationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LocationInfo() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LocationInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.type.LatLng.Builder subBuilder = null; + if (latLng_ != null) { + subBuilder = latLng_.toBuilder(); + } + latLng_ = input.readMessage(com.google.type.LatLng.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(latLng_); + latLng_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocationInfo_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.LocationInfo.class, com.google.cloud.vision.v1p3beta1.LocationInfo.Builder.class); + } + + public static final int LAT_LNG_FIELD_NUMBER = 1; + private com.google.type.LatLng latLng_; + /** + *
+   * lat/long location coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public boolean hasLatLng() { + return latLng_ != null; + } + /** + *
+   * lat/long location coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public com.google.type.LatLng getLatLng() { + return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_; + } + /** + *
+   * lat/long location coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public com.google.type.LatLngOrBuilder getLatLngOrBuilder() { + return getLatLng(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (latLng_ != null) { + output.writeMessage(1, getLatLng()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (latLng_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getLatLng()); + } + 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.vision.v1p3beta1.LocationInfo)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.LocationInfo other = (com.google.cloud.vision.v1p3beta1.LocationInfo) obj; + + boolean result = true; + result = result && (hasLatLng() == other.hasLatLng()); + if (hasLatLng()) { + result = result && getLatLng() + .equals(other.getLatLng()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasLatLng()) { + hash = (37 * hash) + LAT_LNG_FIELD_NUMBER; + hash = (53 * hash) + getLatLng().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.LocationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.LocationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Detected entity location information.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.LocationInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.LocationInfo) + com.google.cloud.vision.v1p3beta1.LocationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocationInfo_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.LocationInfo.class, com.google.cloud.vision.v1p3beta1.LocationInfo.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.LocationInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (latLngBuilder_ == null) { + latLng_ = null; + } else { + latLng_ = null; + latLngBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_LocationInfo_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.LocationInfo getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.LocationInfo.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.LocationInfo build() { + com.google.cloud.vision.v1p3beta1.LocationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.LocationInfo buildPartial() { + com.google.cloud.vision.v1p3beta1.LocationInfo result = new com.google.cloud.vision.v1p3beta1.LocationInfo(this); + if (latLngBuilder_ == null) { + result.latLng_ = latLng_; + } else { + result.latLng_ = latLngBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.LocationInfo) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.LocationInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.LocationInfo other) { + if (other == com.google.cloud.vision.v1p3beta1.LocationInfo.getDefaultInstance()) return this; + if (other.hasLatLng()) { + mergeLatLng(other.getLatLng()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.LocationInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.LocationInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.type.LatLng latLng_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> latLngBuilder_; + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public boolean hasLatLng() { + return latLngBuilder_ != null || latLng_ != null; + } + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public com.google.type.LatLng getLatLng() { + if (latLngBuilder_ == null) { + return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_; + } else { + return latLngBuilder_.getMessage(); + } + } + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder setLatLng(com.google.type.LatLng value) { + if (latLngBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latLng_ = value; + onChanged(); + } else { + latLngBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder setLatLng( + com.google.type.LatLng.Builder builderForValue) { + if (latLngBuilder_ == null) { + latLng_ = builderForValue.build(); + onChanged(); + } else { + latLngBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder mergeLatLng(com.google.type.LatLng value) { + if (latLngBuilder_ == null) { + if (latLng_ != null) { + latLng_ = + com.google.type.LatLng.newBuilder(latLng_).mergeFrom(value).buildPartial(); + } else { + latLng_ = value; + } + onChanged(); + } else { + latLngBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder clearLatLng() { + if (latLngBuilder_ == null) { + latLng_ = null; + onChanged(); + } else { + latLng_ = null; + latLngBuilder_ = null; + } + + return this; + } + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public com.google.type.LatLng.Builder getLatLngBuilder() { + + onChanged(); + return getLatLngFieldBuilder().getBuilder(); + } + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public com.google.type.LatLngOrBuilder getLatLngOrBuilder() { + if (latLngBuilder_ != null) { + return latLngBuilder_.getMessageOrBuilder(); + } else { + return latLng_ == null ? + com.google.type.LatLng.getDefaultInstance() : latLng_; + } + } + /** + *
+     * lat/long location coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + getLatLngFieldBuilder() { + if (latLngBuilder_ == null) { + latLngBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>( + getLatLng(), + getParentForChildren(), + isClean()); + latLng_ = null; + } + return latLngBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.LocationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.LocationInfo) + private static final com.google.cloud.vision.v1p3beta1.LocationInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.LocationInfo(); + } + + public static com.google.cloud.vision.v1p3beta1.LocationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LocationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocationInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.LocationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationInfoOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationInfoOrBuilder.java new file mode 100644 index 000000000000..1c956f139619 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationInfoOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface LocationInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.LocationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * lat/long location coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + boolean hasLatLng(); + /** + *
+   * lat/long location coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + com.google.type.LatLng getLatLng(); + /** + *
+   * lat/long location coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + com.google.type.LatLngOrBuilder getLatLngOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationName.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationName.java new file mode 100644 index 000000000000..9699c329f832 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/LocationName.java @@ -0,0 +1,189 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.vision.v1p3beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedBoundingPoly.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedBoundingPoly.java new file mode 100644 index 000000000000..1c1d68513a6f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedBoundingPoly.java @@ -0,0 +1,834 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A normalized bounding polygon around a portion of an image.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.NormalizedBoundingPoly} + */ +public final class NormalizedBoundingPoly extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) + NormalizedBoundingPolyOrBuilder { +private static final long serialVersionUID = 0L; + // Use NormalizedBoundingPoly.newBuilder() to construct. + private NormalizedBoundingPoly(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NormalizedBoundingPoly() { + vertices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private NormalizedBoundingPoly( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + vertices_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.NormalizedVertex.parser(), extensionRegistry)); + 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) == 0x00000001)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.class, com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.Builder.class); + } + + public static final int VERTICES_FIELD_NUMBER = 1; + private java.util.List vertices_; + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public java.util.List getVerticesList() { + return vertices_; + } + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + return vertices_; + } + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public int getVerticesCount() { + return vertices_.size(); + } + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex getVertices(int index) { + return vertices_.get(index); + } + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder getVerticesOrBuilder( + int index) { + return vertices_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < vertices_.size(); i++) { + output.writeMessage(1, vertices_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < vertices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, vertices_.get(i)); + } + 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.vision.v1p3beta1.NormalizedBoundingPoly)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly other = (com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) obj; + + boolean result = true; + result = result && getVerticesList() + .equals(other.getVerticesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getVerticesCount() > 0) { + hash = (37 * hash) + VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getVerticesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly 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.vision.v1p3beta1.NormalizedBoundingPoly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly 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.vision.v1p3beta1.NormalizedBoundingPoly parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly 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.vision.v1p3beta1.NormalizedBoundingPoly parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly 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.vision.v1p3beta1.NormalizedBoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 normalized bounding polygon around a portion of an image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.NormalizedBoundingPoly} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPolyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.class, com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getVerticesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + verticesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedBoundingPoly_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly build() { + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly buildPartial() { + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly result = new com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly(this); + int from_bitField0_ = bitField0_; + if (verticesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.vertices_ = vertices_; + } else { + result.vertices_ = verticesBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly other) { + if (other == com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.getDefaultInstance()) return this; + if (verticesBuilder_ == null) { + if (!other.vertices_.isEmpty()) { + if (vertices_.isEmpty()) { + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVerticesIsMutable(); + vertices_.addAll(other.vertices_); + } + onChanged(); + } + } else { + if (!other.vertices_.isEmpty()) { + if (verticesBuilder_.isEmpty()) { + verticesBuilder_.dispose(); + verticesBuilder_ = null; + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + verticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getVerticesFieldBuilder() : null; + } else { + verticesBuilder_.addAllMessages(other.vertices_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List vertices_ = + java.util.Collections.emptyList(); + private void ensureVerticesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = new java.util.ArrayList(vertices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedVertex, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder> verticesBuilder_; + + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public java.util.List getVerticesList() { + if (verticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(vertices_); + } else { + return verticesBuilder_.getMessageList(); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public int getVerticesCount() { + if (verticesBuilder_ == null) { + return vertices_.size(); + } else { + return verticesBuilder_.getCount(); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex getVertices(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessage(index); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.vision.v1p3beta1.NormalizedVertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.set(index, value); + onChanged(); + } else { + verticesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.set(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.vision.v1p3beta1.NormalizedVertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(value); + onChanged(); + } else { + verticesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.vision.v1p3beta1.NormalizedVertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(index, value); + onChanged(); + } else { + verticesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder addVertices( + com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder addAllVertices( + java.lang.Iterable values) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, vertices_); + onChanged(); + } else { + verticesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder clearVertices() { + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + verticesBuilder_.clear(); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public Builder removeVertices(int index) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.remove(index); + onChanged(); + } else { + verticesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder getVerticesBuilder( + int index) { + return getVerticesFieldBuilder().getBuilder(index); + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder getVerticesOrBuilder( + int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); } else { + return verticesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + if (verticesBuilder_ != null) { + return verticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(vertices_); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder addVerticesBuilder() { + return getVerticesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.NormalizedVertex.getDefaultInstance()); + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder addVerticesBuilder( + int index) { + return getVerticesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.NormalizedVertex.getDefaultInstance()); + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + public java.util.List + getVerticesBuilderList() { + return getVerticesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedVertex, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder> + getVerticesFieldBuilder() { + if (verticesBuilder_ == null) { + verticesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedVertex, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder>( + vertices_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + vertices_ = null; + } + return verticesBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) + private static final com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly(); + } + + public static com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public NormalizedBoundingPoly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NormalizedBoundingPoly(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedBoundingPolyOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedBoundingPolyOrBuilder.java new file mode 100644 index 000000000000..d10bdde2d5c7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedBoundingPolyOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface NormalizedBoundingPolyOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + java.util.List + getVerticesList(); + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + com.google.cloud.vision.v1p3beta1.NormalizedVertex getVertices(int index); + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + int getVerticesCount(); + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + java.util.List + getVerticesOrBuilderList(); + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.NormalizedVertex vertices = 1; + */ + com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder getVerticesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedVertex.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedVertex.java new file mode 100644 index 000000000000..5e9d9b2cc2d3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedVertex.java @@ -0,0 +1,555 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A vertex represents a 2D point in the image.
+ * NOTE: the normalized vertex coordinates are relative to the original image
+ * and range from 0 to 1.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.NormalizedVertex} + */ +public final class NormalizedVertex extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.NormalizedVertex) + NormalizedVertexOrBuilder { +private static final long serialVersionUID = 0L; + // Use NormalizedVertex.newBuilder() to construct. + private NormalizedVertex(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NormalizedVertex() { + x_ = 0F; + y_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private NormalizedVertex( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 13: { + + x_ = input.readFloat(); + break; + } + case 21: { + + y_ = input.readFloat(); + 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.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.NormalizedVertex.class, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder.class); + } + + public static final int X_FIELD_NUMBER = 1; + private float x_; + /** + *
+   * X coordinate.
+   * 
+ * + * float x = 1; + */ + public float getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 2; + private float y_; + /** + *
+   * Y coordinate.
+   * 
+ * + * float y = 2; + */ + public float getY() { + return y_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (x_ != 0F) { + output.writeFloat(1, x_); + } + if (y_ != 0F) { + output.writeFloat(2, y_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (x_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, x_); + } + if (y_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, y_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.NormalizedVertex)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.NormalizedVertex other = (com.google.cloud.vision.v1p3beta1.NormalizedVertex) obj; + + boolean result = true; + result = result && ( + java.lang.Float.floatToIntBits(getX()) + == java.lang.Float.floatToIntBits( + other.getX())); + result = result && ( + java.lang.Float.floatToIntBits(getY()) + == java.lang.Float.floatToIntBits( + other.getY())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.NormalizedVertex prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A vertex represents a 2D point in the image.
+   * NOTE: the normalized vertex coordinates are relative to the original image
+   * and range from 0 to 1.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.NormalizedVertex} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.NormalizedVertex) + com.google.cloud.vision.v1p3beta1.NormalizedVertexOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.NormalizedVertex.class, com.google.cloud.vision.v1p3beta1.NormalizedVertex.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.NormalizedVertex.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + x_ = 0F; + + y_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_NormalizedVertex_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.NormalizedVertex getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.NormalizedVertex.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.NormalizedVertex build() { + com.google.cloud.vision.v1p3beta1.NormalizedVertex result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.NormalizedVertex buildPartial() { + com.google.cloud.vision.v1p3beta1.NormalizedVertex result = new com.google.cloud.vision.v1p3beta1.NormalizedVertex(this); + result.x_ = x_; + result.y_ = y_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.NormalizedVertex) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.NormalizedVertex)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.NormalizedVertex other) { + if (other == com.google.cloud.vision.v1p3beta1.NormalizedVertex.getDefaultInstance()) return this; + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.NormalizedVertex parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.NormalizedVertex) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float x_ ; + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public float getX() { + return x_; + } + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public Builder setX(float value) { + + x_ = value; + onChanged(); + return this; + } + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public Builder clearX() { + + x_ = 0F; + onChanged(); + return this; + } + + private float y_ ; + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public float getY() { + return y_; + } + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public Builder setY(float value) { + + y_ = value; + onChanged(); + return this; + } + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public Builder clearY() { + + y_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.NormalizedVertex) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.NormalizedVertex) + private static final com.google.cloud.vision.v1p3beta1.NormalizedVertex DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.NormalizedVertex(); + } + + public static com.google.cloud.vision.v1p3beta1.NormalizedVertex getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public NormalizedVertex parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NormalizedVertex(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.NormalizedVertex getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedVertexOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedVertexOrBuilder.java new file mode 100644 index 000000000000..7ece1a3b34f0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/NormalizedVertexOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface NormalizedVertexOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.NormalizedVertex) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * X coordinate.
+   * 
+ * + * float x = 1; + */ + float getX(); + + /** + *
+   * Y coordinate.
+   * 
+ * + * float y = 2; + */ + float getY(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OperationMetadata.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OperationMetadata.java new file mode 100644 index 000000000000..539f520ab2e6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OperationMetadata.java @@ -0,0 +1,1135 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Contains metadata for the BatchAnnotateImages operation.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.OperationMetadata} + */ +public final class OperationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.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() { + state_ = 0; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + state_ = rawValue; + 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 50: { + 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; + } + } + } + } 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.OperationMetadata.class, com.google.cloud.vision.v1p3beta1.OperationMetadata.Builder.class); + } + + /** + *
+   * Batch operation states.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.OperationMetadata.State} + */ + public enum State + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Invalid.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + *
+     * Request is received.
+     * 
+ * + * CREATED = 1; + */ + CREATED(1), + /** + *
+     * Request is actively being processed.
+     * 
+ * + * RUNNING = 2; + */ + RUNNING(2), + /** + *
+     * The batch processing is done.
+     * 
+ * + * DONE = 3; + */ + DONE(3), + /** + *
+     * The batch processing was cancelled.
+     * 
+ * + * CANCELLED = 4; + */ + CANCELLED(4), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Invalid.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Request is received.
+     * 
+ * + * CREATED = 1; + */ + public static final int CREATED_VALUE = 1; + /** + *
+     * Request is actively being processed.
+     * 
+ * + * RUNNING = 2; + */ + public static final int RUNNING_VALUE = 2; + /** + *
+     * The batch processing is done.
+     * 
+ * + * DONE = 3; + */ + public static final int DONE_VALUE = 3; + /** + *
+     * The batch processing was cancelled.
+     * 
+ * + * CANCELLED = 4; + */ + public static final int CANCELLED_VALUE = 4; + + + 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 State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNSPECIFIED; + case 1: return CREATED; + case 2: return RUNNING; + case 3: return DONE; + case 4: return CANCELLED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.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.vision.v1p3beta1.OperationMetadata.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.OperationMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + *
+   * Current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * Current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1p3beta1.OperationMetadata.State getState() { + com.google.cloud.vision.v1p3beta1.OperationMetadata.State result = com.google.cloud.vision.v1p3beta1.OperationMetadata.State.valueOf(state_); + return result == null ? com.google.cloud.vision.v1p3beta1.OperationMetadata.State.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * The time when the batch request was received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * The time when the batch request was received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * The time when the batch request was received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + *
+   * The time when the operation result was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + *
+   * The time when the operation result was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + *
+   * The time when the operation result was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (state_ != com.google.cloud.vision.v1p3beta1.OperationMetadata.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, state_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ != com.google.cloud.vision.v1p3beta1.OperationMetadata.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, state_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getUpdateTime()); + } + 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.vision.v1p3beta1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.OperationMetadata other = (com.google.cloud.vision.v1p3beta1.OperationMetadata) obj; + + boolean result = true; + result = result && state_ == other.state_; + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime() + .equals(other.getUpdateTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.OperationMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OperationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 metadata for the BatchAnnotateImages operation.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.OperationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.OperationMetadata) + com.google.cloud.vision.v1p3beta1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.OperationMetadata.class, com.google.cloud.vision.v1p3beta1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.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) { + } + } + public Builder clear() { + super.clear(); + state_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OperationMetadata_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.OperationMetadata.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.OperationMetadata build() { + com.google.cloud.vision.v1p3beta1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.OperationMetadata buildPartial() { + com.google.cloud.vision.v1p3beta1.OperationMetadata result = new com.google.cloud.vision.v1p3beta1.OperationMetadata(this); + result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.OperationMetadata) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.OperationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.OperationMetadata other) { + if (other == com.google.cloud.vision.v1p3beta1.OperationMetadata.getDefaultInstance()) return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int state_ = 0; + /** + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1p3beta1.OperationMetadata.State getState() { + com.google.cloud.vision.v1p3beta1.OperationMetadata.State result = com.google.cloud.vision.v1p3beta1.OperationMetadata.State.valueOf(state_); + return result == null ? com.google.cloud.vision.v1p3beta1.OperationMetadata.State.UNRECOGNIZED : result; + } + /** + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + public Builder setState(com.google.cloud.vision.v1p3beta1.OperationMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .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(); + } + } + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .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; + } + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .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; + } + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .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; + } + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .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_; + } + } + /** + *
+     * The time when the batch request was received.
+     * 
+ * + * .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 com.google.protobuf.Timestamp updateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> updateTimeBuilder_; + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + 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; + } + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder setUpdateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + 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; + } + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + } + /** + *
+     * The time when the operation result was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + 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_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.OperationMetadata) + private static final com.google.cloud.vision.v1p3beta1.OperationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.OperationMetadata(); + } + + public static com.google.cloud.vision.v1p3beta1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.vision.v1p3beta1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..196084eeef1e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OperationMetadataOrBuilder.java @@ -0,0 +1,76 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface OperationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + int getStateValue(); + /** + *
+   * Current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.OperationMetadata.State state = 1; + */ + com.google.cloud.vision.v1p3beta1.OperationMetadata.State getState(); + + /** + *
+   * The time when the batch request was received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + boolean hasCreateTime(); + /** + *
+   * The time when the batch request was received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * The time when the batch request was received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * The time when the operation result was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + boolean hasUpdateTime(); + /** + *
+   * The time when the operation result was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + *
+   * The time when the operation result was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OutputConfig.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OutputConfig.java new file mode 100644 index 000000000000..06719050a50e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OutputConfig.java @@ -0,0 +1,732 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * The desired output location and metadata.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.OutputConfig} + */ +public final class OutputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.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() { + batchSize_ = 0; + } + + @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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.GcsDestination.Builder subBuilder = null; + if (gcsDestination_ != null) { + subBuilder = gcsDestination_.toBuilder(); + } + gcsDestination_ = input.readMessage(com.google.cloud.vision.v1p3beta1.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gcsDestination_); + gcsDestination_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + batchSize_ = input.readInt32(); + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OutputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.OutputConfig.class, com.google.cloud.vision.v1p3beta1.OutputConfig.Builder.class); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.GcsDestination gcsDestination_; + /** + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public boolean hasGcsDestination() { + return gcsDestination_ != null; + } + /** + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsDestination getGcsDestination() { + return gcsDestination_ == null ? com.google.cloud.vision.v1p3beta1.GcsDestination.getDefaultInstance() : gcsDestination_; + } + /** + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + return getGcsDestination(); + } + + public static final int BATCH_SIZE_FIELD_NUMBER = 2; + private int batchSize_; + /** + *
+   * The max number of response protos to put into each output JSON file on
+   * Google Cloud Storage.
+   * The valid range is [1, 100]. If not specified, the default value is 20.
+   * For example, for one pdf file with 100 pages, 100 response protos will
+   * be generated. If `batch_size` = 20, then 5 json files each
+   * containing 20 response protos will be written under the prefix
+   * `gcs_destination`.`uri`.
+   * Currently, batch_size only applies to GcsDestination, with potential future
+   * support for other output configurations.
+   * 
+ * + * int32 batch_size = 2; + */ + public int getBatchSize() { + return batchSize_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (gcsDestination_ != null) { + output.writeMessage(1, getGcsDestination()); + } + if (batchSize_ != 0) { + output.writeInt32(2, batchSize_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsDestination_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getGcsDestination()); + } + if (batchSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, batchSize_); + } + 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.vision.v1p3beta1.OutputConfig)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.OutputConfig other = (com.google.cloud.vision.v1p3beta1.OutputConfig) obj; + + boolean result = true; + result = result && (hasGcsDestination() == other.hasGcsDestination()); + if (hasGcsDestination()) { + result = result && getGcsDestination() + .equals(other.getGcsDestination()); + } + result = result && (getBatchSize() + == other.getBatchSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcsDestination()) { + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + } + hash = (37 * hash) + BATCH_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getBatchSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.OutputConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.OutputConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.OutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OutputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.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); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.OutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 desired output location and metadata.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.OutputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.OutputConfig) + com.google.cloud.vision.v1p3beta1.OutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OutputConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.OutputConfig.class, com.google.cloud.vision.v1p3beta1.OutputConfig.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.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) { + } + } + public Builder clear() { + super.clear(); + if (gcsDestinationBuilder_ == null) { + gcsDestination_ = null; + } else { + gcsDestination_ = null; + gcsDestinationBuilder_ = null; + } + batchSize_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_OutputConfig_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.OutputConfig getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.OutputConfig.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.OutputConfig build() { + com.google.cloud.vision.v1p3beta1.OutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.OutputConfig buildPartial() { + com.google.cloud.vision.v1p3beta1.OutputConfig result = new com.google.cloud.vision.v1p3beta1.OutputConfig(this); + if (gcsDestinationBuilder_ == null) { + result.gcsDestination_ = gcsDestination_; + } else { + result.gcsDestination_ = gcsDestinationBuilder_.build(); + } + result.batchSize_ = batchSize_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.OutputConfig) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.OutputConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.OutputConfig other) { + if (other == com.google.cloud.vision.v1p3beta1.OutputConfig.getDefaultInstance()) return this; + if (other.hasGcsDestination()) { + mergeGcsDestination(other.getGcsDestination()); + } + if (other.getBatchSize() != 0) { + setBatchSize(other.getBatchSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.OutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.OutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.GcsDestination gcsDestination_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.GcsDestination, com.google.cloud.vision.v1p3beta1.GcsDestination.Builder, com.google.cloud.vision.v1p3beta1.GcsDestinationOrBuilder> gcsDestinationBuilder_; + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public boolean hasGcsDestination() { + return gcsDestinationBuilder_ != null || gcsDestination_ != null; + } + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + return gcsDestination_ == null ? com.google.cloud.vision.v1p3beta1.GcsDestination.getDefaultInstance() : gcsDestination_; + } else { + return gcsDestinationBuilder_.getMessage(); + } + } + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination(com.google.cloud.vision.v1p3beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsDestination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.vision.v1p3beta1.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + gcsDestination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination(com.google.cloud.vision.v1p3beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (gcsDestination_ != null) { + gcsDestination_ = + com.google.cloud.vision.v1p3beta1.GcsDestination.newBuilder(gcsDestination_).mergeFrom(value).buildPartial(); + } else { + gcsDestination_ = value; + } + onChanged(); + } else { + gcsDestinationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + gcsDestination_ = null; + onChanged(); + } else { + gcsDestination_ = null; + gcsDestinationBuilder_ = null; + } + + return this; + } + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsDestination.Builder getGcsDestinationBuilder() { + + onChanged(); + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p3beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (gcsDestinationBuilder_ != null) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + return gcsDestination_ == null ? + com.google.cloud.vision.v1p3beta1.GcsDestination.getDefaultInstance() : gcsDestination_; + } + } + /** + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.GcsDestination, com.google.cloud.vision.v1p3beta1.GcsDestination.Builder, com.google.cloud.vision.v1p3beta1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + gcsDestinationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.GcsDestination, com.google.cloud.vision.v1p3beta1.GcsDestination.Builder, com.google.cloud.vision.v1p3beta1.GcsDestinationOrBuilder>( + getGcsDestination(), + getParentForChildren(), + isClean()); + gcsDestination_ = null; + } + return gcsDestinationBuilder_; + } + + private int batchSize_ ; + /** + *
+     * The max number of response protos to put into each output JSON file on
+     * Google Cloud Storage.
+     * The valid range is [1, 100]. If not specified, the default value is 20.
+     * For example, for one pdf file with 100 pages, 100 response protos will
+     * be generated. If `batch_size` = 20, then 5 json files each
+     * containing 20 response protos will be written under the prefix
+     * `gcs_destination`.`uri`.
+     * Currently, batch_size only applies to GcsDestination, with potential future
+     * support for other output configurations.
+     * 
+ * + * int32 batch_size = 2; + */ + public int getBatchSize() { + return batchSize_; + } + /** + *
+     * The max number of response protos to put into each output JSON file on
+     * Google Cloud Storage.
+     * The valid range is [1, 100]. If not specified, the default value is 20.
+     * For example, for one pdf file with 100 pages, 100 response protos will
+     * be generated. If `batch_size` = 20, then 5 json files each
+     * containing 20 response protos will be written under the prefix
+     * `gcs_destination`.`uri`.
+     * Currently, batch_size only applies to GcsDestination, with potential future
+     * support for other output configurations.
+     * 
+ * + * int32 batch_size = 2; + */ + public Builder setBatchSize(int value) { + + batchSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The max number of response protos to put into each output JSON file on
+     * Google Cloud Storage.
+     * The valid range is [1, 100]. If not specified, the default value is 20.
+     * For example, for one pdf file with 100 pages, 100 response protos will
+     * be generated. If `batch_size` = 20, then 5 json files each
+     * containing 20 response protos will be written under the prefix
+     * `gcs_destination`.`uri`.
+     * Currently, batch_size only applies to GcsDestination, with potential future
+     * support for other output configurations.
+     * 
+ * + * int32 batch_size = 2; + */ + public Builder clearBatchSize() { + + batchSize_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.OutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.OutputConfig) + private static final com.google.cloud.vision.v1p3beta1.OutputConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.OutputConfig(); + } + + public static com.google.cloud.vision.v1p3beta1.OutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + 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; + } + + public com.google.cloud.vision.v1p3beta1.OutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OutputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OutputConfigOrBuilder.java new file mode 100644 index 000000000000..1004b13eb917 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/OutputConfigOrBuilder.java @@ -0,0 +1,51 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface OutputConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.OutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + boolean hasGcsDestination(); + /** + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + com.google.cloud.vision.v1p3beta1.GcsDestination getGcsDestination(); + /** + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.GcsDestination gcs_destination = 1; + */ + com.google.cloud.vision.v1p3beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + /** + *
+   * The max number of response protos to put into each output JSON file on
+   * Google Cloud Storage.
+   * The valid range is [1, 100]. If not specified, the default value is 20.
+   * For example, for one pdf file with 100 pages, 100 response protos will
+   * be generated. If `batch_size` = 20, then 5 json files each
+   * containing 20 response protos will be written under the prefix
+   * `gcs_destination`.`uri`.
+   * Currently, batch_size only applies to GcsDestination, with potential future
+   * support for other output configurations.
+   * 
+ * + * int32 batch_size = 2; + */ + int getBatchSize(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Page.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Page.java new file mode 100644 index 000000000000..a8c539acb202 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Page.java @@ -0,0 +1,1299 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Detected page from OCR.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Page} + */ +public final class Page extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Page) + PageOrBuilder { +private static final long serialVersionUID = 0L; + // Use Page.newBuilder() to construct. + private Page(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Page() { + width_ = 0; + height_ = 0; + blocks_ = java.util.Collections.emptyList(); + confidence_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Page( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder subBuilder = null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = input.readMessage(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + width_ = input.readInt32(); + break; + } + case 24: { + + height_ = input.readInt32(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + blocks_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + blocks_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Block.parser(), extensionRegistry)); + break; + } + case 45: { + + confidence_ = input.readFloat(); + 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) == 0x00000008)) { + blocks_ = java.util.Collections.unmodifiableList(blocks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Page_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Page_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Page.class, com.google.cloud.vision.v1p3beta1.Page.Builder.class); + } + + private int bitField0_; + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_; + /** + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + /** + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + return getProperty(); + } + + public static final int WIDTH_FIELD_NUMBER = 2; + private int width_; + /** + *
+   * Page width. For PDFs the unit is points. For images (including
+   * TIFFs) the unit is pixels.
+   * 
+ * + * int32 width = 2; + */ + public int getWidth() { + return width_; + } + + public static final int HEIGHT_FIELD_NUMBER = 3; + private int height_; + /** + *
+   * Page height. For PDFs the unit is points. For images (including
+   * TIFFs) the unit is pixels.
+   * 
+ * + * int32 height = 3; + */ + public int getHeight() { + return height_; + } + + public static final int BLOCKS_FIELD_NUMBER = 4; + private java.util.List blocks_; + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public java.util.List getBlocksList() { + return blocks_; + } + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public java.util.List + getBlocksOrBuilderList() { + return blocks_; + } + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public int getBlocksCount() { + return blocks_.size(); + } + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p3beta1.Block getBlocks(int index) { + return blocks_.get(index); + } + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p3beta1.BlockOrBuilder getBlocksOrBuilder( + int index) { + return blocks_.get(index); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 5; + private float confidence_; + /** + *
+   * Confidence of the OCR results on the page. Range [0, 1].
+   * 
+ * + * float confidence = 5; + */ + public float getConfidence() { + return confidence_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (property_ != null) { + output.writeMessage(1, getProperty()); + } + if (width_ != 0) { + output.writeInt32(2, width_); + } + if (height_ != 0) { + output.writeInt32(3, height_); + } + for (int i = 0; i < blocks_.size(); i++) { + output.writeMessage(4, blocks_.get(i)); + } + if (confidence_ != 0F) { + output.writeFloat(5, confidence_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (property_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProperty()); + } + if (width_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, width_); + } + if (height_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, height_); + } + for (int i = 0; i < blocks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, blocks_.get(i)); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(5, confidence_); + } + 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.vision.v1p3beta1.Page)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Page other = (com.google.cloud.vision.v1p3beta1.Page) obj; + + boolean result = true; + result = result && (hasProperty() == other.hasProperty()); + if (hasProperty()) { + result = result && getProperty() + .equals(other.getProperty()); + } + result = result && (getWidth() + == other.getWidth()); + result = result && (getHeight() + == other.getHeight()); + result = result && getBlocksList() + .equals(other.getBlocksList()); + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProperty()) { + hash = (37 * hash) + PROPERTY_FIELD_NUMBER; + hash = (53 * hash) + getProperty().hashCode(); + } + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getWidth(); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getHeight(); + if (getBlocksCount() > 0) { + hash = (37 * hash) + BLOCKS_FIELD_NUMBER; + hash = (53 * hash) + getBlocksList().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Page parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Page 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.vision.v1p3beta1.Page parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Page 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.vision.v1p3beta1.Page parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Page parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Page parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Page 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.vision.v1p3beta1.Page parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Page 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.vision.v1p3beta1.Page parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Page parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Page prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Detected page from OCR.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Page} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Page) + com.google.cloud.vision.v1p3beta1.PageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Page_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Page_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Page.class, com.google.cloud.vision.v1p3beta1.Page.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Page.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getBlocksFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (propertyBuilder_ == null) { + property_ = null; + } else { + property_ = null; + propertyBuilder_ = null; + } + width_ = 0; + + height_ = 0; + + if (blocksBuilder_ == null) { + blocks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + blocksBuilder_.clear(); + } + confidence_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Page_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Page getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Page.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Page build() { + com.google.cloud.vision.v1p3beta1.Page result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Page buildPartial() { + com.google.cloud.vision.v1p3beta1.Page result = new com.google.cloud.vision.v1p3beta1.Page(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (propertyBuilder_ == null) { + result.property_ = property_; + } else { + result.property_ = propertyBuilder_.build(); + } + result.width_ = width_; + result.height_ = height_; + if (blocksBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + blocks_ = java.util.Collections.unmodifiableList(blocks_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.blocks_ = blocks_; + } else { + result.blocks_ = blocksBuilder_.build(); + } + result.confidence_ = confidence_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Page) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Page)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Page other) { + if (other == com.google.cloud.vision.v1p3beta1.Page.getDefaultInstance()) return this; + if (other.hasProperty()) { + mergeProperty(other.getProperty()); + } + if (other.getWidth() != 0) { + setWidth(other.getWidth()); + } + if (other.getHeight() != 0) { + setHeight(other.getHeight()); + } + if (blocksBuilder_ == null) { + if (!other.blocks_.isEmpty()) { + if (blocks_.isEmpty()) { + blocks_ = other.blocks_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureBlocksIsMutable(); + blocks_.addAll(other.blocks_); + } + onChanged(); + } + } else { + if (!other.blocks_.isEmpty()) { + if (blocksBuilder_.isEmpty()) { + blocksBuilder_.dispose(); + blocksBuilder_ = null; + blocks_ = other.blocks_; + bitField0_ = (bitField0_ & ~0x00000008); + blocksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getBlocksFieldBuilder() : null; + } else { + blocksBuilder_.addAllMessages(other.blocks_); + } + } + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Page parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Page) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> propertyBuilder_; + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + property_ = value; + onChanged(); + } else { + propertyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder builderForValue) { + if (propertyBuilder_ == null) { + property_ = builderForValue.build(); + onChanged(); + } else { + propertyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.newBuilder(property_).mergeFrom(value).buildPartial(); + } else { + property_ = value; + } + onChanged(); + } else { + propertyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder clearProperty() { + if (propertyBuilder_ == null) { + property_ = null; + onChanged(); + } else { + property_ = null; + propertyBuilder_ = null; + } + + return this; + } + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null ? + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + } + /** + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), + getParentForChildren(), + isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private int width_ ; + /** + *
+     * Page width. For PDFs the unit is points. For images (including
+     * TIFFs) the unit is pixels.
+     * 
+ * + * int32 width = 2; + */ + public int getWidth() { + return width_; + } + /** + *
+     * Page width. For PDFs the unit is points. For images (including
+     * TIFFs) the unit is pixels.
+     * 
+ * + * int32 width = 2; + */ + public Builder setWidth(int value) { + + width_ = value; + onChanged(); + return this; + } + /** + *
+     * Page width. For PDFs the unit is points. For images (including
+     * TIFFs) the unit is pixels.
+     * 
+ * + * int32 width = 2; + */ + public Builder clearWidth() { + + width_ = 0; + onChanged(); + return this; + } + + private int height_ ; + /** + *
+     * Page height. For PDFs the unit is points. For images (including
+     * TIFFs) the unit is pixels.
+     * 
+ * + * int32 height = 3; + */ + public int getHeight() { + return height_; + } + /** + *
+     * Page height. For PDFs the unit is points. For images (including
+     * TIFFs) the unit is pixels.
+     * 
+ * + * int32 height = 3; + */ + public Builder setHeight(int value) { + + height_ = value; + onChanged(); + return this; + } + /** + *
+     * Page height. For PDFs the unit is points. For images (including
+     * TIFFs) the unit is pixels.
+     * 
+ * + * int32 height = 3; + */ + public Builder clearHeight() { + + height_ = 0; + onChanged(); + return this; + } + + private java.util.List blocks_ = + java.util.Collections.emptyList(); + private void ensureBlocksIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + blocks_ = new java.util.ArrayList(blocks_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Block, com.google.cloud.vision.v1p3beta1.Block.Builder, com.google.cloud.vision.v1p3beta1.BlockOrBuilder> blocksBuilder_; + + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public java.util.List getBlocksList() { + if (blocksBuilder_ == null) { + return java.util.Collections.unmodifiableList(blocks_); + } else { + return blocksBuilder_.getMessageList(); + } + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public int getBlocksCount() { + if (blocksBuilder_ == null) { + return blocks_.size(); + } else { + return blocksBuilder_.getCount(); + } + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p3beta1.Block getBlocks(int index) { + if (blocksBuilder_ == null) { + return blocks_.get(index); + } else { + return blocksBuilder_.getMessage(index); + } + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder setBlocks( + int index, com.google.cloud.vision.v1p3beta1.Block value) { + if (blocksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlocksIsMutable(); + blocks_.set(index, value); + onChanged(); + } else { + blocksBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder setBlocks( + int index, com.google.cloud.vision.v1p3beta1.Block.Builder builderForValue) { + if (blocksBuilder_ == null) { + ensureBlocksIsMutable(); + blocks_.set(index, builderForValue.build()); + onChanged(); + } else { + blocksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder addBlocks(com.google.cloud.vision.v1p3beta1.Block value) { + if (blocksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlocksIsMutable(); + blocks_.add(value); + onChanged(); + } else { + blocksBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder addBlocks( + int index, com.google.cloud.vision.v1p3beta1.Block value) { + if (blocksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlocksIsMutable(); + blocks_.add(index, value); + onChanged(); + } else { + blocksBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder addBlocks( + com.google.cloud.vision.v1p3beta1.Block.Builder builderForValue) { + if (blocksBuilder_ == null) { + ensureBlocksIsMutable(); + blocks_.add(builderForValue.build()); + onChanged(); + } else { + blocksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder addBlocks( + int index, com.google.cloud.vision.v1p3beta1.Block.Builder builderForValue) { + if (blocksBuilder_ == null) { + ensureBlocksIsMutable(); + blocks_.add(index, builderForValue.build()); + onChanged(); + } else { + blocksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder addAllBlocks( + java.lang.Iterable values) { + if (blocksBuilder_ == null) { + ensureBlocksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, blocks_); + onChanged(); + } else { + blocksBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder clearBlocks() { + if (blocksBuilder_ == null) { + blocks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + blocksBuilder_.clear(); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public Builder removeBlocks(int index) { + if (blocksBuilder_ == null) { + ensureBlocksIsMutable(); + blocks_.remove(index); + onChanged(); + } else { + blocksBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p3beta1.Block.Builder getBlocksBuilder( + int index) { + return getBlocksFieldBuilder().getBuilder(index); + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p3beta1.BlockOrBuilder getBlocksOrBuilder( + int index) { + if (blocksBuilder_ == null) { + return blocks_.get(index); } else { + return blocksBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public java.util.List + getBlocksOrBuilderList() { + if (blocksBuilder_ != null) { + return blocksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blocks_); + } + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p3beta1.Block.Builder addBlocksBuilder() { + return getBlocksFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Block.getDefaultInstance()); + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p3beta1.Block.Builder addBlocksBuilder( + int index) { + return getBlocksFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Block.getDefaultInstance()); + } + /** + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + public java.util.List + getBlocksBuilderList() { + return getBlocksFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Block, com.google.cloud.vision.v1p3beta1.Block.Builder, com.google.cloud.vision.v1p3beta1.BlockOrBuilder> + getBlocksFieldBuilder() { + if (blocksBuilder_ == null) { + blocksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Block, com.google.cloud.vision.v1p3beta1.Block.Builder, com.google.cloud.vision.v1p3beta1.BlockOrBuilder>( + blocks_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + blocks_ = null; + } + return blocksBuilder_; + } + + private float confidence_ ; + /** + *
+     * Confidence of the OCR results on the page. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence of the OCR results on the page. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence of the OCR results on the page. Range [0, 1].
+     * 
+ * + * float confidence = 5; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Page) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Page) + private static final com.google.cloud.vision.v1p3beta1.Page DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Page(); + } + + public static com.google.cloud.vision.v1p3beta1.Page getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Page parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Page(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Page getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PageOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PageOrBuilder.java new file mode 100644 index 000000000000..39e1ebdee26a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PageOrBuilder.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface PageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Page) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty(); + /** + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder(); + + /** + *
+   * Page width. For PDFs the unit is points. For images (including
+   * TIFFs) the unit is pixels.
+   * 
+ * + * int32 width = 2; + */ + int getWidth(); + + /** + *
+   * Page height. For PDFs the unit is points. For images (including
+   * TIFFs) the unit is pixels.
+   * 
+ * + * int32 height = 3; + */ + int getHeight(); + + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + java.util.List + getBlocksList(); + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + com.google.cloud.vision.v1p3beta1.Block getBlocks(int index); + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + int getBlocksCount(); + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + java.util.List + getBlocksOrBuilderList(); + /** + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Block blocks = 4; + */ + com.google.cloud.vision.v1p3beta1.BlockOrBuilder getBlocksOrBuilder( + int index); + + /** + *
+   * Confidence of the OCR results on the page. Range [0, 1].
+   * 
+ * + * float confidence = 5; + */ + float getConfidence(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Paragraph.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Paragraph.java new file mode 100644 index 000000000000..4359f4387495 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Paragraph.java @@ -0,0 +1,1540 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Structural unit of text representing a number of words in certain order.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Paragraph} + */ +public final class Paragraph extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Paragraph) + ParagraphOrBuilder { +private static final long serialVersionUID = 0L; + // Use Paragraph.newBuilder() to construct. + private Paragraph(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Paragraph() { + words_ = java.util.Collections.emptyList(); + confidence_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Paragraph( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder subBuilder = null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = input.readMessage(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingBox_); + boundingBox_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + words_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + words_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Word.parser(), extensionRegistry)); + break; + } + case 37: { + + confidence_ = input.readFloat(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + words_ = java.util.Collections.unmodifiableList(words_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Paragraph_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Paragraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Paragraph.class, com.google.cloud.vision.v1p3beta1.Paragraph.Builder.class); + } + + private int bitField0_; + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_; + /** + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + /** + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + return getProperty(); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_; + /** + *
+   * The bounding box for the paragraph.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public boolean hasBoundingBox() { + return boundingBox_ != null; + } + /** + *
+   * The bounding box for the paragraph.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() { + return boundingBox_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } + /** + *
+   * The bounding box for the paragraph.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + return getBoundingBox(); + } + + public static final int WORDS_FIELD_NUMBER = 3; + private java.util.List words_; + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public java.util.List getWordsList() { + return words_; + } + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public java.util.List + getWordsOrBuilderList() { + return words_; + } + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public int getWordsCount() { + return words_.size(); + } + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p3beta1.Word getWords(int index) { + return words_.get(index); + } + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p3beta1.WordOrBuilder getWordsOrBuilder( + int index) { + return words_.get(index); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 4; + private float confidence_; + /** + *
+   * Confidence of the OCR results for the paragraph. Range [0, 1].
+   * 
+ * + * float confidence = 4; + */ + public float getConfidence() { + return confidence_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (property_ != null) { + output.writeMessage(1, getProperty()); + } + if (boundingBox_ != null) { + output.writeMessage(2, getBoundingBox()); + } + for (int i = 0; i < words_.size(); i++) { + output.writeMessage(3, words_.get(i)); + } + if (confidence_ != 0F) { + output.writeFloat(4, confidence_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (property_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProperty()); + } + if (boundingBox_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getBoundingBox()); + } + for (int i = 0; i < words_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, words_.get(i)); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, confidence_); + } + 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.vision.v1p3beta1.Paragraph)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Paragraph other = (com.google.cloud.vision.v1p3beta1.Paragraph) obj; + + boolean result = true; + result = result && (hasProperty() == other.hasProperty()); + if (hasProperty()) { + result = result && getProperty() + .equals(other.getProperty()); + } + result = result && (hasBoundingBox() == other.hasBoundingBox()); + if (hasBoundingBox()) { + result = result && getBoundingBox() + .equals(other.getBoundingBox()); + } + result = result && getWordsList() + .equals(other.getWordsList()); + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProperty()) { + hash = (37 * hash) + PROPERTY_FIELD_NUMBER; + hash = (53 * hash) + getProperty().hashCode(); + } + if (hasBoundingBox()) { + hash = (37 * hash) + BOUNDING_BOX_FIELD_NUMBER; + hash = (53 * hash) + getBoundingBox().hashCode(); + } + if (getWordsCount() > 0) { + hash = (37 * hash) + WORDS_FIELD_NUMBER; + hash = (53 * hash) + getWordsList().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Paragraph parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Paragraph 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.vision.v1p3beta1.Paragraph parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Paragraph 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.vision.v1p3beta1.Paragraph parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Paragraph parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Paragraph parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Paragraph 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.vision.v1p3beta1.Paragraph parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Paragraph 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.vision.v1p3beta1.Paragraph parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Paragraph parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Paragraph prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Structural unit of text representing a number of words in certain order.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Paragraph} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Paragraph) + com.google.cloud.vision.v1p3beta1.ParagraphOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Paragraph_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Paragraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Paragraph.class, com.google.cloud.vision.v1p3beta1.Paragraph.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Paragraph.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getWordsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (propertyBuilder_ == null) { + property_ = null; + } else { + property_ = null; + propertyBuilder_ = null; + } + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + if (wordsBuilder_ == null) { + words_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + wordsBuilder_.clear(); + } + confidence_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Paragraph_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Paragraph getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Paragraph.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Paragraph build() { + com.google.cloud.vision.v1p3beta1.Paragraph result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Paragraph buildPartial() { + com.google.cloud.vision.v1p3beta1.Paragraph result = new com.google.cloud.vision.v1p3beta1.Paragraph(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (propertyBuilder_ == null) { + result.property_ = property_; + } else { + result.property_ = propertyBuilder_.build(); + } + if (boundingBoxBuilder_ == null) { + result.boundingBox_ = boundingBox_; + } else { + result.boundingBox_ = boundingBoxBuilder_.build(); + } + if (wordsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + words_ = java.util.Collections.unmodifiableList(words_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.words_ = words_; + } else { + result.words_ = wordsBuilder_.build(); + } + result.confidence_ = confidence_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Paragraph) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Paragraph)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Paragraph other) { + if (other == com.google.cloud.vision.v1p3beta1.Paragraph.getDefaultInstance()) return this; + if (other.hasProperty()) { + mergeProperty(other.getProperty()); + } + if (other.hasBoundingBox()) { + mergeBoundingBox(other.getBoundingBox()); + } + if (wordsBuilder_ == null) { + if (!other.words_.isEmpty()) { + if (words_.isEmpty()) { + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWordsIsMutable(); + words_.addAll(other.words_); + } + onChanged(); + } + } else { + if (!other.words_.isEmpty()) { + if (wordsBuilder_.isEmpty()) { + wordsBuilder_.dispose(); + wordsBuilder_ = null; + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000004); + wordsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getWordsFieldBuilder() : null; + } else { + wordsBuilder_.addAllMessages(other.words_); + } + } + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Paragraph parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Paragraph) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> propertyBuilder_; + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + property_ = value; + onChanged(); + } else { + propertyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder builderForValue) { + if (propertyBuilder_ == null) { + property_ = builderForValue.build(); + onChanged(); + } else { + propertyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.newBuilder(property_).mergeFrom(value).buildPartial(); + } else { + property_ = value; + } + onChanged(); + } else { + propertyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder clearProperty() { + if (propertyBuilder_ == null) { + property_ = null; + onChanged(); + } else { + property_ = null; + propertyBuilder_ = null; + } + + return this; + } + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null ? + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + } + /** + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), + getParentForChildren(), + isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingBoxBuilder_; + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public boolean hasBoundingBox() { + return boundingBoxBuilder_ != null || boundingBox_ != null; + } + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } else { + return boundingBoxBuilder_.getMessage(); + } + } + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingBox_ = value; + onChanged(); + } else { + boundingBoxBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingBoxBuilder_ == null) { + boundingBox_ = builderForValue.build(); + onChanged(); + } else { + boundingBoxBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder mergeBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingBox_).mergeFrom(value).buildPartial(); + } else { + boundingBox_ = value; + } + onChanged(); + } else { + boundingBoxBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder clearBoundingBox() { + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + onChanged(); + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + + return this; + } + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingBoxBuilder() { + + onChanged(); + return getBoundingBoxFieldBuilder().getBuilder(); + } + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } + } + /** + *
+     * The bounding box for the paragraph.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingBox(), + getParentForChildren(), + isClean()); + boundingBox_ = null; + } + return boundingBoxBuilder_; + } + + private java.util.List words_ = + java.util.Collections.emptyList(); + private void ensureWordsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + words_ = new java.util.ArrayList(words_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Word, com.google.cloud.vision.v1p3beta1.Word.Builder, com.google.cloud.vision.v1p3beta1.WordOrBuilder> wordsBuilder_; + + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public java.util.List getWordsList() { + if (wordsBuilder_ == null) { + return java.util.Collections.unmodifiableList(words_); + } else { + return wordsBuilder_.getMessageList(); + } + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public int getWordsCount() { + if (wordsBuilder_ == null) { + return words_.size(); + } else { + return wordsBuilder_.getCount(); + } + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p3beta1.Word getWords(int index) { + if (wordsBuilder_ == null) { + return words_.get(index); + } else { + return wordsBuilder_.getMessage(index); + } + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder setWords( + int index, com.google.cloud.vision.v1p3beta1.Word value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.set(index, value); + onChanged(); + } else { + wordsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder setWords( + int index, com.google.cloud.vision.v1p3beta1.Word.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.set(index, builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder addWords(com.google.cloud.vision.v1p3beta1.Word value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(value); + onChanged(); + } else { + wordsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder addWords( + int index, com.google.cloud.vision.v1p3beta1.Word value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(index, value); + onChanged(); + } else { + wordsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder addWords( + com.google.cloud.vision.v1p3beta1.Word.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.add(builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder addWords( + int index, com.google.cloud.vision.v1p3beta1.Word.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.add(index, builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder addAllWords( + java.lang.Iterable values) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, words_); + onChanged(); + } else { + wordsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder clearWords() { + if (wordsBuilder_ == null) { + words_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + wordsBuilder_.clear(); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public Builder removeWords(int index) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.remove(index); + onChanged(); + } else { + wordsBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p3beta1.Word.Builder getWordsBuilder( + int index) { + return getWordsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p3beta1.WordOrBuilder getWordsOrBuilder( + int index) { + if (wordsBuilder_ == null) { + return words_.get(index); } else { + return wordsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public java.util.List + getWordsOrBuilderList() { + if (wordsBuilder_ != null) { + return wordsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(words_); + } + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p3beta1.Word.Builder addWordsBuilder() { + return getWordsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Word.getDefaultInstance()); + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p3beta1.Word.Builder addWordsBuilder( + int index) { + return getWordsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Word.getDefaultInstance()); + } + /** + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + public java.util.List + getWordsBuilderList() { + return getWordsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Word, com.google.cloud.vision.v1p3beta1.Word.Builder, com.google.cloud.vision.v1p3beta1.WordOrBuilder> + getWordsFieldBuilder() { + if (wordsBuilder_ == null) { + wordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Word, com.google.cloud.vision.v1p3beta1.Word.Builder, com.google.cloud.vision.v1p3beta1.WordOrBuilder>( + words_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + words_ = null; + } + return wordsBuilder_; + } + + private float confidence_ ; + /** + *
+     * Confidence of the OCR results for the paragraph. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence of the OCR results for the paragraph. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence of the OCR results for the paragraph. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Paragraph) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Paragraph) + private static final com.google.cloud.vision.v1p3beta1.Paragraph DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Paragraph(); + } + + public static com.google.cloud.vision.v1p3beta1.Paragraph getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Paragraph parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Paragraph(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Paragraph getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ParagraphOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ParagraphOrBuilder.java new file mode 100644 index 000000000000..e5d016c694f6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ParagraphOrBuilder.java @@ -0,0 +1,154 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ParagraphOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Paragraph) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty(); + /** + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder(); + + /** + *
+   * The bounding box for the paragraph.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + boolean hasBoundingBox(); + /** + *
+   * The bounding box for the paragraph.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox(); + /** + *
+   * The bounding box for the paragraph.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder(); + + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + java.util.List + getWordsList(); + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + com.google.cloud.vision.v1p3beta1.Word getWords(int index); + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + int getWordsCount(); + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + java.util.List + getWordsOrBuilderList(); + /** + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Word words = 3; + */ + com.google.cloud.vision.v1p3beta1.WordOrBuilder getWordsOrBuilder( + int index); + + /** + *
+   * Confidence of the OCR results for the paragraph. Range [0, 1].
+   * 
+ * + * float confidence = 4; + */ + float getConfidence(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Position.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Position.java new file mode 100644 index 000000000000..25123ebadf2e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Position.java @@ -0,0 +1,632 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A 3D position in the image, used primarily for Face detection landmarks.
+ * A valid Position must have both x and y coordinates.
+ * The position coordinates are in the same scale as the original image.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Position} + */ +public final class Position extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Position) + PositionOrBuilder { +private static final long serialVersionUID = 0L; + // Use Position.newBuilder() to construct. + private Position(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Position() { + x_ = 0F; + y_ = 0F; + z_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Position( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 13: { + + x_ = input.readFloat(); + break; + } + case 21: { + + y_ = input.readFloat(); + break; + } + case 29: { + + z_ = input.readFloat(); + 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.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Position_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Position_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Position.class, com.google.cloud.vision.v1p3beta1.Position.Builder.class); + } + + public static final int X_FIELD_NUMBER = 1; + private float x_; + /** + *
+   * X coordinate.
+   * 
+ * + * float x = 1; + */ + public float getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 2; + private float y_; + /** + *
+   * Y coordinate.
+   * 
+ * + * float y = 2; + */ + public float getY() { + return y_; + } + + public static final int Z_FIELD_NUMBER = 3; + private float z_; + /** + *
+   * Z coordinate (or depth).
+   * 
+ * + * float z = 3; + */ + public float getZ() { + return z_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (x_ != 0F) { + output.writeFloat(1, x_); + } + if (y_ != 0F) { + output.writeFloat(2, y_); + } + if (z_ != 0F) { + output.writeFloat(3, z_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (x_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, x_); + } + if (y_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, y_); + } + if (z_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, z_); + } + 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.vision.v1p3beta1.Position)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Position other = (com.google.cloud.vision.v1p3beta1.Position) obj; + + boolean result = true; + result = result && ( + java.lang.Float.floatToIntBits(getX()) + == java.lang.Float.floatToIntBits( + other.getX())); + result = result && ( + java.lang.Float.floatToIntBits(getY()) + == java.lang.Float.floatToIntBits( + other.getY())); + result = result && ( + java.lang.Float.floatToIntBits(getZ()) + == java.lang.Float.floatToIntBits( + other.getZ())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (37 * hash) + Z_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getZ()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Position parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Position 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.vision.v1p3beta1.Position parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Position 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.vision.v1p3beta1.Position parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Position parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Position parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Position 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.vision.v1p3beta1.Position parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Position 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.vision.v1p3beta1.Position parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Position parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Position prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 3D position in the image, used primarily for Face detection landmarks.
+   * A valid Position must have both x and y coordinates.
+   * The position coordinates are in the same scale as the original image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Position} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Position) + com.google.cloud.vision.v1p3beta1.PositionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Position_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Position_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Position.class, com.google.cloud.vision.v1p3beta1.Position.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Position.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + x_ = 0F; + + y_ = 0F; + + z_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Position_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Position getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Position.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Position build() { + com.google.cloud.vision.v1p3beta1.Position result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Position buildPartial() { + com.google.cloud.vision.v1p3beta1.Position result = new com.google.cloud.vision.v1p3beta1.Position(this); + result.x_ = x_; + result.y_ = y_; + result.z_ = z_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Position) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Position)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Position other) { + if (other == com.google.cloud.vision.v1p3beta1.Position.getDefaultInstance()) return this; + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + if (other.getZ() != 0F) { + setZ(other.getZ()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Position parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Position) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float x_ ; + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public float getX() { + return x_; + } + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public Builder setX(float value) { + + x_ = value; + onChanged(); + return this; + } + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public Builder clearX() { + + x_ = 0F; + onChanged(); + return this; + } + + private float y_ ; + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public float getY() { + return y_; + } + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public Builder setY(float value) { + + y_ = value; + onChanged(); + return this; + } + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public Builder clearY() { + + y_ = 0F; + onChanged(); + return this; + } + + private float z_ ; + /** + *
+     * Z coordinate (or depth).
+     * 
+ * + * float z = 3; + */ + public float getZ() { + return z_; + } + /** + *
+     * Z coordinate (or depth).
+     * 
+ * + * float z = 3; + */ + public Builder setZ(float value) { + + z_ = value; + onChanged(); + return this; + } + /** + *
+     * Z coordinate (or depth).
+     * 
+ * + * float z = 3; + */ + public Builder clearZ() { + + z_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Position) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Position) + private static final com.google.cloud.vision.v1p3beta1.Position DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Position(); + } + + public static com.google.cloud.vision.v1p3beta1.Position getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Position parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Position(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Position getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PositionOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PositionOrBuilder.java new file mode 100644 index 000000000000..43372b0b9978 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PositionOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface PositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Position) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * X coordinate.
+   * 
+ * + * float x = 1; + */ + float getX(); + + /** + *
+   * Y coordinate.
+   * 
+ * + * float y = 2; + */ + float getY(); + + /** + *
+   * Z coordinate (or depth).
+   * 
+ * + * float z = 3; + */ + float getZ(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Product.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Product.java new file mode 100644 index 000000000000..0f0c3acec010 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Product.java @@ -0,0 +1,2404 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A Product contains ReferenceImages.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Product} + */ +public final class Product extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Product) + ProductOrBuilder { +private static final long serialVersionUID = 0L; + // Use Product.newBuilder() to construct. + private Product(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Product() { + name_ = ""; + displayName_ = ""; + description_ = ""; + productCategory_ = ""; + productLabels_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Product( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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 34: { + java.lang.String s = input.readStringRequireUtf8(); + + productCategory_ = s; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + productLabels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + productLabels_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Product.KeyValue.parser(), extensionRegistry)); + 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_ & 0x00000010) == 0x00000010)) { + productLabels_ = java.util.Collections.unmodifiableList(productLabels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Product.class, com.google.cloud.vision.v1p3beta1.Product.Builder.class); + } + + public interface KeyValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Product.KeyValue) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The key of the label attached to the product. Cannot be empty and cannot
+     * exceed 128 bytes.
+     * 
+ * + * string key = 1; + */ + java.lang.String getKey(); + /** + *
+     * The key of the label attached to the product. Cannot be empty and cannot
+     * exceed 128 bytes.
+     * 
+ * + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + *
+     * The value of the label attached to the product. Cannot be empty and
+     * cannot exceed 128 bytes.
+     * 
+ * + * string value = 2; + */ + java.lang.String getValue(); + /** + *
+     * The value of the label attached to the product. Cannot be empty and
+     * cannot exceed 128 bytes.
+     * 
+ * + * string value = 2; + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + *
+   * A product label represented as a key-value pair.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Product.KeyValue} + */ + public static final class KeyValue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Product.KeyValue) + KeyValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use KeyValue.newBuilder() to construct. + private KeyValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KeyValue() { + key_ = ""; + value_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KeyValue( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Product.KeyValue.class, com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + *
+     * The key of the label attached to the product. Cannot be empty and cannot
+     * exceed 128 bytes.
+     * 
+ * + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + *
+     * The key of the label attached to the product. Cannot be empty and cannot
+     * exceed 128 bytes.
+     * 
+ * + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object value_; + /** + *
+     * The value of the label attached to the product. Cannot be empty and
+     * cannot exceed 128 bytes.
+     * 
+ * + * string value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + *
+     * The value of the label attached to the product. Cannot be empty and
+     * cannot exceed 128 bytes.
+     * 
+ * + * string value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!getValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + 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.vision.v1p3beta1.Product.KeyValue)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Product.KeyValue other = (com.google.cloud.vision.v1p3beta1.Product.KeyValue) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && getValue() + .equals(other.getValue()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue 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.vision.v1p3beta1.Product.KeyValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue 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.vision.v1p3beta1.Product.KeyValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue 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.vision.v1p3beta1.Product.KeyValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue 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.vision.v1p3beta1.Product.KeyValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Product.KeyValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 product label represented as a key-value pair.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Product.KeyValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Product.KeyValue) + com.google.cloud.vision.v1p3beta1.Product.KeyValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Product.KeyValue.class, com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Product.KeyValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + value_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Product.KeyValue getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Product.KeyValue.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Product.KeyValue build() { + com.google.cloud.vision.v1p3beta1.Product.KeyValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Product.KeyValue buildPartial() { + com.google.cloud.vision.v1p3beta1.Product.KeyValue result = new com.google.cloud.vision.v1p3beta1.Product.KeyValue(this); + result.key_ = key_; + result.value_ = value_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Product.KeyValue) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Product.KeyValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Product.KeyValue other) { + if (other == com.google.cloud.vision.v1p3beta1.Product.KeyValue.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Product.KeyValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Product.KeyValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + *
+       * The key of the label attached to the product. Cannot be empty and cannot
+       * exceed 128 bytes.
+       * 
+ * + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The key of the label attached to the product. Cannot be empty and cannot
+       * exceed 128 bytes.
+       * 
+ * + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The key of the label attached to the product. Cannot be empty and cannot
+       * exceed 128 bytes.
+       * 
+ * + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + *
+       * The key of the label attached to the product. Cannot be empty and cannot
+       * exceed 128 bytes.
+       * 
+ * + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + *
+       * The key of the label attached to the product. Cannot be empty and cannot
+       * exceed 128 bytes.
+       * 
+ * + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + *
+       * The value of the label attached to the product. Cannot be empty and
+       * cannot exceed 128 bytes.
+       * 
+ * + * string value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The value of the label attached to the product. Cannot be empty and
+       * cannot exceed 128 bytes.
+       * 
+ * + * string value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The value of the label attached to the product. Cannot be empty and
+       * cannot exceed 128 bytes.
+       * 
+ * + * string value = 2; + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+       * The value of the label attached to the product. Cannot be empty and
+       * cannot exceed 128 bytes.
+       * 
+ * + * string value = 2; + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + *
+       * The value of the label attached to the product. Cannot be empty and
+       * cannot exceed 128 bytes.
+       * 
+ * + * string value = 2; + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Product.KeyValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Product.KeyValue) + private static final com.google.cloud.vision.v1p3beta1.Product.KeyValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Product.KeyValue(); + } + + public static com.google.cloud.vision.v1p3beta1.Product.KeyValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public KeyValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KeyValue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Product.KeyValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the product.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * This field is ignored when creating a product.
+   * 
+ * + * 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 product.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * This field is ignored when creating a product.
+   * 
+ * + * 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_; + /** + *
+   * The user-provided name for this Product. Must not be empty. Must be at most
+   * 4096 characters long.
+   * 
+ * + * 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; + } + } + /** + *
+   * The user-provided name for this Product. Must not be empty. Must be at most
+   * 4096 characters long.
+   * 
+ * + * 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 metadata to be stored with this product. Must be at most 4096
+   * 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 metadata to be stored with this product. Must be at most 4096
+   * 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 PRODUCT_CATEGORY_FIELD_NUMBER = 4; + private volatile java.lang.Object productCategory_; + /** + *
+   * The category for the product identified by the reference image. This should
+   * be either "homegoods" or "apparel".
+   * This field is immutable.
+   * 
+ * + * string product_category = 4; + */ + public java.lang.String getProductCategory() { + java.lang.Object ref = productCategory_; + 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(); + productCategory_ = s; + return s; + } + } + /** + *
+   * The category for the product identified by the reference image. This should
+   * be either "homegoods" or "apparel".
+   * This field is immutable.
+   * 
+ * + * string product_category = 4; + */ + public com.google.protobuf.ByteString + getProductCategoryBytes() { + java.lang.Object ref = productCategory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_LABELS_FIELD_NUMBER = 5; + private java.util.List productLabels_; + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public java.util.List getProductLabelsList() { + return productLabels_; + } + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public java.util.List + getProductLabelsOrBuilderList() { + return productLabels_; + } + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public int getProductLabelsCount() { + return productLabels_.size(); + } + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p3beta1.Product.KeyValue getProductLabels(int index) { + return productLabels_.get(index); + } + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p3beta1.Product.KeyValueOrBuilder getProductLabelsOrBuilder( + int index) { + return productLabels_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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 (!getProductCategoryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, productCategory_); + } + for (int i = 0; i < productLabels_.size(); i++) { + output.writeMessage(5, productLabels_.get(i)); + } + unknownFields.writeTo(output); + } + + 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 (!getProductCategoryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, productCategory_); + } + for (int i = 0; i < productLabels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, productLabels_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.Product)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Product other = (com.google.cloud.vision.v1p3beta1.Product) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDisplayName() + .equals(other.getDisplayName()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && getProductCategory() + .equals(other.getProductCategory()); + result = result && getProductLabelsList() + .equals(other.getProductLabelsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + PRODUCT_CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getProductCategory().hashCode(); + if (getProductLabelsCount() > 0) { + hash = (37 * hash) + PRODUCT_LABELS_FIELD_NUMBER; + hash = (53 * hash) + getProductLabelsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Product parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Product 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.vision.v1p3beta1.Product parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Product 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.vision.v1p3beta1.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Product parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Product 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.vision.v1p3beta1.Product parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Product 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.vision.v1p3beta1.Product parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Product parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Product prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 Product contains ReferenceImages.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Product} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Product) + com.google.cloud.vision.v1p3beta1.ProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Product.class, com.google.cloud.vision.v1p3beta1.Product.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Product.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getProductLabelsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + description_ = ""; + + productCategory_ = ""; + + if (productLabelsBuilder_ == null) { + productLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + productLabelsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_Product_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Product getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Product build() { + com.google.cloud.vision.v1p3beta1.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Product buildPartial() { + com.google.cloud.vision.v1p3beta1.Product result = new com.google.cloud.vision.v1p3beta1.Product(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + result.productCategory_ = productCategory_; + if (productLabelsBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + productLabels_ = java.util.Collections.unmodifiableList(productLabels_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.productLabels_ = productLabels_; + } else { + result.productLabels_ = productLabelsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Product) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Product)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Product other) { + if (other == com.google.cloud.vision.v1p3beta1.Product.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.getProductCategory().isEmpty()) { + productCategory_ = other.productCategory_; + onChanged(); + } + if (productLabelsBuilder_ == null) { + if (!other.productLabels_.isEmpty()) { + if (productLabels_.isEmpty()) { + productLabels_ = other.productLabels_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureProductLabelsIsMutable(); + productLabels_.addAll(other.productLabels_); + } + onChanged(); + } + } else { + if (!other.productLabels_.isEmpty()) { + if (productLabelsBuilder_.isEmpty()) { + productLabelsBuilder_.dispose(); + productLabelsBuilder_ = null; + productLabels_ = other.productLabels_; + bitField0_ = (bitField0_ & ~0x00000010); + productLabelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getProductLabelsFieldBuilder() : null; + } else { + productLabelsBuilder_.addAllMessages(other.productLabels_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Product parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Product) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the product.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * This field is ignored when creating a product.
+     * 
+ * + * 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 product.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * This field is ignored when creating a product.
+     * 
+ * + * 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 product.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * This field is ignored when creating a product.
+     * 
+ * + * 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 product.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * This field is ignored when creating a product.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the product.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+     * This field is ignored when creating a product.
+     * 
+ * + * 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_ = ""; + /** + *
+     * The user-provided name for this Product. Must not be empty. Must be at most
+     * 4096 characters long.
+     * 
+ * + * 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; + } + } + /** + *
+     * The user-provided name for this Product. Must not be empty. Must be at most
+     * 4096 characters long.
+     * 
+ * + * 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; + } + } + /** + *
+     * The user-provided name for this Product. Must not be empty. Must be at most
+     * 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + *
+     * The user-provided name for this Product. Must not be empty. Must be at most
+     * 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + *
+     * The user-provided name for this Product. Must not be empty. Must be at most
+     * 4096 characters long.
+     * 
+ * + * 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 metadata to be stored with this product. Must be at most 4096
+     * 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 metadata to be stored with this product. Must be at most 4096
+     * 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 metadata to be stored with this product. Must be at most 4096
+     * 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 metadata to be stored with this product. Must be at most 4096
+     * characters long.
+     * 
+ * + * string description = 3; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * User-provided metadata to be stored with this product. Must be at most 4096
+     * 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 java.lang.Object productCategory_ = ""; + /** + *
+     * The category for the product identified by the reference image. This should
+     * be either "homegoods" or "apparel".
+     * This field is immutable.
+     * 
+ * + * string product_category = 4; + */ + public java.lang.String getProductCategory() { + java.lang.Object ref = productCategory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productCategory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The category for the product identified by the reference image. This should
+     * be either "homegoods" or "apparel".
+     * This field is immutable.
+     * 
+ * + * string product_category = 4; + */ + public com.google.protobuf.ByteString + getProductCategoryBytes() { + java.lang.Object ref = productCategory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The category for the product identified by the reference image. This should
+     * be either "homegoods" or "apparel".
+     * This field is immutable.
+     * 
+ * + * string product_category = 4; + */ + public Builder setProductCategory( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productCategory_ = value; + onChanged(); + return this; + } + /** + *
+     * The category for the product identified by the reference image. This should
+     * be either "homegoods" or "apparel".
+     * This field is immutable.
+     * 
+ * + * string product_category = 4; + */ + public Builder clearProductCategory() { + + productCategory_ = getDefaultInstance().getProductCategory(); + onChanged(); + return this; + } + /** + *
+     * The category for the product identified by the reference image. This should
+     * be either "homegoods" or "apparel".
+     * This field is immutable.
+     * 
+ * + * string product_category = 4; + */ + public Builder setProductCategoryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productCategory_ = value; + onChanged(); + return this; + } + + private java.util.List productLabels_ = + java.util.Collections.emptyList(); + private void ensureProductLabelsIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + productLabels_ = new java.util.ArrayList(productLabels_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product.KeyValue, com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder, com.google.cloud.vision.v1p3beta1.Product.KeyValueOrBuilder> productLabelsBuilder_; + + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public java.util.List getProductLabelsList() { + if (productLabelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(productLabels_); + } else { + return productLabelsBuilder_.getMessageList(); + } + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public int getProductLabelsCount() { + if (productLabelsBuilder_ == null) { + return productLabels_.size(); + } else { + return productLabelsBuilder_.getCount(); + } + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p3beta1.Product.KeyValue getProductLabels(int index) { + if (productLabelsBuilder_ == null) { + return productLabels_.get(index); + } else { + return productLabelsBuilder_.getMessage(index); + } + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder setProductLabels( + int index, com.google.cloud.vision.v1p3beta1.Product.KeyValue value) { + if (productLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductLabelsIsMutable(); + productLabels_.set(index, value); + onChanged(); + } else { + productLabelsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder setProductLabels( + int index, com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder builderForValue) { + if (productLabelsBuilder_ == null) { + ensureProductLabelsIsMutable(); + productLabels_.set(index, builderForValue.build()); + onChanged(); + } else { + productLabelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels(com.google.cloud.vision.v1p3beta1.Product.KeyValue value) { + if (productLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductLabelsIsMutable(); + productLabels_.add(value); + onChanged(); + } else { + productLabelsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + int index, com.google.cloud.vision.v1p3beta1.Product.KeyValue value) { + if (productLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductLabelsIsMutable(); + productLabels_.add(index, value); + onChanged(); + } else { + productLabelsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder builderForValue) { + if (productLabelsBuilder_ == null) { + ensureProductLabelsIsMutable(); + productLabels_.add(builderForValue.build()); + onChanged(); + } else { + productLabelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + int index, com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder builderForValue) { + if (productLabelsBuilder_ == null) { + ensureProductLabelsIsMutable(); + productLabels_.add(index, builderForValue.build()); + onChanged(); + } else { + productLabelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder addAllProductLabels( + java.lang.Iterable values) { + if (productLabelsBuilder_ == null) { + ensureProductLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, productLabels_); + onChanged(); + } else { + productLabelsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder clearProductLabels() { + if (productLabelsBuilder_ == null) { + productLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + productLabelsBuilder_.clear(); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public Builder removeProductLabels(int index) { + if (productLabelsBuilder_ == null) { + ensureProductLabelsIsMutable(); + productLabels_.remove(index); + onChanged(); + } else { + productLabelsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder getProductLabelsBuilder( + int index) { + return getProductLabelsFieldBuilder().getBuilder(index); + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p3beta1.Product.KeyValueOrBuilder getProductLabelsOrBuilder( + int index) { + if (productLabelsBuilder_ == null) { + return productLabels_.get(index); } else { + return productLabelsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public java.util.List + getProductLabelsOrBuilderList() { + if (productLabelsBuilder_ != null) { + return productLabelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(productLabels_); + } + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder addProductLabelsBuilder() { + return getProductLabelsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Product.KeyValue.getDefaultInstance()); + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder addProductLabelsBuilder( + int index) { + return getProductLabelsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Product.KeyValue.getDefaultInstance()); + } + /** + *
+     * Key-value pairs that can be attached to a product. At query time,
+     * constraints can be specified based on the product_labels.
+     * Note that integer values can be provided as strings, e.g. "1199". Only
+     * strings with integer values can match a range-based restriction which is
+     * to be supported soon.
+     * Multiple values can be assigned to the same key. One product may have up to
+     * 100 product_labels.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + public java.util.List + getProductLabelsBuilderList() { + return getProductLabelsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product.KeyValue, com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder, com.google.cloud.vision.v1p3beta1.Product.KeyValueOrBuilder> + getProductLabelsFieldBuilder() { + if (productLabelsBuilder_ == null) { + productLabelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product.KeyValue, com.google.cloud.vision.v1p3beta1.Product.KeyValue.Builder, com.google.cloud.vision.v1p3beta1.Product.KeyValueOrBuilder>( + productLabels_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + productLabels_ = null; + } + return productLabelsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Product) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Product) + private static final com.google.cloud.vision.v1p3beta1.Product DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Product(); + } + + public static com.google.cloud.vision.v1p3beta1.Product getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Product parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Product(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Product getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductName.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductName.java new file mode 100644 index 000000000000..0ec0fe97308b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductName.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.vision.v1p3beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProductName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/products/{product}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String product; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProduct() { + return product; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProductName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + product = Preconditions.checkNotNull(builder.getProduct()); + } + + public static ProductName of(String project, String location, String product) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProduct(product) + .build(); + } + + public static String format(String project, String location, String product) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProduct(product) + .build() + .toString(); + } + + public static ProductName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProductName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("product")); + } + + 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 (ProductName 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("product", product); + 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, "product", product); + } + + /** Builder for ProductName. */ + public static class Builder { + + private String project; + private String location; + private String product; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProduct() { + return product; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + private Builder() { + } + + private Builder(ProductName productName) { + project = productName.project; + location = productName.location; + product = productName.product; + } + + public ProductName build() { + return new ProductName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProductName) { + ProductName that = (ProductName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.product.equals(that.product)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= product.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductOrBuilder.java new file mode 100644 index 000000000000..03faf306c942 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductOrBuilder.java @@ -0,0 +1,169 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ProductOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Product) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the product.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * This field is ignored when creating a product.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The resource name of the product.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
+   * This field is ignored when creating a product.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The user-provided name for this Product. Must not be empty. Must be at most
+   * 4096 characters long.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + *
+   * The user-provided name for this Product. Must not be empty. Must be at most
+   * 4096 characters long.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
+   * User-provided metadata to be stored with this product. Must be at most 4096
+   * characters long.
+   * 
+ * + * string description = 3; + */ + java.lang.String getDescription(); + /** + *
+   * User-provided metadata to be stored with this product. Must be at most 4096
+   * characters long.
+   * 
+ * + * string description = 3; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * The category for the product identified by the reference image. This should
+   * be either "homegoods" or "apparel".
+   * This field is immutable.
+   * 
+ * + * string product_category = 4; + */ + java.lang.String getProductCategory(); + /** + *
+   * The category for the product identified by the reference image. This should
+   * be either "homegoods" or "apparel".
+   * This field is immutable.
+   * 
+ * + * string product_category = 4; + */ + com.google.protobuf.ByteString + getProductCategoryBytes(); + + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + java.util.List + getProductLabelsList(); + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + com.google.cloud.vision.v1p3beta1.Product.KeyValue getProductLabels(int index); + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + int getProductLabelsCount(); + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + java.util.List + getProductLabelsOrBuilderList(); + /** + *
+   * Key-value pairs that can be attached to a product. At query time,
+   * constraints can be specified based on the product_labels.
+   * Note that integer values can be provided as strings, e.g. "1199". Only
+   * strings with integer values can match a range-based restriction which is
+   * to be supported soon.
+   * Multiple values can be assigned to the same key. One product may have up to
+   * 100 product_labels.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5; + */ + com.google.cloud.vision.v1p3beta1.Product.KeyValueOrBuilder getProductLabelsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchCategory.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchCategory.java new file mode 100644 index 000000000000..fa25ebbf4d35 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchCategory.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Supported product search categories.
+ * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.ProductSearchCategory} + */ +public enum ProductSearchCategory + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Default value used when a category is not specified.
+   * 
+ * + * PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0; + */ + PRODUCT_SEARCH_CATEGORY_UNSPECIFIED(0), + /** + *
+   * Shoes category.
+   * 
+ * + * SHOES = 1; + */ + SHOES(1), + /** + *
+   * Bags category.
+   * 
+ * + * BAGS = 2; + */ + BAGS(2), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Default value used when a category is not specified.
+   * 
+ * + * PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0; + */ + public static final int PRODUCT_SEARCH_CATEGORY_UNSPECIFIED_VALUE = 0; + /** + *
+   * Shoes category.
+   * 
+ * + * SHOES = 1; + */ + public static final int SHOES_VALUE = 1; + /** + *
+   * Bags category.
+   * 
+ * + * BAGS = 2; + */ + public static final int BAGS_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 ProductSearchCategory valueOf(int value) { + return forNumber(value); + } + + public static ProductSearchCategory forNumber(int value) { + switch (value) { + case 0: return PRODUCT_SEARCH_CATEGORY_UNSPECIFIED; + case 1: return SHOES; + case 2: return BAGS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ProductSearchCategory> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ProductSearchCategory findValueByNumber(int number) { + return ProductSearchCategory.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.vision.v1p3beta1.ProductSearchProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ProductSearchCategory[] VALUES = values(); + + public static ProductSearchCategory 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 ProductSearchCategory(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.ProductSearchCategory) +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchParams.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchParams.java new file mode 100644 index 000000000000..9c74f9d24977 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchParams.java @@ -0,0 +1,2077 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Parameters for a product search request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSearchParams} + */ +public final class ProductSearchParams extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ProductSearchParams) + ProductSearchParamsOrBuilder { +private static final long serialVersionUID = 0L; + // Use ProductSearchParams.newBuilder() to construct. + private ProductSearchParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ProductSearchParams() { + catalogName_ = ""; + category_ = 0; + productCategory_ = ""; + view_ = 0; + productSet_ = ""; + productCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + filter_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProductSearchParams( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + catalogName_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + category_ = rawValue; + break; + } + case 26: { + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.Builder subBuilder = null; + if (normalizedBoundingPoly_ != null) { + subBuilder = normalizedBoundingPoly_.toBuilder(); + } + normalizedBoundingPoly_ = input.readMessage(com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(normalizedBoundingPoly_); + normalizedBoundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 32: { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + productCategory_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + productSet_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + productCategories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000080; + } + productCategories_.add(s); + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 74: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + 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_ & 0x00000080) == 0x00000080)) { + productCategories_ = productCategories_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSearchParams.class, com.google.cloud.vision.v1p3beta1.ProductSearchParams.Builder.class); + } + + private int bitField0_; + public static final int CATALOG_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object catalogName_; + /** + *
+   * The resource name of the catalog to search.
+   * Format is: `productSearch/catalogs/CATALOG_NAME`.
+   * 
+ * + * string catalog_name = 1; + */ + public java.lang.String getCatalogName() { + java.lang.Object ref = catalogName_; + 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(); + catalogName_ = s; + return s; + } + } + /** + *
+   * The resource name of the catalog to search.
+   * Format is: `productSearch/catalogs/CATALOG_NAME`.
+   * 
+ * + * string catalog_name = 1; + */ + public com.google.protobuf.ByteString + getCatalogNameBytes() { + java.lang.Object ref = catalogName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + catalogName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATEGORY_FIELD_NUMBER = 2; + private int category_; + /** + *
+   * The category to search in.
+   * Optional. It is inferred by the system if it is not specified.
+   * [Deprecated] Use `product_category`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + public int getCategoryValue() { + return category_; + } + /** + *
+   * The category to search in.
+   * Optional. It is inferred by the system if it is not specified.
+   * [Deprecated] Use `product_category`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchCategory getCategory() { + com.google.cloud.vision.v1p3beta1.ProductSearchCategory result = com.google.cloud.vision.v1p3beta1.ProductSearchCategory.valueOf(category_); + return result == null ? com.google.cloud.vision.v1p3beta1.ProductSearchCategory.UNRECOGNIZED : result; + } + + public static final int PRODUCT_CATEGORY_FIELD_NUMBER = 5; + private volatile java.lang.Object productCategory_; + /** + *
+   * The product category to search in.
+   * Optional. It is inferred by the system if it is not specified.
+   * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+   * `skirt`, `top`, `shorts`, and `pants`.
+   * 
+ * + * string product_category = 5; + */ + public java.lang.String getProductCategory() { + java.lang.Object ref = productCategory_; + 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(); + productCategory_ = s; + return s; + } + } + /** + *
+   * The product category to search in.
+   * Optional. It is inferred by the system if it is not specified.
+   * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+   * `skirt`, `top`, `shorts`, and `pants`.
+   * 
+ * + * string product_category = 5; + */ + public com.google.protobuf.ByteString + getProductCategoryBytes() { + java.lang.Object ref = productCategory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NORMALIZED_BOUNDING_POLY_FIELD_NUMBER = 3; + private com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalizedBoundingPoly_; + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * [Deprecated] Use `bounding_poly`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public boolean hasNormalizedBoundingPoly() { + return normalizedBoundingPoly_ != null; + } + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * [Deprecated] Use `bounding_poly`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly getNormalizedBoundingPoly() { + return normalizedBoundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.getDefaultInstance() : normalizedBoundingPoly_; + } + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * [Deprecated] Use `bounding_poly`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPolyOrBuilder getNormalizedBoundingPolyOrBuilder() { + return getNormalizedBoundingPoly(); + } + + public static final int BOUNDING_POLY_FIELD_NUMBER = 9; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_; + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + public static final int VIEW_FIELD_NUMBER = 4; + private int view_; + /** + *
+   * Specifies the verbosity of the  product search results.
+   * Optional. Defaults to `BASIC`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + public int getViewValue() { + return view_; + } + /** + *
+   * Specifies the verbosity of the  product search results.
+   * Optional. Defaults to `BASIC`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResultsView getView() { + com.google.cloud.vision.v1p3beta1.ProductSearchResultsView result = com.google.cloud.vision.v1p3beta1.ProductSearchResultsView.valueOf(view_); + return result == null ? com.google.cloud.vision.v1p3beta1.ProductSearchResultsView.UNRECOGNIZED : result; + } + + public static final int PRODUCT_SET_FIELD_NUMBER = 6; + private volatile java.lang.Object productSet_; + /** + *
+   * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * 
+ * + * string product_set = 6; + */ + public java.lang.String getProductSet() { + java.lang.Object ref = productSet_; + 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(); + productSet_ = s; + return s; + } + } + /** + *
+   * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * 
+ * + * string product_set = 6; + */ + public com.google.protobuf.ByteString + getProductSetBytes() { + java.lang.Object ref = productSet_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productSet_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_CATEGORIES_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList productCategories_; + /** + *
+   * The list of product categories to search in. Currently, we only consider
+   * the first category, and either "homegoods" or "apparel" should be
+   * specified.
+   * 
+ * + * repeated string product_categories = 7; + */ + public com.google.protobuf.ProtocolStringList + getProductCategoriesList() { + return productCategories_; + } + /** + *
+   * The list of product categories to search in. Currently, we only consider
+   * the first category, and either "homegoods" or "apparel" should be
+   * specified.
+   * 
+ * + * repeated string product_categories = 7; + */ + public int getProductCategoriesCount() { + return productCategories_.size(); + } + /** + *
+   * The list of product categories to search in. Currently, we only consider
+   * the first category, and either "homegoods" or "apparel" should be
+   * specified.
+   * 
+ * + * repeated string product_categories = 7; + */ + public java.lang.String getProductCategories(int index) { + return productCategories_.get(index); + } + /** + *
+   * The list of product categories to search in. Currently, we only consider
+   * the first category, and either "homegoods" or "apparel" should be
+   * specified.
+   * 
+ * + * repeated string product_categories = 7; + */ + public com.google.protobuf.ByteString + getProductCategoriesBytes(int index) { + return productCategories_.getByteString(index); + } + + public static final int FILTER_FIELD_NUMBER = 8; + private volatile java.lang.Object filter_; + /** + *
+   * The filtering expression. This can be used to restrict search results based
+   * on Product labels. We currently support an AND of OR of key-value
+   * expressions, where each expression within an OR must have the same key.
+   * For example, "(color = red OR color = blue) AND brand = Google" is
+   * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+   * 
+ * + * string filter = 8; + */ + 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; + } + } + /** + *
+   * The filtering expression. This can be used to restrict search results based
+   * on Product labels. We currently support an AND of OR of key-value
+   * expressions, where each expression within an OR must have the same key.
+   * For example, "(color = red OR color = blue) AND brand = Google" is
+   * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+   * 
+ * + * string filter = 8; + */ + 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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getCatalogNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalogName_); + } + if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory.PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, category_); + } + if (normalizedBoundingPoly_ != null) { + output.writeMessage(3, getNormalizedBoundingPoly()); + } + if (view_ != com.google.cloud.vision.v1p3beta1.ProductSearchResultsView.BASIC.getNumber()) { + output.writeEnum(4, view_); + } + if (!getProductCategoryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, productCategory_); + } + if (!getProductSetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, productSet_); + } + for (int i = 0; i < productCategories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, productCategories_.getRaw(i)); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, filter_); + } + if (boundingPoly_ != null) { + output.writeMessage(9, getBoundingPoly()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCatalogNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalogName_); + } + if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory.PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, category_); + } + if (normalizedBoundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getNormalizedBoundingPoly()); + } + if (view_ != com.google.cloud.vision.v1p3beta1.ProductSearchResultsView.BASIC.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, view_); + } + if (!getProductCategoryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, productCategory_); + } + if (!getProductSetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, productSet_); + } + { + int dataSize = 0; + for (int i = 0; i < productCategories_.size(); i++) { + dataSize += computeStringSizeNoTag(productCategories_.getRaw(i)); + } + size += dataSize; + size += 1 * getProductCategoriesList().size(); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, filter_); + } + if (boundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getBoundingPoly()); + } + 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.vision.v1p3beta1.ProductSearchParams)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ProductSearchParams other = (com.google.cloud.vision.v1p3beta1.ProductSearchParams) obj; + + boolean result = true; + result = result && getCatalogName() + .equals(other.getCatalogName()); + result = result && category_ == other.category_; + result = result && getProductCategory() + .equals(other.getProductCategory()); + result = result && (hasNormalizedBoundingPoly() == other.hasNormalizedBoundingPoly()); + if (hasNormalizedBoundingPoly()) { + result = result && getNormalizedBoundingPoly() + .equals(other.getNormalizedBoundingPoly()); + } + result = result && (hasBoundingPoly() == other.hasBoundingPoly()); + if (hasBoundingPoly()) { + result = result && getBoundingPoly() + .equals(other.getBoundingPoly()); + } + result = result && view_ == other.view_; + result = result && getProductSet() + .equals(other.getProductSet()); + result = result && getProductCategoriesList() + .equals(other.getProductCategoriesList()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATALOG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCatalogName().hashCode(); + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + category_; + hash = (37 * hash) + PRODUCT_CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getProductCategory().hashCode(); + if (hasNormalizedBoundingPoly()) { + hash = (37 * hash) + NORMALIZED_BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getNormalizedBoundingPoly().hashCode(); + } + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().hashCode(); + } + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (37 * hash) + PRODUCT_SET_FIELD_NUMBER; + hash = (53 * hash) + getProductSet().hashCode(); + if (getProductCategoriesCount() > 0) { + hash = (37 * hash) + PRODUCT_CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getProductCategoriesList().hashCode(); + } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams 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.vision.v1p3beta1.ProductSearchParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams 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.vision.v1p3beta1.ProductSearchParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams 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.vision.v1p3beta1.ProductSearchParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams 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.vision.v1p3beta1.ProductSearchParams parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ProductSearchParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Parameters for a product search request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSearchParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ProductSearchParams) + com.google.cloud.vision.v1p3beta1.ProductSearchParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSearchParams.class, com.google.cloud.vision.v1p3beta1.ProductSearchParams.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ProductSearchParams.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + catalogName_ = ""; + + category_ = 0; + + productCategory_ = ""; + + if (normalizedBoundingPolyBuilder_ == null) { + normalizedBoundingPoly_ = null; + } else { + normalizedBoundingPoly_ = null; + normalizedBoundingPolyBuilder_ = null; + } + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + view_ = 0; + + productSet_ = ""; + + productCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + filter_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchParams getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchParams.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchParams build() { + com.google.cloud.vision.v1p3beta1.ProductSearchParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchParams buildPartial() { + com.google.cloud.vision.v1p3beta1.ProductSearchParams result = new com.google.cloud.vision.v1p3beta1.ProductSearchParams(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.catalogName_ = catalogName_; + result.category_ = category_; + result.productCategory_ = productCategory_; + if (normalizedBoundingPolyBuilder_ == null) { + result.normalizedBoundingPoly_ = normalizedBoundingPoly_; + } else { + result.normalizedBoundingPoly_ = normalizedBoundingPolyBuilder_.build(); + } + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + result.view_ = view_; + result.productSet_ = productSet_; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + productCategories_ = productCategories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.productCategories_ = productCategories_; + result.filter_ = filter_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ProductSearchParams) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ProductSearchParams)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ProductSearchParams other) { + if (other == com.google.cloud.vision.v1p3beta1.ProductSearchParams.getDefaultInstance()) return this; + if (!other.getCatalogName().isEmpty()) { + catalogName_ = other.catalogName_; + onChanged(); + } + if (other.category_ != 0) { + setCategoryValue(other.getCategoryValue()); + } + if (!other.getProductCategory().isEmpty()) { + productCategory_ = other.productCategory_; + onChanged(); + } + if (other.hasNormalizedBoundingPoly()) { + mergeNormalizedBoundingPoly(other.getNormalizedBoundingPoly()); + } + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + if (!other.getProductSet().isEmpty()) { + productSet_ = other.productSet_; + onChanged(); + } + if (!other.productCategories_.isEmpty()) { + if (productCategories_.isEmpty()) { + productCategories_ = other.productCategories_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureProductCategoriesIsMutable(); + productCategories_.addAll(other.productCategories_); + } + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ProductSearchParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ProductSearchParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object catalogName_ = ""; + /** + *
+     * The resource name of the catalog to search.
+     * Format is: `productSearch/catalogs/CATALOG_NAME`.
+     * 
+ * + * string catalog_name = 1; + */ + public java.lang.String getCatalogName() { + java.lang.Object ref = catalogName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalogName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the catalog to search.
+     * Format is: `productSearch/catalogs/CATALOG_NAME`.
+     * 
+ * + * string catalog_name = 1; + */ + public com.google.protobuf.ByteString + getCatalogNameBytes() { + java.lang.Object ref = catalogName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + catalogName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the catalog to search.
+     * Format is: `productSearch/catalogs/CATALOG_NAME`.
+     * 
+ * + * string catalog_name = 1; + */ + public Builder setCatalogName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalogName_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the catalog to search.
+     * Format is: `productSearch/catalogs/CATALOG_NAME`.
+     * 
+ * + * string catalog_name = 1; + */ + public Builder clearCatalogName() { + + catalogName_ = getDefaultInstance().getCatalogName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the catalog to search.
+     * Format is: `productSearch/catalogs/CATALOG_NAME`.
+     * 
+ * + * string catalog_name = 1; + */ + public Builder setCatalogNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalogName_ = value; + onChanged(); + return this; + } + + private int category_ = 0; + /** + *
+     * The category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + public int getCategoryValue() { + return category_; + } + /** + *
+     * The category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + public Builder setCategoryValue(int value) { + category_ = value; + onChanged(); + return this; + } + /** + *
+     * The category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchCategory getCategory() { + com.google.cloud.vision.v1p3beta1.ProductSearchCategory result = com.google.cloud.vision.v1p3beta1.ProductSearchCategory.valueOf(category_); + return result == null ? com.google.cloud.vision.v1p3beta1.ProductSearchCategory.UNRECOGNIZED : result; + } + /** + *
+     * The category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + public Builder setCategory(com.google.cloud.vision.v1p3beta1.ProductSearchCategory value) { + if (value == null) { + throw new NullPointerException(); + } + + category_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + public Builder clearCategory() { + + category_ = 0; + onChanged(); + return this; + } + + private java.lang.Object productCategory_ = ""; + /** + *
+     * The product category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+     * `skirt`, `top`, `shorts`, and `pants`.
+     * 
+ * + * string product_category = 5; + */ + public java.lang.String getProductCategory() { + java.lang.Object ref = productCategory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productCategory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The product category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+     * `skirt`, `top`, `shorts`, and `pants`.
+     * 
+ * + * string product_category = 5; + */ + public com.google.protobuf.ByteString + getProductCategoryBytes() { + java.lang.Object ref = productCategory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The product category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+     * `skirt`, `top`, `shorts`, and `pants`.
+     * 
+ * + * string product_category = 5; + */ + public Builder setProductCategory( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productCategory_ = value; + onChanged(); + return this; + } + /** + *
+     * The product category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+     * `skirt`, `top`, `shorts`, and `pants`.
+     * 
+ * + * string product_category = 5; + */ + public Builder clearProductCategory() { + + productCategory_ = getDefaultInstance().getProductCategory(); + onChanged(); + return this; + } + /** + *
+     * The product category to search in.
+     * Optional. It is inferred by the system if it is not specified.
+     * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+     * `skirt`, `top`, `shorts`, and `pants`.
+     * 
+ * + * string product_category = 5; + */ + public Builder setProductCategoryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productCategory_ = value; + onChanged(); + return this; + } + + private com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalizedBoundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly, com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.NormalizedBoundingPolyOrBuilder> normalizedBoundingPolyBuilder_; + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public boolean hasNormalizedBoundingPoly() { + return normalizedBoundingPolyBuilder_ != null || normalizedBoundingPoly_ != null; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly getNormalizedBoundingPoly() { + if (normalizedBoundingPolyBuilder_ == null) { + return normalizedBoundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.getDefaultInstance() : normalizedBoundingPoly_; + } else { + return normalizedBoundingPolyBuilder_.getMessage(); + } + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public Builder setNormalizedBoundingPoly(com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly value) { + if (normalizedBoundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + normalizedBoundingPoly_ = value; + onChanged(); + } else { + normalizedBoundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public Builder setNormalizedBoundingPoly( + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.Builder builderForValue) { + if (normalizedBoundingPolyBuilder_ == null) { + normalizedBoundingPoly_ = builderForValue.build(); + onChanged(); + } else { + normalizedBoundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public Builder mergeNormalizedBoundingPoly(com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly value) { + if (normalizedBoundingPolyBuilder_ == null) { + if (normalizedBoundingPoly_ != null) { + normalizedBoundingPoly_ = + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.newBuilder(normalizedBoundingPoly_).mergeFrom(value).buildPartial(); + } else { + normalizedBoundingPoly_ = value; + } + onChanged(); + } else { + normalizedBoundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public Builder clearNormalizedBoundingPoly() { + if (normalizedBoundingPolyBuilder_ == null) { + normalizedBoundingPoly_ = null; + onChanged(); + } else { + normalizedBoundingPoly_ = null; + normalizedBoundingPolyBuilder_ = null; + } + + return this; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.Builder getNormalizedBoundingPolyBuilder() { + + onChanged(); + return getNormalizedBoundingPolyFieldBuilder().getBuilder(); + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + public com.google.cloud.vision.v1p3beta1.NormalizedBoundingPolyOrBuilder getNormalizedBoundingPolyOrBuilder() { + if (normalizedBoundingPolyBuilder_ != null) { + return normalizedBoundingPolyBuilder_.getMessageOrBuilder(); + } else { + return normalizedBoundingPoly_ == null ? + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.getDefaultInstance() : normalizedBoundingPoly_; + } + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * [Deprecated] Use `bounding_poly`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly, com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.NormalizedBoundingPolyOrBuilder> + getNormalizedBoundingPolyFieldBuilder() { + if (normalizedBoundingPolyBuilder_ == null) { + normalizedBoundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly, com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.NormalizedBoundingPolyOrBuilder>( + getNormalizedBoundingPoly(), + getParentForChildren(), + isClean()); + normalizedBoundingPoly_ = null; + } + return normalizedBoundingPolyBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingPolyBuilder_; + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public boolean hasBoundingPoly() { + return boundingPolyBuilder_ != null || boundingPoly_ != null; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingPoly_ = value; + onChanged(); + } else { + boundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = builderForValue.build(); + onChanged(); + } else { + boundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingPoly_).mergeFrom(value).buildPartial(); + } else { + boundingPoly_ = value; + } + onChanged(); + } else { + boundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public Builder clearBoundingPoly() { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + onChanged(); + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + + return this; + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + } + /** + *
+     * The bounding polygon around the area of interest in the image.
+     * Optional. If it is not specified, system discretion will be applied.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), + getParentForChildren(), + isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private int view_ = 0; + /** + *
+     * Specifies the verbosity of the  product search results.
+     * Optional. Defaults to `BASIC`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + public int getViewValue() { + return view_; + } + /** + *
+     * Specifies the verbosity of the  product search results.
+     * Optional. Defaults to `BASIC`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + public Builder setViewValue(int value) { + view_ = value; + onChanged(); + return this; + } + /** + *
+     * Specifies the verbosity of the  product search results.
+     * Optional. Defaults to `BASIC`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResultsView getView() { + com.google.cloud.vision.v1p3beta1.ProductSearchResultsView result = com.google.cloud.vision.v1p3beta1.ProductSearchResultsView.valueOf(view_); + return result == null ? com.google.cloud.vision.v1p3beta1.ProductSearchResultsView.UNRECOGNIZED : result; + } + /** + *
+     * Specifies the verbosity of the  product search results.
+     * Optional. Defaults to `BASIC`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + public Builder setView(com.google.cloud.vision.v1p3beta1.ProductSearchResultsView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Specifies the verbosity of the  product search results.
+     * Optional. Defaults to `BASIC`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + private java.lang.Object productSet_ = ""; + /** + *
+     * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * 
+ * + * string product_set = 6; + */ + public java.lang.String getProductSet() { + java.lang.Object ref = productSet_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productSet_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * 
+ * + * string product_set = 6; + */ + public com.google.protobuf.ByteString + getProductSetBytes() { + java.lang.Object ref = productSet_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productSet_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * 
+ * + * string product_set = 6; + */ + public Builder setProductSet( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productSet_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * 
+ * + * string product_set = 6; + */ + public Builder clearProductSet() { + + productSet_ = getDefaultInstance().getProductSet(); + onChanged(); + return this; + } + /** + *
+     * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * 
+ * + * string product_set = 6; + */ + public Builder setProductSetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productSet_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList productCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureProductCategoriesIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + productCategories_ = new com.google.protobuf.LazyStringArrayList(productCategories_); + bitField0_ |= 0x00000080; + } + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public com.google.protobuf.ProtocolStringList + getProductCategoriesList() { + return productCategories_.getUnmodifiableView(); + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public int getProductCategoriesCount() { + return productCategories_.size(); + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public java.lang.String getProductCategories(int index) { + return productCategories_.get(index); + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public com.google.protobuf.ByteString + getProductCategoriesBytes(int index) { + return productCategories_.getByteString(index); + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public Builder setProductCategories( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductCategoriesIsMutable(); + productCategories_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public Builder addProductCategories( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductCategoriesIsMutable(); + productCategories_.add(value); + onChanged(); + return this; + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public Builder addAllProductCategories( + java.lang.Iterable values) { + ensureProductCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, productCategories_); + onChanged(); + return this; + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public Builder clearProductCategories() { + productCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods" or "apparel" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public Builder addProductCategoriesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureProductCategoriesIsMutable(); + productCategories_.add(value); + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * The filtering expression. This can be used to restrict search results based
+     * on Product labels. We currently support an AND of OR of key-value
+     * expressions, where each expression within an OR must have the same key.
+     * For example, "(color = red OR color = blue) AND brand = Google" is
+     * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+     * 
+ * + * string filter = 8; + */ + 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; + } + } + /** + *
+     * The filtering expression. This can be used to restrict search results based
+     * on Product labels. We currently support an AND of OR of key-value
+     * expressions, where each expression within an OR must have the same key.
+     * For example, "(color = red OR color = blue) AND brand = Google" is
+     * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+     * 
+ * + * string filter = 8; + */ + 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; + } + } + /** + *
+     * The filtering expression. This can be used to restrict search results based
+     * on Product labels. We currently support an AND of OR of key-value
+     * expressions, where each expression within an OR must have the same key.
+     * For example, "(color = red OR color = blue) AND brand = Google" is
+     * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+     * 
+ * + * string filter = 8; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * The filtering expression. This can be used to restrict search results based
+     * on Product labels. We currently support an AND of OR of key-value
+     * expressions, where each expression within an OR must have the same key.
+     * For example, "(color = red OR color = blue) AND brand = Google" is
+     * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+     * 
+ * + * string filter = 8; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * The filtering expression. This can be used to restrict search results based
+     * on Product labels. We currently support an AND of OR of key-value
+     * expressions, where each expression within an OR must have the same key.
+     * For example, "(color = red OR color = blue) AND brand = Google" is
+     * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+     * 
+ * + * string filter = 8; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ProductSearchParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSearchParams) + private static final com.google.cloud.vision.v1p3beta1.ProductSearchParams DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ProductSearchParams(); + } + + public static com.google.cloud.vision.v1p3beta1.ProductSearchParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ProductSearchParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductSearchParams(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchParamsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchParamsOrBuilder.java new file mode 100644 index 000000000000..0e3f64f588e1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchParamsOrBuilder.java @@ -0,0 +1,243 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ProductSearchParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ProductSearchParams) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the catalog to search.
+   * Format is: `productSearch/catalogs/CATALOG_NAME`.
+   * 
+ * + * string catalog_name = 1; + */ + java.lang.String getCatalogName(); + /** + *
+   * The resource name of the catalog to search.
+   * Format is: `productSearch/catalogs/CATALOG_NAME`.
+   * 
+ * + * string catalog_name = 1; + */ + com.google.protobuf.ByteString + getCatalogNameBytes(); + + /** + *
+   * The category to search in.
+   * Optional. It is inferred by the system if it is not specified.
+   * [Deprecated] Use `product_category`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + int getCategoryValue(); + /** + *
+   * The category to search in.
+   * Optional. It is inferred by the system if it is not specified.
+   * [Deprecated] Use `product_category`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 2; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchCategory getCategory(); + + /** + *
+   * The product category to search in.
+   * Optional. It is inferred by the system if it is not specified.
+   * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+   * `skirt`, `top`, `shorts`, and `pants`.
+   * 
+ * + * string product_category = 5; + */ + java.lang.String getProductCategory(); + /** + *
+   * The product category to search in.
+   * Optional. It is inferred by the system if it is not specified.
+   * Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
+   * `skirt`, `top`, `shorts`, and `pants`.
+   * 
+ * + * string product_category = 5; + */ + com.google.protobuf.ByteString + getProductCategoryBytes(); + + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * [Deprecated] Use `bounding_poly`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + boolean hasNormalizedBoundingPoly(); + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * [Deprecated] Use `bounding_poly`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly getNormalizedBoundingPoly(); + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * [Deprecated] Use `bounding_poly`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.NormalizedBoundingPoly normalized_bounding_poly = 3; + */ + com.google.cloud.vision.v1p3beta1.NormalizedBoundingPolyOrBuilder getNormalizedBoundingPolyOrBuilder(); + + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + boolean hasBoundingPoly(); + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPoly(); + /** + *
+   * The bounding polygon around the area of interest in the image.
+   * Optional. If it is not specified, system discretion will be applied.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_poly = 9; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + *
+   * Specifies the verbosity of the  product search results.
+   * Optional. Defaults to `BASIC`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + int getViewValue(); + /** + *
+   * Specifies the verbosity of the  product search results.
+   * Optional. Defaults to `BASIC`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchResultsView view = 4; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchResultsView getView(); + + /** + *
+   * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * 
+ * + * string product_set = 6; + */ + java.lang.String getProductSet(); + /** + *
+   * The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * 
+ * + * string product_set = 6; + */ + com.google.protobuf.ByteString + getProductSetBytes(); + + /** + *
+   * The list of product categories to search in. Currently, we only consider
+   * the first category, and either "homegoods" or "apparel" should be
+   * specified.
+   * 
+ * + * repeated string product_categories = 7; + */ + java.util.List + getProductCategoriesList(); + /** + *
+   * The list of product categories to search in. Currently, we only consider
+   * the first category, and either "homegoods" or "apparel" should be
+   * specified.
+   * 
+ * + * repeated string product_categories = 7; + */ + int getProductCategoriesCount(); + /** + *
+   * The list of product categories to search in. Currently, we only consider
+   * the first category, and either "homegoods" or "apparel" should be
+   * specified.
+   * 
+ * + * repeated string product_categories = 7; + */ + java.lang.String getProductCategories(int index); + /** + *
+   * The list of product categories to search in. Currently, we only consider
+   * the first category, and either "homegoods" or "apparel" should be
+   * specified.
+   * 
+ * + * repeated string product_categories = 7; + */ + com.google.protobuf.ByteString + getProductCategoriesBytes(int index); + + /** + *
+   * The filtering expression. This can be used to restrict search results based
+   * on Product labels. We currently support an AND of OR of key-value
+   * expressions, where each expression within an OR must have the same key.
+   * For example, "(color = red OR color = blue) AND brand = Google" is
+   * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+   * 
+ * + * string filter = 8; + */ + java.lang.String getFilter(); + /** + *
+   * The filtering expression. This can be used to restrict search results based
+   * on Product labels. We currently support an AND of OR of key-value
+   * expressions, where each expression within an OR must have the same key.
+   * For example, "(color = red OR color = blue) AND brand = Google" is
+   * acceptable, but not "(color = red OR brand = Google)" or "color: red".
+   * 
+ * + * string filter = 8; + */ + com.google.protobuf.ByteString + getFilterBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchProto.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchProto.java new file mode 100644 index 000000000000..70816d8e1de6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchProto.java @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search.proto + +package com.google.cloud.vision.v1p3beta1; + +public final class ProductSearchProto { + private ProductSearchProto() {} + 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_vision_v1p3beta1_ProductSearchParams_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/vision/v1p3beta1/product_" + + "search.proto\022\035google.cloud.vision.v1p3be" + + "ta1\032\034google/api/annotations.proto\032,googl" + + "e/cloud/vision/v1p3beta1/geometry.proto\032" + + ":google/cloud/vision/v1p3beta1/product_s" + + "earch_service.proto\032\037google/protobuf/tim" + + "estamp.proto\"\262\003\n\023ProductSearchParams\022\024\n\014" + + "catalog_name\030\001 \001(\t\022F\n\010category\030\002 \001(\01624.g" + + "oogle.cloud.vision.v1p3beta1.ProductSear" + + "chCategory\022\030\n\020product_category\030\005 \001(\t\022W\n\030" + + "normalized_bounding_poly\030\003 \001(\01325.google." + + "cloud.vision.v1p3beta1.NormalizedBoundin" + + "gPoly\022B\n\rbounding_poly\030\t \001(\0132+.google.cl" + + "oud.vision.v1p3beta1.BoundingPoly\022E\n\004vie" + + "w\030\004 \001(\01627.google.cloud.vision.v1p3beta1." + + "ProductSearchResultsView\022\023\n\013product_set\030" + + "\006 \001(\t\022\032\n\022product_categories\030\007 \003(\t\022\016\n\006fil" + + "ter\030\010 \001(\t\"\356\003\n\024ProductSearchResults\022F\n\010ca" + + "tegory\030\001 \001(\01624.google.cloud.vision.v1p3b" + + "eta1.ProductSearchCategory\022\030\n\020product_ca" + + "tegory\030\004 \001(\t\022.\n\nindex_time\030\002 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022Q\n\010products\030\003 \003(\0132?" + + ".google.cloud.vision.v1p3beta1.ProductSe" + + "archResults.ProductInfo\022K\n\007results\030\005 \003(\013" + + "2:.google.cloud.vision.v1p3beta1.Product" + + "SearchResults.Result\032C\n\013ProductInfo\022\022\n\np" + + "roduct_id\030\001 \001(\t\022\021\n\timage_uri\030\002 \001(\t\022\r\n\005sc" + + "ore\030\003 \001(\002\032_\n\006Result\0227\n\007product\030\001 \001(\0132&.g" + + "oogle.cloud.vision.v1p3beta1.Product\022\r\n\005" + + "score\030\002 \001(\002\022\r\n\005image\030\003 \001(\t*U\n\025ProductSea" + + "rchCategory\022\'\n#PRODUCT_SEARCH_CATEGORY_U" + + "NSPECIFIED\020\000\022\t\n\005SHOES\020\001\022\010\n\004BAGS\020\002*/\n\030Pro" + + "ductSearchResultsView\022\t\n\005BASIC\020\000\022\010\n\004FULL" + + "\020\001B\201\001\n!com.google.cloud.vision.v1p3beta1" + + "B\022ProductSearchProtoP\001ZCgoogle.golang.or" + + "g/genproto/googleapis/cloud/vision/v1p3b" + + "eta1;vision\370\001\001b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.vision.v1p3beta1.GeometryProto.getDescriptor(), + com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ProductSearchParams_descriptor, + new java.lang.String[] { "CatalogName", "Category", "ProductCategory", "NormalizedBoundingPoly", "BoundingPoly", "View", "ProductSet", "ProductCategories", "Filter", }); + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_descriptor, + new java.lang.String[] { "Category", "ProductCategory", "IndexTime", "Products", "Results", }); + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_descriptor = + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_descriptor, + new java.lang.String[] { "ProductId", "ImageUri", "Score", }); + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_descriptor = + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_descriptor, + new java.lang.String[] { "Product", "Score", "Image", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.vision.v1p3beta1.GeometryProto.getDescriptor(); + com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResults.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResults.java new file mode 100644 index 000000000000..37a094b5cdcc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResults.java @@ -0,0 +1,3594 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Results for a product search request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSearchResults} + */ +public final class ProductSearchResults extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ProductSearchResults) + ProductSearchResultsOrBuilder { +private static final long serialVersionUID = 0L; + // Use ProductSearchResults.newBuilder() to construct. + private ProductSearchResults(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ProductSearchResults() { + category_ = 0; + productCategory_ = ""; + products_ = java.util.Collections.emptyList(); + results_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProductSearchResults( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + category_ = rawValue; + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (indexTime_ != null) { + subBuilder = indexTime_.toBuilder(); + } + indexTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(indexTime_); + indexTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + products_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.parser(), extensionRegistry)); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + productCategory_ = s; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + results_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + results_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.parser(), extensionRegistry)); + 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) == 0x00000008)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.class, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Builder.class); + } + + public interface ProductInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Product ID.
+     * 
+ * + * string product_id = 1; + */ + java.lang.String getProductId(); + /** + *
+     * Product ID.
+     * 
+ * + * string product_id = 1; + */ + com.google.protobuf.ByteString + getProductIdBytes(); + + /** + *
+     * The URI of the image which matched the query image.
+     * This field is returned only if `view` is set to `FULL` in
+     * the request.
+     * 
+ * + * string image_uri = 2; + */ + java.lang.String getImageUri(); + /** + *
+     * The URI of the image which matched the query image.
+     * This field is returned only if `view` is set to `FULL` in
+     * the request.
+     * 
+ * + * string image_uri = 2; + */ + com.google.protobuf.ByteString + getImageUriBytes(); + + /** + *
+     * A confidence level on the match, ranging from 0 (no confidence) to
+     * 1 (full confidence).
+     * This field is returned only if `view` is set to `FULL` in
+     * the request.
+     * 
+ * + * float score = 3; + */ + float getScore(); + } + /** + *
+   * Information about a product.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo} + */ + public static final class ProductInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) + ProductInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductInfo.newBuilder() to construct. + private ProductInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ProductInfo() { + productId_ = ""; + imageUri_ = ""; + score_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProductInfo( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + productId_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + imageUri_ = s; + break; + } + case 29: { + + score_ = input.readFloat(); + 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.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.class, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder.class); + } + + public static final int PRODUCT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object productId_; + /** + *
+     * Product ID.
+     * 
+ * + * string product_id = 1; + */ + public java.lang.String getProductId() { + java.lang.Object ref = productId_; + 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(); + productId_ = s; + return s; + } + } + /** + *
+     * Product ID.
+     * 
+ * + * string product_id = 1; + */ + public com.google.protobuf.ByteString + getProductIdBytes() { + java.lang.Object ref = productId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGE_URI_FIELD_NUMBER = 2; + private volatile java.lang.Object imageUri_; + /** + *
+     * The URI of the image which matched the query image.
+     * This field is returned only if `view` is set to `FULL` in
+     * the request.
+     * 
+ * + * string image_uri = 2; + */ + public java.lang.String getImageUri() { + java.lang.Object ref = imageUri_; + 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(); + imageUri_ = s; + return s; + } + } + /** + *
+     * The URI of the image which matched the query image.
+     * This field is returned only if `view` is set to `FULL` in
+     * the request.
+     * 
+ * + * string image_uri = 2; + */ + public com.google.protobuf.ByteString + getImageUriBytes() { + java.lang.Object ref = imageUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + imageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCORE_FIELD_NUMBER = 3; + private float score_; + /** + *
+     * A confidence level on the match, ranging from 0 (no confidence) to
+     * 1 (full confidence).
+     * This field is returned only if `view` is set to `FULL` in
+     * the request.
+     * 
+ * + * float score = 3; + */ + public float getScore() { + return score_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getProductIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, productId_); + } + if (!getImageUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, imageUri_); + } + if (score_ != 0F) { + output.writeFloat(3, score_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getProductIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, productId_); + } + if (!getImageUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, imageUri_); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, score_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo other = (com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) obj; + + boolean result = true; + result = result && getProductId() + .equals(other.getProductId()); + result = result && getImageUri() + .equals(other.getImageUri()); + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PRODUCT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProductId().hashCode(); + hash = (37 * hash) + IMAGE_URI_FIELD_NUMBER; + hash = (53 * hash) + getImageUri().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo 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.vision.v1p3beta1.ProductSearchResults.ProductInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo 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.vision.v1p3beta1.ProductSearchResults.ProductInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo 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.vision.v1p3beta1.ProductSearchResults.ProductInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo 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.vision.v1p3beta1.ProductSearchResults.ProductInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+     * Information about a product.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.class, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + productId_ = ""; + + imageUri_ = ""; + + score_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_ProductInfo_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo build() { + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo buildPartial() { + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo result = new com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo(this); + result.productId_ = productId_; + result.imageUri_ = imageUri_; + result.score_ = score_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo other) { + if (other == com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.getDefaultInstance()) return this; + if (!other.getProductId().isEmpty()) { + productId_ = other.productId_; + onChanged(); + } + if (!other.getImageUri().isEmpty()) { + imageUri_ = other.imageUri_; + onChanged(); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object productId_ = ""; + /** + *
+       * Product ID.
+       * 
+ * + * string product_id = 1; + */ + public java.lang.String getProductId() { + java.lang.Object ref = productId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Product ID.
+       * 
+ * + * string product_id = 1; + */ + public com.google.protobuf.ByteString + getProductIdBytes() { + java.lang.Object ref = productId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Product ID.
+       * 
+ * + * string product_id = 1; + */ + public Builder setProductId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productId_ = value; + onChanged(); + return this; + } + /** + *
+       * Product ID.
+       * 
+ * + * string product_id = 1; + */ + public Builder clearProductId() { + + productId_ = getDefaultInstance().getProductId(); + onChanged(); + return this; + } + /** + *
+       * Product ID.
+       * 
+ * + * string product_id = 1; + */ + public Builder setProductIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productId_ = value; + onChanged(); + return this; + } + + private java.lang.Object imageUri_ = ""; + /** + *
+       * The URI of the image which matched the query image.
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * string image_uri = 2; + */ + public java.lang.String getImageUri() { + java.lang.Object ref = imageUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + imageUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The URI of the image which matched the query image.
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * string image_uri = 2; + */ + public com.google.protobuf.ByteString + getImageUriBytes() { + java.lang.Object ref = imageUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + imageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The URI of the image which matched the query image.
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * string image_uri = 2; + */ + public Builder setImageUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + imageUri_ = value; + onChanged(); + return this; + } + /** + *
+       * The URI of the image which matched the query image.
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * string image_uri = 2; + */ + public Builder clearImageUri() { + + imageUri_ = getDefaultInstance().getImageUri(); + onChanged(); + return this; + } + /** + *
+       * The URI of the image which matched the query image.
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * string image_uri = 2; + */ + public Builder setImageUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + imageUri_ = value; + onChanged(); + return this; + } + + private float score_ ; + /** + *
+       * A confidence level on the match, ranging from 0 (no confidence) to
+       * 1 (full confidence).
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * float score = 3; + */ + public float getScore() { + return score_; + } + /** + *
+       * A confidence level on the match, ranging from 0 (no confidence) to
+       * 1 (full confidence).
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * float score = 3; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+       * A confidence level on the match, ranging from 0 (no confidence) to
+       * 1 (full confidence).
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * float score = 3; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) + private static final com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo(); + } + + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ProductInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ProductSearchResults.Result) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + boolean hasProduct(); + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + com.google.cloud.vision.v1p3beta1.Product getProduct(); + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder(); + + /** + *
+     * A confidence level on the match, ranging from 0 (no confidence) to
+     * 1 (full confidence).
+     * This field is returned only if `view` is set to `FULL` in
+     * the request.
+     * 
+ * + * float score = 2; + */ + float getScore(); + + /** + *
+     * The resource name of the image from the product that is the closest match
+     * to the query.
+     * 
+ * + * string image = 3; + */ + java.lang.String getImage(); + /** + *
+     * The resource name of the image from the product that is the closest match
+     * to the query.
+     * 
+ * + * string image = 3; + */ + com.google.protobuf.ByteString + getImageBytes(); + } + /** + *
+   * Information about a product.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSearchResults.Result} + */ + public static final class Result extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ProductSearchResults.Result) + ResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use Result.newBuilder() to construct. + private Result(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Result() { + score_ = 0F; + image_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Result( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = input.readMessage(com.google.cloud.vision.v1p3beta1.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + score_ = input.readFloat(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + image_ = s; + 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.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.class, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.Product product_; + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public boolean hasProduct() { + return product_ != null; + } + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product getProduct() { + return product_ == null ? com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int SCORE_FIELD_NUMBER = 2; + private float score_; + /** + *
+     * A confidence level on the match, ranging from 0 (no confidence) to
+     * 1 (full confidence).
+     * This field is returned only if `view` is set to `FULL` in
+     * the request.
+     * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + + public static final int IMAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object image_; + /** + *
+     * The resource name of the image from the product that is the closest match
+     * to the query.
+     * 
+ * + * string image = 3; + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + 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(); + image_ = s; + return s; + } + } + /** + *
+     * The resource name of the image from the product that is the closest match
+     * to the query.
+     * 
+ * + * string image = 3; + */ + public com.google.protobuf.ByteString + getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (product_ != null) { + output.writeMessage(1, getProduct()); + } + if (score_ != 0F) { + output.writeFloat(2, score_); + } + if (!getImageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, image_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProduct()); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, score_); + } + if (!getImageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, image_); + } + 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.vision.v1p3beta1.ProductSearchResults.Result)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result other = (com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result) obj; + + boolean result = true; + result = result && (hasProduct() == other.hasProduct()); + if (hasProduct()) { + result = result && getProduct() + .equals(other.getProduct()); + } + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && getImage() + .equals(other.getImage()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result 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.vision.v1p3beta1.ProductSearchResults.Result parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result 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.vision.v1p3beta1.ProductSearchResults.Result parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result 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.vision.v1p3beta1.ProductSearchResults.Result parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result 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.vision.v1p3beta1.ProductSearchResults.Result parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+     * Information about a product.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSearchResults.Result} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ProductSearchResults.Result) + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.class, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + score_ = 0F; + + image_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_Result_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result build() { + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result buildPartial() { + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result result = new com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result(this); + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.score_ = score_; + result.image_ = image_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result other) { + if (other == com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.getDefaultInstance()) return this; + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + if (!other.getImage().isEmpty()) { + image_ = other.image_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> productBuilder_; + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null ? com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.vision.v1p3beta1.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public Builder setProduct( + com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public Builder mergeProduct(com.google.cloud.vision.v1p3beta1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1p3beta1.Product.newBuilder(product_).mergeFrom(value).buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null ? + com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder>( + getProduct(), + getParentForChildren(), + isClean()); + product_ = null; + } + return productBuilder_; + } + + private float score_ ; + /** + *
+       * A confidence level on the match, ranging from 0 (no confidence) to
+       * 1 (full confidence).
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + /** + *
+       * A confidence level on the match, ranging from 0 (no confidence) to
+       * 1 (full confidence).
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * float score = 2; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+       * A confidence level on the match, ranging from 0 (no confidence) to
+       * 1 (full confidence).
+       * This field is returned only if `view` is set to `FULL` in
+       * the request.
+       * 
+ * + * float score = 2; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object image_ = ""; + /** + *
+       * The resource name of the image from the product that is the closest match
+       * to the query.
+       * 
+ * + * string image = 3; + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The resource name of the image from the product that is the closest match
+       * to the query.
+       * 
+ * + * string image = 3; + */ + public com.google.protobuf.ByteString + getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The resource name of the image from the product that is the closest match
+       * to the query.
+       * 
+ * + * string image = 3; + */ + public Builder setImage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + image_ = value; + onChanged(); + return this; + } + /** + *
+       * The resource name of the image from the product that is the closest match
+       * to the query.
+       * 
+ * + * string image = 3; + */ + public Builder clearImage() { + + image_ = getDefaultInstance().getImage(); + onChanged(); + return this; + } + /** + *
+       * The resource name of the image from the product that is the closest match
+       * to the query.
+       * 
+ * + * string image = 3; + */ + public Builder setImageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + image_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ProductSearchResults.Result) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSearchResults.Result) + private static final com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result(); + } + + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Result parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Result(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int CATEGORY_FIELD_NUMBER = 1; + private int category_; + /** + *
+   * Product category.
+   * [Deprecated] Use `product_category`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + public int getCategoryValue() { + return category_; + } + /** + *
+   * Product category.
+   * [Deprecated] Use `product_category`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchCategory getCategory() { + com.google.cloud.vision.v1p3beta1.ProductSearchCategory result = com.google.cloud.vision.v1p3beta1.ProductSearchCategory.valueOf(category_); + return result == null ? com.google.cloud.vision.v1p3beta1.ProductSearchCategory.UNRECOGNIZED : result; + } + + public static final int PRODUCT_CATEGORY_FIELD_NUMBER = 4; + private volatile java.lang.Object productCategory_; + /** + *
+   * Product category.
+   * Supported values are `bag` and `shoe`.
+   * [Deprecated] `product_category` is provided in each Product.
+   * 
+ * + * string product_category = 4; + */ + public java.lang.String getProductCategory() { + java.lang.Object ref = productCategory_; + 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(); + productCategory_ = s; + return s; + } + } + /** + *
+   * Product category.
+   * Supported values are `bag` and `shoe`.
+   * [Deprecated] `product_category` is provided in each Product.
+   * 
+ * + * string product_category = 4; + */ + public com.google.protobuf.ByteString + getProductCategoryBytes() { + java.lang.Object ref = productCategory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp indexTime_; + /** + *
+   * Timestamp of the index which provided these results. Changes made after
+   * this time are not reflected in the current results.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public boolean hasIndexTime() { + return indexTime_ != null; + } + /** + *
+   * Timestamp of the index which provided these results. Changes made after
+   * this time are not reflected in the current results.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public com.google.protobuf.Timestamp getIndexTime() { + return indexTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } + /** + *
+   * Timestamp of the index which provided these results. Changes made after
+   * this time are not reflected in the current results.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder() { + return getIndexTime(); + } + + public static final int PRODUCTS_FIELD_NUMBER = 3; + private java.util.List products_; + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public java.util.List getProductsList() { + return products_; + } + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public int getProductsCount() { + return products_.size(); + } + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo getProducts(int index) { + return products_.get(index); + } + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfoOrBuilder getProductsOrBuilder( + int index) { + return products_.get(index); + } + + public static final int RESULTS_FIELD_NUMBER = 5; + private java.util.List results_; + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List getResultsList() { + return results_; + } + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public int getResultsCount() { + return results_.size(); + } + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result getResults(int index) { + return results_.get(index); + } + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory.PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { + output.writeEnum(1, category_); + } + if (indexTime_ != null) { + output.writeMessage(2, getIndexTime()); + } + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(3, products_.get(i)); + } + if (!getProductCategoryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, productCategory_); + } + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(5, results_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory.PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, category_); + } + if (indexTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getIndexTime()); + } + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, products_.get(i)); + } + if (!getProductCategoryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, productCategory_); + } + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, results_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ProductSearchResults)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ProductSearchResults other = (com.google.cloud.vision.v1p3beta1.ProductSearchResults) obj; + + boolean result = true; + result = result && category_ == other.category_; + result = result && getProductCategory() + .equals(other.getProductCategory()); + result = result && (hasIndexTime() == other.hasIndexTime()); + if (hasIndexTime()) { + result = result && getIndexTime() + .equals(other.getIndexTime()); + } + result = result && getProductsList() + .equals(other.getProductsList()); + result = result && getResultsList() + .equals(other.getResultsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + category_; + hash = (37 * hash) + PRODUCT_CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getProductCategory().hashCode(); + if (hasIndexTime()) { + hash = (37 * hash) + INDEX_TIME_FIELD_NUMBER; + hash = (53 * hash) + getIndexTime().hashCode(); + } + if (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().hashCode(); + } + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults 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.vision.v1p3beta1.ProductSearchResults parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults 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.vision.v1p3beta1.ProductSearchResults parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults 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.vision.v1p3beta1.ProductSearchResults parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults 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.vision.v1p3beta1.ProductSearchResults parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ProductSearchResults prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Results for a product search request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSearchResults} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ProductSearchResults) + com.google.cloud.vision.v1p3beta1.ProductSearchResultsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.class, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ProductSearchResults.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + getResultsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + category_ = 0; + + productCategory_ = ""; + + if (indexTimeBuilder_ == null) { + indexTime_ = null; + } else { + indexTime_ = null; + indexTimeBuilder_ = null; + } + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + productsBuilder_.clear(); + } + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + resultsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchProto.internal_static_google_cloud_vision_v1p3beta1_ProductSearchResults_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchResults.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults build() { + com.google.cloud.vision.v1p3beta1.ProductSearchResults result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults buildPartial() { + com.google.cloud.vision.v1p3beta1.ProductSearchResults result = new com.google.cloud.vision.v1p3beta1.ProductSearchResults(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.category_ = category_; + result.productCategory_ = productCategory_; + if (indexTimeBuilder_ == null) { + result.indexTime_ = indexTime_; + } else { + result.indexTime_ = indexTimeBuilder_.build(); + } + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.build(); + } + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ProductSearchResults) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ProductSearchResults)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ProductSearchResults other) { + if (other == com.google.cloud.vision.v1p3beta1.ProductSearchResults.getDefaultInstance()) return this; + if (other.category_ != 0) { + setCategoryValue(other.getCategoryValue()); + } + if (!other.getProductCategory().isEmpty()) { + productCategory_ = other.productCategory_; + onChanged(); + } + if (other.hasIndexTime()) { + mergeIndexTime(other.getIndexTime()); + } + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000008); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getProductsFieldBuilder() : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000010); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResultsFieldBuilder() : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ProductSearchResults parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ProductSearchResults) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int category_ = 0; + /** + *
+     * Product category.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + public int getCategoryValue() { + return category_; + } + /** + *
+     * Product category.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + public Builder setCategoryValue(int value) { + category_ = value; + onChanged(); + return this; + } + /** + *
+     * Product category.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchCategory getCategory() { + com.google.cloud.vision.v1p3beta1.ProductSearchCategory result = com.google.cloud.vision.v1p3beta1.ProductSearchCategory.valueOf(category_); + return result == null ? com.google.cloud.vision.v1p3beta1.ProductSearchCategory.UNRECOGNIZED : result; + } + /** + *
+     * Product category.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + public Builder setCategory(com.google.cloud.vision.v1p3beta1.ProductSearchCategory value) { + if (value == null) { + throw new NullPointerException(); + } + + category_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Product category.
+     * [Deprecated] Use `product_category`.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + public Builder clearCategory() { + + category_ = 0; + onChanged(); + return this; + } + + private java.lang.Object productCategory_ = ""; + /** + *
+     * Product category.
+     * Supported values are `bag` and `shoe`.
+     * [Deprecated] `product_category` is provided in each Product.
+     * 
+ * + * string product_category = 4; + */ + public java.lang.String getProductCategory() { + java.lang.Object ref = productCategory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productCategory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Product category.
+     * Supported values are `bag` and `shoe`.
+     * [Deprecated] `product_category` is provided in each Product.
+     * 
+ * + * string product_category = 4; + */ + public com.google.protobuf.ByteString + getProductCategoryBytes() { + java.lang.Object ref = productCategory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + productCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Product category.
+     * Supported values are `bag` and `shoe`.
+     * [Deprecated] `product_category` is provided in each Product.
+     * 
+ * + * string product_category = 4; + */ + public Builder setProductCategory( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productCategory_ = value; + onChanged(); + return this; + } + /** + *
+     * Product category.
+     * Supported values are `bag` and `shoe`.
+     * [Deprecated] `product_category` is provided in each Product.
+     * 
+ * + * string product_category = 4; + */ + public Builder clearProductCategory() { + + productCategory_ = getDefaultInstance().getProductCategory(); + onChanged(); + return this; + } + /** + *
+     * Product category.
+     * Supported values are `bag` and `shoe`.
+     * [Deprecated] `product_category` is provided in each Product.
+     * 
+ * + * string product_category = 4; + */ + public Builder setProductCategoryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productCategory_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp indexTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> indexTimeBuilder_; + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public boolean hasIndexTime() { + return indexTimeBuilder_ != null || indexTime_ != null; + } + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public com.google.protobuf.Timestamp getIndexTime() { + if (indexTimeBuilder_ == null) { + return indexTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } else { + return indexTimeBuilder_.getMessage(); + } + } + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public Builder setIndexTime(com.google.protobuf.Timestamp value) { + if (indexTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + indexTime_ = value; + onChanged(); + } else { + indexTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public Builder setIndexTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (indexTimeBuilder_ == null) { + indexTime_ = builderForValue.build(); + onChanged(); + } else { + indexTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public Builder mergeIndexTime(com.google.protobuf.Timestamp value) { + if (indexTimeBuilder_ == null) { + if (indexTime_ != null) { + indexTime_ = + com.google.protobuf.Timestamp.newBuilder(indexTime_).mergeFrom(value).buildPartial(); + } else { + indexTime_ = value; + } + onChanged(); + } else { + indexTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public Builder clearIndexTime() { + if (indexTimeBuilder_ == null) { + indexTime_ = null; + onChanged(); + } else { + indexTime_ = null; + indexTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getIndexTimeBuilder() { + + onChanged(); + return getIndexTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder() { + if (indexTimeBuilder_ != null) { + return indexTimeBuilder_.getMessageOrBuilder(); + } else { + return indexTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } + } + /** + *
+     * Timestamp of the index which provided these results. Changes made after
+     * this time are not reflected in the current results.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getIndexTimeFieldBuilder() { + if (indexTimeBuilder_ == null) { + indexTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getIndexTime(), + getParentForChildren(), + isClean()); + indexTime_ = null; + } + return indexTimeBuilder_; + } + + private java.util.List products_ = + java.util.Collections.emptyList(); + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + products_ = new java.util.ArrayList(products_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfoOrBuilder> productsBuilder_; + + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder addProducts(com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder addProducts( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder getProductsBuilder( + int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfoOrBuilder getProductsOrBuilder( + int index) { + if (productsBuilder_ == null) { + return products_.get(index); } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder addProductsBuilder() { + return getProductsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.getDefaultInstance()); + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder addProductsBuilder( + int index) { + return getProductsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.getDefaultInstance()); + } + /** + *
+     * List of detected products.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfoOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfoOrBuilder>( + products_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + products_ = null; + } + return productsBuilder_; + } + + private java.util.List results_ = + java.util.Collections.emptyList(); + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ResultOrBuilder> resultsBuilder_; + + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder setResults( + int index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder setResults( + int index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder addResults(com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + int index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + int index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.ResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result, com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1p3beta1.ProductSearchResults.ResultOrBuilder>( + results_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ProductSearchResults) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSearchResults) + private static final com.google.cloud.vision.v1p3beta1.ProductSearchResults DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ProductSearchResults(); + } + + public static com.google.cloud.vision.v1p3beta1.ProductSearchResults getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ProductSearchResults parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductSearchResults(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ProductSearchResults getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResultsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResultsOrBuilder.java new file mode 100644 index 000000000000..05c04fc3b78a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResultsOrBuilder.java @@ -0,0 +1,166 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ProductSearchResultsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ProductSearchResults) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Product category.
+   * [Deprecated] Use `product_category`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + int getCategoryValue(); + /** + *
+   * Product category.
+   * [Deprecated] Use `product_category`.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSearchCategory category = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchCategory getCategory(); + + /** + *
+   * Product category.
+   * Supported values are `bag` and `shoe`.
+   * [Deprecated] `product_category` is provided in each Product.
+   * 
+ * + * string product_category = 4; + */ + java.lang.String getProductCategory(); + /** + *
+   * Product category.
+   * Supported values are `bag` and `shoe`.
+   * [Deprecated] `product_category` is provided in each Product.
+   * 
+ * + * string product_category = 4; + */ + com.google.protobuf.ByteString + getProductCategoryBytes(); + + /** + *
+   * Timestamp of the index which provided these results. Changes made after
+   * this time are not reflected in the current results.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + boolean hasIndexTime(); + /** + *
+   * Timestamp of the index which provided these results. Changes made after
+   * this time are not reflected in the current results.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + com.google.protobuf.Timestamp getIndexTime(); + /** + *
+   * Timestamp of the index which provided these results. Changes made after
+   * this time are not reflected in the current results.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder(); + + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + java.util.List + getProductsList(); + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo getProducts(int index); + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + int getProductsCount(); + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + java.util.List + getProductsOrBuilderList(); + /** + *
+   * List of detected products.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo products = 3; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfoOrBuilder getProductsOrBuilder( + int index); + + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + java.util.List + getResultsList(); + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchResults.Result getResults(int index); + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + int getResultsCount(); + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.ProductSearchResults.Result results = 5; + */ + com.google.cloud.vision.v1p3beta1.ProductSearchResults.ResultOrBuilder getResultsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResultsView.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResultsView.java new file mode 100644 index 000000000000..276245b5a6b0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchResultsView.java @@ -0,0 +1,127 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Specifies the fields to include in product search results.
+ * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.ProductSearchResultsView} + */ +public enum ProductSearchResultsView + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Product search results contain only `product_category` and `product_id`.
+   * Default value.
+   * 
+ * + * BASIC = 0; + */ + BASIC(0), + /** + *
+   * Product search results contain `product_category`, `product_id`,
+   * `image_uri`, and `score`.
+   * 
+ * + * FULL = 1; + */ + FULL(1), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Product search results contain only `product_category` and `product_id`.
+   * Default value.
+   * 
+ * + * BASIC = 0; + */ + public static final int BASIC_VALUE = 0; + /** + *
+   * Product search results contain `product_category`, `product_id`,
+   * `image_uri`, and `score`.
+   * 
+ * + * FULL = 1; + */ + public static final int FULL_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProductSearchResultsView valueOf(int value) { + return forNumber(value); + } + + public static ProductSearchResultsView forNumber(int value) { + switch (value) { + case 0: return BASIC; + case 1: return FULL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ProductSearchResultsView> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ProductSearchResultsView findValueByNumber(int number) { + return ProductSearchResultsView.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.vision.v1p3beta1.ProductSearchProto.getDescriptor().getEnumTypes().get(1); + } + + private static final ProductSearchResultsView[] VALUES = values(); + + public static ProductSearchResultsView 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 ProductSearchResultsView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.ProductSearchResultsView) +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchServiceProto.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchServiceProto.java new file mode 100644 index 000000000000..02dd3e82fea8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchServiceProto.java @@ -0,0 +1,567 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public final class ProductSearchServiceProto { + private ProductSearchServiceProto() {} + 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_vision_v1p3beta1_Product_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Product_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ProductSet_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ProductSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_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/vision/v1p3beta1/product_" + + "search_service.proto\022\035google.cloud.visio" + + "n.v1p3beta1\032\034google/api/annotations.prot" + + "o\032,google/cloud/vision/v1p3beta1/geometr" + + "y.proto\032#google/longrunning/operations.p" + + "roto\032\033google/protobuf/empty.proto\032 googl" + + "e/protobuf/field_mask.proto\032\037google/prot" + + "obuf/timestamp.proto\032\027google/rpc/status." + + "proto\"\315\001\n\007Product\022\014\n\004name\030\001 \001(\t\022\024\n\014displ" + + "ay_name\030\002 \001(\t\022\023\n\013description\030\003 \001(\t\022\030\n\020pr" + + "oduct_category\030\004 \001(\t\022G\n\016product_labels\030\005" + + " \003(\0132/.google.cloud.vision.v1p3beta1.Pro" + + "duct.KeyValue\032&\n\010KeyValue\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t\"\211\001\n\nProductSet\022\014\n\004name\030\001 \001" + + "(\t\022\024\n\014display_name\030\002 \001(\t\022.\n\nindex_time\030\003" + + " \001(\0132\032.google.protobuf.Timestamp\022\'\n\013inde" + + "x_error\030\004 \001(\0132\022.google.rpc.Status\"p\n\016Ref" + + "erenceImage\022\014\n\004name\030\001 \001(\t\022\013\n\003uri\030\002 \001(\t\022C" + + "\n\016bounding_polys\030\003 \003(\0132+.google.cloud.vi" + + "sion.v1p3beta1.BoundingPoly\"s\n\024CreatePro" + + "ductRequest\022\016\n\006parent\030\001 \001(\t\0227\n\007product\030\002" + + " \001(\0132&.google.cloud.vision.v1p3beta1.Pro" + + "duct\022\022\n\nproduct_id\030\003 \001(\t\"L\n\023ListProducts" + + "Request\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001" + + "(\005\022\022\n\npage_token\030\003 \001(\t\"i\n\024ListProductsRe" + + "sponse\0228\n\010products\030\001 \003(\0132&.google.cloud." + + "vision.v1p3beta1.Product\022\027\n\017next_page_to" + + "ken\030\002 \001(\t\"!\n\021GetProductRequest\022\014\n\004name\030\001" + + " \001(\t\"\200\001\n\024UpdateProductRequest\0227\n\007product" + + "\030\001 \001(\0132&.google.cloud.vision.v1p3beta1.P" + + "roduct\022/\n\013update_mask\030\002 \001(\0132\032.google.pro" + + "tobuf.FieldMask\"$\n\024DeleteProductRequest\022" + + "\014\n\004name\030\001 \001(\t\"\201\001\n\027CreateProductSetReques" + + "t\022\016\n\006parent\030\001 \001(\t\022>\n\013product_set\030\002 \001(\0132)" + + ".google.cloud.vision.v1p3beta1.ProductSe" + + "t\022\026\n\016product_set_id\030\003 \001(\t\"O\n\026ListProduct" + + "SetsRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size" + + "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"s\n\027ListProduc" + + "tSetsResponse\022?\n\014product_sets\030\001 \003(\0132).go" + + "ogle.cloud.vision.v1p3beta1.ProductSet\022\027" + + "\n\017next_page_token\030\002 \001(\t\"$\n\024GetProductSet" + + "Request\022\014\n\004name\030\001 \001(\t\"\212\001\n\027UpdateProductS" + + "etRequest\022>\n\013product_set\030\001 \001(\0132).google." + + "cloud.vision.v1p3beta1.ProductSet\022/\n\013upd" + + "ate_mask\030\002 \001(\0132\032.google.protobuf.FieldMa" + + "sk\"\'\n\027DeleteProductSetRequest\022\014\n\004name\030\001 " + + "\001(\t\"\221\001\n\033CreateReferenceImageRequest\022\016\n\006p" + + "arent\030\001 \001(\t\022F\n\017reference_image\030\002 \001(\0132-.g" + + "oogle.cloud.vision.v1p3beta1.ReferenceIm" + + "age\022\032\n\022reference_image_id\030\003 \001(\t\"S\n\032ListR" + + "eferenceImagesRequest\022\016\n\006parent\030\001 \001(\t\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\222\001\n" + + "\033ListReferenceImagesResponse\022G\n\020referenc" + + "e_images\030\001 \003(\0132-.google.cloud.vision.v1p" + + "3beta1.ReferenceImage\022\021\n\tpage_size\030\002 \001(\005" + + "\022\027\n\017next_page_token\030\003 \001(\t\"(\n\030GetReferenc" + + "eImageRequest\022\014\n\004name\030\001 \001(\t\"+\n\033DeleteRef" + + "erenceImageRequest\022\014\n\004name\030\001 \001(\t\">\n\035AddP" + + "roductToProductSetRequest\022\014\n\004name\030\001 \001(\t\022" + + "\017\n\007product\030\002 \001(\t\"C\n\"RemoveProductFromPro" + + "ductSetRequest\022\014\n\004name\030\001 \001(\t\022\017\n\007product\030" + + "\002 \001(\t\"V\n\037ListProductsInProductSetRequest" + + "\022\014\n\004name\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npag" + + "e_token\030\003 \001(\t\"u\n ListProductsInProductSe" + + "tResponse\0228\n\010products\030\001 \003(\0132&.google.clo" + + "ud.vision.v1p3beta1.Product\022\027\n\017next_page" + + "_token\030\002 \001(\t\"2\n\032ImportProductSetsGcsSour" + + "ce\022\024\n\014csv_file_uri\030\001 \001(\t\"y\n\034ImportProduc" + + "tSetsInputConfig\022O\n\ngcs_source\030\001 \001(\01329.g" + + "oogle.cloud.vision.v1p3beta1.ImportProdu" + + "ctSetsGcsSourceH\000B\010\n\006source\"}\n\030ImportPro" + + "ductSetsRequest\022\016\n\006parent\030\001 \001(\t\022Q\n\014input" + + "_config\030\002 \001(\0132;.google.cloud.vision.v1p3" + + "beta1.ImportProductSetsInputConfig\"\212\001\n\031I" + + "mportProductSetsResponse\022G\n\020reference_im" + + "ages\030\001 \003(\0132-.google.cloud.vision.v1p3bet" + + "a1.ReferenceImage\022$\n\010statuses\030\002 \003(\0132\022.go" + + "ogle.rpc.Status\"\236\002\n\026BatchOperationMetada" + + "ta\022J\n\005state\030\001 \001(\0162;.google.cloud.vision." + + "v1p3beta1.BatchOperationMetadata.State\022/" + + "\n\013submit_time\030\002 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022,\n\010end_time\030\003 \001(\0132\032.google.proto" + + "buf.Timestamp\"Y\n\005State\022\025\n\021STATE_UNSPECIF" + + "IED\020\000\022\016\n\nPROCESSING\020\001\022\016\n\nSUCCESSFUL\020\002\022\n\n" + + "\006FAILED\020\003\022\r\n\tCANCELLED\020\0042\237\033\n\rProductSear" + + "ch\022\302\001\n\020CreateProductSet\0226.google.cloud.v" + + "ision.v1p3beta1.CreateProductSetRequest\032" + + ").google.cloud.vision.v1p3beta1.ProductS" + + "et\"K\202\323\344\223\002E\"6/v1p3beta1/{parent=projects/" + + "*/locations/*}/productSets:\013product_set\022" + + "\300\001\n\017ListProductSets\0225.google.cloud.visio" + + "n.v1p3beta1.ListProductSetsRequest\0326.goo" + + "gle.cloud.vision.v1p3beta1.ListProductSe" + + "tsResponse\">\202\323\344\223\0028\0226/v1p3beta1/{parent=p" + + "rojects/*/locations/*}/productSets\022\257\001\n\rG" + + "etProductSet\0223.google.cloud.vision.v1p3b" + + "eta1.GetProductSetRequest\032).google.cloud" + + ".vision.v1p3beta1.ProductSet\">\202\323\344\223\0028\0226/v" + + "1p3beta1/{name=projects/*/locations/*/pr" + + "oductSets/*}\022\316\001\n\020UpdateProductSet\0226.goog" + + "le.cloud.vision.v1p3beta1.UpdateProductS" + + "etRequest\032).google.cloud.vision.v1p3beta" + + "1.ProductSet\"W\202\323\344\223\002Q2B/v1p3beta1/{produc" + + "t_set.name=projects/*/locations/*/produc" + + "tSets/*}:\013product_set\022\242\001\n\020DeleteProductS" + + "et\0226.google.cloud.vision.v1p3beta1.Delet" + + "eProductSetRequest\032\026.google.protobuf.Emp" + + "ty\">\202\323\344\223\0028*6/v1p3beta1/{name=projects/*/" + + "locations/*/productSets/*}\022\262\001\n\rCreatePro" + + "duct\0223.google.cloud.vision.v1p3beta1.Cre" + + "ateProductRequest\032&.google.cloud.vision." + + "v1p3beta1.Product\"D\202\323\344\223\002>\"3/v1p3beta1/{p" + + "arent=projects/*/locations/*}/products:\007" + + "product\022\264\001\n\014ListProducts\0222.google.cloud." + + "vision.v1p3beta1.ListProductsRequest\0323.g" + + "oogle.cloud.vision.v1p3beta1.ListProduct" + + "sResponse\";\202\323\344\223\0025\0223/v1p3beta1/{parent=pr" + + "ojects/*/locations/*}/products\022\243\001\n\nGetPr" + + "oduct\0220.google.cloud.vision.v1p3beta1.Ge" + + "tProductRequest\032&.google.cloud.vision.v1" + + "p3beta1.Product\";\202\323\344\223\0025\0223/v1p3beta1/{nam" + + "e=projects/*/locations/*/products/*}\022\272\001\n" + + "\rUpdateProduct\0223.google.cloud.vision.v1p" + + "3beta1.UpdateProductRequest\032&.google.clo" + + "ud.vision.v1p3beta1.Product\"L\202\323\344\223\002F2;/v1" + + "p3beta1/{product.name=projects/*/locatio" + + "ns/*/products/*}:\007product\022\231\001\n\rDeleteProd" + + "uct\0223.google.cloud.vision.v1p3beta1.Dele" + + "teProductRequest\032\026.google.protobuf.Empty" + + "\";\202\323\344\223\0025*3/v1p3beta1/{name=projects/*/lo" + + "cations/*/products/*}\022\341\001\n\024CreateReferenc" + + "eImage\022:.google.cloud.vision.v1p3beta1.C" + + "reateReferenceImageRequest\032-.google.clou" + + "d.vision.v1p3beta1.ReferenceImage\"^\202\323\344\223\002" + + "X\"E/v1p3beta1/{parent=projects/*/locatio" + + "ns/*/products/*}/referenceImages:\017refere" + + "nce_image\022\271\001\n\024DeleteReferenceImage\022:.goo" + + "gle.cloud.vision.v1p3beta1.DeleteReferen" + + "ceImageRequest\032\026.google.protobuf.Empty\"M" + + "\202\323\344\223\002G*E/v1p3beta1/{name=projects/*/loca" + + "tions/*/products/*/referenceImages/*}\022\333\001" + + "\n\023ListReferenceImages\0229.google.cloud.vis" + + "ion.v1p3beta1.ListReferenceImagesRequest" + + "\032:.google.cloud.vision.v1p3beta1.ListRef" + + "erenceImagesResponse\"M\202\323\344\223\002G\022E/v1p3beta1" + + "/{parent=projects/*/locations/*/products" + + "/*}/referenceImages\022\312\001\n\021GetReferenceImag" + + "e\0227.google.cloud.vision.v1p3beta1.GetRef" + + "erenceImageRequest\032-.google.cloud.vision" + + ".v1p3beta1.ReferenceImage\"M\202\323\344\223\002G\022E/v1p3" + + "beta1/{name=projects/*/locations/*/produ" + + "cts/*/referenceImages/*}\022\274\001\n\026AddProductT" + + "oProductSet\022<.google.cloud.vision.v1p3be" + + "ta1.AddProductToProductSetRequest\032\026.goog" + + "le.protobuf.Empty\"L\202\323\344\223\002F\"A/v1p3beta1/{n" + + "ame=projects/*/locations/*/productSets/*" + + "}:addProduct:\001*\022\311\001\n\033RemoveProductFromPro" + + "ductSet\022A.google.cloud.vision.v1p3beta1." + + "RemoveProductFromProductSetRequest\032\026.goo" + + "gle.protobuf.Empty\"O\202\323\344\223\002I\"D/v1p3beta1/{" + + "name=projects/*/locations/*/productSets/" + + "*}:removeProduct:\001*\022\344\001\n\030ListProductsInPr" + + "oductSet\022>.google.cloud.vision.v1p3beta1" + + ".ListProductsInProductSetRequest\032?.googl" + + "e.cloud.vision.v1p3beta1.ListProductsInP" + + "roductSetResponse\"G\202\323\344\223\002A\022?/v1p3beta1/{n" + + "ame=projects/*/locations/*/productSets/*" + + "}/products\022\265\001\n\021ImportProductSets\0227.googl" + + "e.cloud.vision.v1p3beta1.ImportProductSe" + + "tsRequest\032\035.google.longrunning.Operation" + + "\"H\202\323\344\223\002B\"=/v1p3beta1/{parent=projects/*/" + + "locations/*}/productSets:import:\001*B\210\001\n!c" + + "om.google.cloud.vision.v1p3beta1B\031Produc" + + "tSearchServiceProtoP\001ZCgoogle.golang.org" + + "/genproto/googleapis/cloud/vision/v1p3be" + + "ta1;vision\370\001\001b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.vision.v1p3beta1.GeometryProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_vision_v1p3beta1_Product_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_Product_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Product_descriptor, + new java.lang.String[] { "Name", "DisplayName", "Description", "ProductCategory", "ProductLabels", }); + internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_descriptor = + internal_static_google_cloud_vision_v1p3beta1_Product_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Product_KeyValue_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_vision_v1p3beta1_ProductSet_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p3beta1_ProductSet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ProductSet_descriptor, + new java.lang.String[] { "Name", "DisplayName", "IndexTime", "IndexError", }); + internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor, + new java.lang.String[] { "Name", "Uri", "BoundingPolys", }); + internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_CreateProductRequest_descriptor, + new java.lang.String[] { "Parent", "Product", "ProductId", }); + internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ListProductsRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ListProductsResponse_descriptor, + new java.lang.String[] { "Products", "NextPageToken", }); + internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_GetProductRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_descriptor, + new java.lang.String[] { "Product", "UpdateMask", }); + internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_DeleteProductRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_CreateProductSetRequest_descriptor, + new java.lang.String[] { "Parent", "ProductSet", "ProductSetId", }); + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ListProductSetsResponse_descriptor, + new java.lang.String[] { "ProductSets", "NextPageToken", }); + internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_GetProductSetRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_descriptor, + new java.lang.String[] { "ProductSet", "UpdateMask", }); + internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_DeleteProductSetRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_CreateReferenceImageRequest_descriptor, + new java.lang.String[] { "Parent", "ReferenceImage", "ReferenceImageId", }); + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ListReferenceImagesResponse_descriptor, + new java.lang.String[] { "ReferenceImages", "PageSize", "NextPageToken", }); + internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_GetReferenceImageRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_DeleteReferenceImageRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_AddProductToProductSetRequest_descriptor, + new java.lang.String[] { "Name", "Product", }); + internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_descriptor, + new java.lang.String[] { "Name", "Product", }); + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetRequest_descriptor, + new java.lang.String[] { "Name", "PageSize", "PageToken", }); + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ListProductsInProductSetResponse_descriptor, + new java.lang.String[] { "Products", "NextPageToken", }); + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsGcsSource_descriptor, + new java.lang.String[] { "CsvFileUri", }); + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsInputConfig_descriptor, + new java.lang.String[] { "GcsSource", "Source", }); + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsRequest_descriptor, + new java.lang.String[] { "Parent", "InputConfig", }); + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_ImportProductSetsResponse_descriptor, + new java.lang.String[] { "ReferenceImages", "Statuses", }); + internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_BatchOperationMetadata_descriptor, + new java.lang.String[] { "State", "SubmitTime", "EndTime", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.vision.v1p3beta1.GeometryProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSet.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSet.java new file mode 100644 index 000000000000..841a5ce4097c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSet.java @@ -0,0 +1,1257 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A ProductSet contains Products. A ProductSet can contain a maximum of 1
+ * million reference images. If the limit is exceeded, periodic indexing will
+ * fail.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSet} + */ +public final class ProductSet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ProductSet) + ProductSetOrBuilder { +private static final long serialVersionUID = 0L; + // Use ProductSet.newBuilder() to construct. + private ProductSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ProductSet() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProductSet( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + 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: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (indexTime_ != null) { + subBuilder = indexTime_.toBuilder(); + } + indexTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(indexTime_); + indexTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.rpc.Status.Builder subBuilder = null; + if (indexError_ != null) { + subBuilder = indexError_.toBuilder(); + } + indexError_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(indexError_); + indexError_ = subBuilder.buildPartial(); + } + + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ProductSet_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ProductSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSet.class, com.google.cloud.vision.v1p3beta1.ProductSet.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * 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 ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * 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_; + /** + *
+   * The user-provided name for this ProductSet. Must not be empty. Must be at
+   * most 4096 characters long.
+   * 
+ * + * 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; + } + } + /** + *
+   * The user-provided name for this ProductSet. Must not be empty. Must be at
+   * most 4096 characters long.
+   * 
+ * + * 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 INDEX_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp indexTime_; + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public boolean hasIndexTime() { + return indexTime_ != null; + } + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.Timestamp getIndexTime() { + return indexTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder() { + return getIndexTime(); + } + + public static final int INDEX_ERROR_FIELD_NUMBER = 4; + private com.google.rpc.Status indexError_; + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + public boolean hasIndexError() { + return indexError_ != null; + } + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.Status getIndexError() { + return indexError_ == null ? com.google.rpc.Status.getDefaultInstance() : indexError_; + } + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.StatusOrBuilder getIndexErrorOrBuilder() { + return getIndexError(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + 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 (indexTime_ != null) { + output.writeMessage(3, getIndexTime()); + } + if (indexError_ != null) { + output.writeMessage(4, getIndexError()); + } + unknownFields.writeTo(output); + } + + 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 (indexTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getIndexTime()); + } + if (indexError_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getIndexError()); + } + 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.vision.v1p3beta1.ProductSet)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ProductSet other = (com.google.cloud.vision.v1p3beta1.ProductSet) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDisplayName() + .equals(other.getDisplayName()); + result = result && (hasIndexTime() == other.hasIndexTime()); + if (hasIndexTime()) { + result = result && getIndexTime() + .equals(other.getIndexTime()); + } + result = result && (hasIndexError() == other.hasIndexError()); + if (hasIndexError()) { + result = result && getIndexError() + .equals(other.getIndexError()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + if (hasIndexTime()) { + hash = (37 * hash) + INDEX_TIME_FIELD_NUMBER; + hash = (53 * hash) + getIndexTime().hashCode(); + } + if (hasIndexError()) { + hash = (37 * hash) + INDEX_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getIndexError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ProductSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSet 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.vision.v1p3beta1.ProductSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSet 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.vision.v1p3beta1.ProductSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ProductSet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ProductSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSet 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.vision.v1p3beta1.ProductSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSet 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.vision.v1p3beta1.ProductSet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ProductSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ProductSet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 ProductSet contains Products. A ProductSet can contain a maximum of 1
+   * million reference images. If the limit is exceeded, periodic indexing will
+   * fail.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ProductSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ProductSet) + com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ProductSet_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ProductSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ProductSet.class, com.google.cloud.vision.v1p3beta1.ProductSet.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ProductSet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + if (indexTimeBuilder_ == null) { + indexTime_ = null; + } else { + indexTime_ = null; + indexTimeBuilder_ = null; + } + if (indexErrorBuilder_ == null) { + indexError_ = null; + } else { + indexError_ = null; + indexErrorBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ProductSet_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ProductSet getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ProductSet build() { + com.google.cloud.vision.v1p3beta1.ProductSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ProductSet buildPartial() { + com.google.cloud.vision.v1p3beta1.ProductSet result = new com.google.cloud.vision.v1p3beta1.ProductSet(this); + result.name_ = name_; + result.displayName_ = displayName_; + if (indexTimeBuilder_ == null) { + result.indexTime_ = indexTime_; + } else { + result.indexTime_ = indexTimeBuilder_.build(); + } + if (indexErrorBuilder_ == null) { + result.indexError_ = indexError_; + } else { + result.indexError_ = indexErrorBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ProductSet) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ProductSet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ProductSet other) { + if (other == com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.hasIndexTime()) { + mergeIndexTime(other.getIndexTime()); + } + if (other.hasIndexError()) { + mergeIndexError(other.getIndexError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ProductSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ProductSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * 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 ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * 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 ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * 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 ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * 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_ = ""; + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * 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; + } + } + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * 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; + } + } + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * 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 com.google.protobuf.Timestamp indexTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> indexTimeBuilder_; + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public boolean hasIndexTime() { + return indexTimeBuilder_ != null || indexTime_ != null; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.Timestamp getIndexTime() { + if (indexTimeBuilder_ == null) { + return indexTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } else { + return indexTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public Builder setIndexTime(com.google.protobuf.Timestamp value) { + if (indexTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + indexTime_ = value; + onChanged(); + } else { + indexTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public Builder setIndexTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (indexTimeBuilder_ == null) { + indexTime_ = builderForValue.build(); + onChanged(); + } else { + indexTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public Builder mergeIndexTime(com.google.protobuf.Timestamp value) { + if (indexTimeBuilder_ == null) { + if (indexTime_ != null) { + indexTime_ = + com.google.protobuf.Timestamp.newBuilder(indexTime_).mergeFrom(value).buildPartial(); + } else { + indexTime_ = value; + } + onChanged(); + } else { + indexTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public Builder clearIndexTime() { + if (indexTimeBuilder_ == null) { + indexTime_ = null; + onChanged(); + } else { + indexTime_ = null; + indexTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getIndexTimeBuilder() { + + onChanged(); + return getIndexTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder() { + if (indexTimeBuilder_ != null) { + return indexTimeBuilder_.getMessageOrBuilder(); + } else { + return indexTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getIndexTimeFieldBuilder() { + if (indexTimeBuilder_ == null) { + indexTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getIndexTime(), + getParentForChildren(), + isClean()); + indexTime_ = null; + } + return indexTimeBuilder_; + } + + private com.google.rpc.Status indexError_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> indexErrorBuilder_; + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public boolean hasIndexError() { + return indexErrorBuilder_ != null || indexError_ != null; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.Status getIndexError() { + if (indexErrorBuilder_ == null) { + return indexError_ == null ? com.google.rpc.Status.getDefaultInstance() : indexError_; + } else { + return indexErrorBuilder_.getMessage(); + } + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public Builder setIndexError(com.google.rpc.Status value) { + if (indexErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + indexError_ = value; + onChanged(); + } else { + indexErrorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public Builder setIndexError( + com.google.rpc.Status.Builder builderForValue) { + if (indexErrorBuilder_ == null) { + indexError_ = builderForValue.build(); + onChanged(); + } else { + indexErrorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public Builder mergeIndexError(com.google.rpc.Status value) { + if (indexErrorBuilder_ == null) { + if (indexError_ != null) { + indexError_ = + com.google.rpc.Status.newBuilder(indexError_).mergeFrom(value).buildPartial(); + } else { + indexError_ = value; + } + onChanged(); + } else { + indexErrorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public Builder clearIndexError() { + if (indexErrorBuilder_ == null) { + indexError_ = null; + onChanged(); + } else { + indexError_ = null; + indexErrorBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.Status.Builder getIndexErrorBuilder() { + + onChanged(); + return getIndexErrorFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.StatusOrBuilder getIndexErrorOrBuilder() { + if (indexErrorBuilder_ != null) { + return indexErrorBuilder_.getMessageOrBuilder(); + } else { + return indexError_ == null ? + com.google.rpc.Status.getDefaultInstance() : indexError_; + } + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getIndexErrorFieldBuilder() { + if (indexErrorBuilder_ == null) { + indexErrorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getIndexError(), + getParentForChildren(), + isClean()); + indexError_ = null; + } + return indexErrorBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ProductSet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSet) + private static final com.google.cloud.vision.v1p3beta1.ProductSet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ProductSet(); + } + + public static com.google.cloud.vision.v1p3beta1.ProductSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ProductSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductSet(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ProductSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSetName.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSetName.java new file mode 100644 index 000000000000..4ceb583ea40a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSetName.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.vision.v1p3beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProductSetName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/productSets/{product_set}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String productSet; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProductSet() { + return productSet; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProductSetName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + productSet = Preconditions.checkNotNull(builder.getProductSet()); + } + + public static ProductSetName of(String project, String location, String productSet) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProductSet(productSet) + .build(); + } + + public static String format(String project, String location, String productSet) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProductSet(productSet) + .build() + .toString(); + } + + public static ProductSetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProductSetName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("product_set")); + } + + 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 (ProductSetName 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("productSet", productSet); + 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, "product_set", productSet); + } + + /** Builder for ProductSetName. */ + public static class Builder { + + private String project; + private String location; + private String productSet; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProductSet() { + return productSet; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProductSet(String productSet) { + this.productSet = productSet; + return this; + } + + private Builder() { + } + + private Builder(ProductSetName productSetName) { + project = productSetName.project; + location = productSetName.location; + productSet = productSetName.productSet; + } + + public ProductSetName build() { + return new ProductSetName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProductSetName) { + ProductSetName that = (ProductSetName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.productSet.equals(that.productSet)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= productSet.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSetOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSetOrBuilder.java new file mode 100644 index 000000000000..7b488cbffa92 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSetOrBuilder.java @@ -0,0 +1,118 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ProductSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ProductSet) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The resource name of the ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The user-provided name for this ProductSet. Must not be empty. Must be at
+   * most 4096 characters long.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + *
+   * The user-provided name for this ProductSet. Must not be empty. Must be at
+   * most 4096 characters long.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + boolean hasIndexTime(); + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + com.google.protobuf.Timestamp getIndexTime(); + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder(); + + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + boolean hasIndexError(); + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + com.google.rpc.Status getIndexError(); + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + com.google.rpc.StatusOrBuilder getIndexErrorOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Property.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Property.java new file mode 100644 index 000000000000..26ea3aaf204b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Property.java @@ -0,0 +1,782 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A `Property` consists of a user-supplied name/value pair.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Property} + */ +public final class Property extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Property) + PropertyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Property.newBuilder() to construct. + private Property(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Property() { + name_ = ""; + value_ = ""; + uint64Value_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Property( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + case 24: { + + uint64Value_ = input.readUInt64(); + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Property_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Property.class, com.google.cloud.vision.v1p3beta1.Property.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Name of the property.
+   * 
+ * + * 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 property.
+   * 
+ * + * 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 VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object value_; + /** + *
+   * Value of the property.
+   * 
+ * + * string value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + *
+   * Value of the property.
+   * 
+ * + * string value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UINT64_VALUE_FIELD_NUMBER = 3; + private long uint64Value_; + /** + *
+   * Value of numeric properties.
+   * 
+ * + * uint64 uint64_value = 3; + */ + public long getUint64Value() { + return uint64Value_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + if (uint64Value_ != 0L) { + output.writeUInt64(3, uint64Value_); + } + unknownFields.writeTo(output); + } + + 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 (!getValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + if (uint64Value_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, uint64Value_); + } + 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.vision.v1p3beta1.Property)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Property other = (com.google.cloud.vision.v1p3beta1.Property) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getValue() + .equals(other.getValue()); + result = result && (getUint64Value() + == other.getUint64Value()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + UINT64_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUint64Value()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Property parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Property 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.vision.v1p3beta1.Property parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Property 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.vision.v1p3beta1.Property parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Property parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Property parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Property 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.vision.v1p3beta1.Property parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Property 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.vision.v1p3beta1.Property parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Property parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Property prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 `Property` consists of a user-supplied name/value pair.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Property} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Property) + com.google.cloud.vision.v1p3beta1.PropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Property_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Property.class, com.google.cloud.vision.v1p3beta1.Property.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Property.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + value_ = ""; + + uint64Value_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_Property_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Property getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Property.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Property build() { + com.google.cloud.vision.v1p3beta1.Property result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Property buildPartial() { + com.google.cloud.vision.v1p3beta1.Property result = new com.google.cloud.vision.v1p3beta1.Property(this); + result.name_ = name_; + result.value_ = value_; + result.uint64Value_ = uint64Value_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Property) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Property)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Property other) { + if (other == com.google.cloud.vision.v1p3beta1.Property.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (other.getUint64Value() != 0L) { + setUint64Value(other.getUint64Value()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Property parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Property) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Name of the property.
+     * 
+ * + * 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 property.
+     * 
+ * + * 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 property.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Name of the property.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Name of the property.
+     * 
+ * + * 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 value_ = ""; + /** + *
+     * Value of the property.
+     * 
+ * + * string value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Value of the property.
+     * 
+ * + * string value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Value of the property.
+     * 
+ * + * string value = 2; + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+     * Value of the property.
+     * 
+ * + * string value = 2; + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + *
+     * Value of the property.
+     * 
+ * + * string value = 2; + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private long uint64Value_ ; + /** + *
+     * Value of numeric properties.
+     * 
+ * + * uint64 uint64_value = 3; + */ + public long getUint64Value() { + return uint64Value_; + } + /** + *
+     * Value of numeric properties.
+     * 
+ * + * uint64 uint64_value = 3; + */ + public Builder setUint64Value(long value) { + + uint64Value_ = value; + onChanged(); + return this; + } + /** + *
+     * Value of numeric properties.
+     * 
+ * + * uint64 uint64_value = 3; + */ + public Builder clearUint64Value() { + + uint64Value_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Property) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Property) + private static final com.google.cloud.vision.v1p3beta1.Property DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Property(); + } + + public static com.google.cloud.vision.v1p3beta1.Property getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Property parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Property(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Property getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PropertyOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PropertyOrBuilder.java new file mode 100644 index 000000000000..aac3425eea4d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/PropertyOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface PropertyOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Property) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Name of the property.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Name of the property.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Value of the property.
+   * 
+ * + * string value = 2; + */ + java.lang.String getValue(); + /** + *
+   * Value of the property.
+   * 
+ * + * string value = 2; + */ + com.google.protobuf.ByteString + getValueBytes(); + + /** + *
+   * Value of numeric properties.
+   * 
+ * + * uint64 uint64_value = 3; + */ + long getUint64Value(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImage.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImage.java new file mode 100644 index 000000000000..b5f8080e56ca --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImage.java @@ -0,0 +1,1322 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A `ReferenceImage` represents a product image and its associated metadata,
+ * such as bounding boxes.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ReferenceImage} + */ +public final class ReferenceImage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ReferenceImage) + ReferenceImageOrBuilder { +private static final long serialVersionUID = 0L; + // Use ReferenceImage.newBuilder() to construct. + private ReferenceImage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ReferenceImage() { + name_ = ""; + uri_ = ""; + boundingPolys_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ReferenceImage( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + boundingPolys_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + boundingPolys_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + boundingPolys_ = java.util.Collections.unmodifiableList(boundingPolys_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ReferenceImage.class, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the reference image.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+   * This field is ignored when creating a reference image.
+   * 
+ * + * 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 reference image.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+   * This field is ignored when creating a reference image.
+   * 
+ * + * 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 URI_FIELD_NUMBER = 2; + private volatile java.lang.Object uri_; + /** + *
+   * The Google Cloud Storage URI of the reference image.
+   * The URI must start with `gs://`.
+   * Required.
+   * 
+ * + * string uri = 2; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + *
+   * The Google Cloud Storage URI of the reference image.
+   * The URI must start with `gs://`.
+   * Required.
+   * 
+ * + * string uri = 2; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOUNDING_POLYS_FIELD_NUMBER = 3; + private java.util.List boundingPolys_; + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public java.util.List getBoundingPolysList() { + return boundingPolys_; + } + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public java.util.List + getBoundingPolysOrBuilderList() { + return boundingPolys_; + } + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public int getBoundingPolysCount() { + return boundingPolys_.size(); + } + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPolys(int index) { + return boundingPolys_.get(index); + } + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolysOrBuilder( + int index) { + return boundingPolys_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_); + } + for (int i = 0; i < boundingPolys_.size(); i++) { + output.writeMessage(3, boundingPolys_.get(i)); + } + unknownFields.writeTo(output); + } + + 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 (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_); + } + for (int i = 0; i < boundingPolys_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, boundingPolys_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ReferenceImage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.ReferenceImage other = (com.google.cloud.vision.v1p3beta1.ReferenceImage) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getUri() + .equals(other.getUri()); + result = result && getBoundingPolysList() + .equals(other.getBoundingPolysList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getBoundingPolysCount() > 0) { + hash = (37 * hash) + BOUNDING_POLYS_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPolysList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ReferenceImage 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.vision.v1p3beta1.ReferenceImage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ReferenceImage 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.vision.v1p3beta1.ReferenceImage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ReferenceImage 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.vision.v1p3beta1.ReferenceImage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ReferenceImage 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.vision.v1p3beta1.ReferenceImage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ReferenceImage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 `ReferenceImage` represents a product image and its associated metadata,
+   * such as bounding boxes.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.ReferenceImage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ReferenceImage) + com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.ReferenceImage.class, com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.ReferenceImage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getBoundingPolysFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + uri_ = ""; + + if (boundingPolysBuilder_ == null) { + boundingPolys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + boundingPolysBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.ReferenceImage getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.ReferenceImage build() { + com.google.cloud.vision.v1p3beta1.ReferenceImage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.ReferenceImage buildPartial() { + com.google.cloud.vision.v1p3beta1.ReferenceImage result = new com.google.cloud.vision.v1p3beta1.ReferenceImage(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.uri_ = uri_; + if (boundingPolysBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + boundingPolys_ = java.util.Collections.unmodifiableList(boundingPolys_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.boundingPolys_ = boundingPolys_; + } else { + result.boundingPolys_ = boundingPolysBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.ReferenceImage) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.ReferenceImage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ReferenceImage other) { + if (other == com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (boundingPolysBuilder_ == null) { + if (!other.boundingPolys_.isEmpty()) { + if (boundingPolys_.isEmpty()) { + boundingPolys_ = other.boundingPolys_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureBoundingPolysIsMutable(); + boundingPolys_.addAll(other.boundingPolys_); + } + onChanged(); + } + } else { + if (!other.boundingPolys_.isEmpty()) { + if (boundingPolysBuilder_.isEmpty()) { + boundingPolysBuilder_.dispose(); + boundingPolysBuilder_ = null; + boundingPolys_ = other.boundingPolys_; + bitField0_ = (bitField0_ & ~0x00000004); + boundingPolysBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getBoundingPolysFieldBuilder() : null; + } else { + boundingPolysBuilder_.addAllMessages(other.boundingPolys_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.ReferenceImage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.ReferenceImage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the reference image.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+     * This field is ignored when creating a reference image.
+     * 
+ * + * 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 reference image.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+     * This field is ignored when creating a reference image.
+     * 
+ * + * 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 reference image.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+     * This field is ignored when creating a reference image.
+     * 
+ * + * 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 reference image.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+     * This field is ignored when creating a reference image.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the reference image.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+     * This field is ignored when creating a reference image.
+     * 
+ * + * 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 uri_ = ""; + /** + *
+     * The Google Cloud Storage URI of the reference image.
+     * The URI must start with `gs://`.
+     * Required.
+     * 
+ * + * string uri = 2; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The Google Cloud Storage URI of the reference image.
+     * The URI must start with `gs://`.
+     * Required.
+     * 
+ * + * string uri = 2; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The Google Cloud Storage URI of the reference image.
+     * The URI must start with `gs://`.
+     * Required.
+     * 
+ * + * string uri = 2; + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + *
+     * The Google Cloud Storage URI of the reference image.
+     * The URI must start with `gs://`.
+     * Required.
+     * 
+ * + * string uri = 2; + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + *
+     * The Google Cloud Storage URI of the reference image.
+     * The URI must start with `gs://`.
+     * Required.
+     * 
+ * + * string uri = 2; + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.util.List boundingPolys_ = + java.util.Collections.emptyList(); + private void ensureBoundingPolysIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + boundingPolys_ = new java.util.ArrayList(boundingPolys_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingPolysBuilder_; + + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public java.util.List getBoundingPolysList() { + if (boundingPolysBuilder_ == null) { + return java.util.Collections.unmodifiableList(boundingPolys_); + } else { + return boundingPolysBuilder_.getMessageList(); + } + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public int getBoundingPolysCount() { + if (boundingPolysBuilder_ == null) { + return boundingPolys_.size(); + } else { + return boundingPolysBuilder_.getCount(); + } + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPolys(int index) { + if (boundingPolysBuilder_ == null) { + return boundingPolys_.get(index); + } else { + return boundingPolysBuilder_.getMessage(index); + } + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder setBoundingPolys( + int index, com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoundingPolysIsMutable(); + boundingPolys_.set(index, value); + onChanged(); + } else { + boundingPolysBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder setBoundingPolys( + int index, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolysBuilder_ == null) { + ensureBoundingPolysIsMutable(); + boundingPolys_.set(index, builderForValue.build()); + onChanged(); + } else { + boundingPolysBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoundingPolysIsMutable(); + boundingPolys_.add(value); + onChanged(); + } else { + boundingPolysBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + int index, com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingPolysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoundingPolysIsMutable(); + boundingPolys_.add(index, value); + onChanged(); + } else { + boundingPolysBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolysBuilder_ == null) { + ensureBoundingPolysIsMutable(); + boundingPolys_.add(builderForValue.build()); + onChanged(); + } else { + boundingPolysBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + int index, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolysBuilder_ == null) { + ensureBoundingPolysIsMutable(); + boundingPolys_.add(index, builderForValue.build()); + onChanged(); + } else { + boundingPolysBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addAllBoundingPolys( + java.lang.Iterable values) { + if (boundingPolysBuilder_ == null) { + ensureBoundingPolysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, boundingPolys_); + onChanged(); + } else { + boundingPolysBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder clearBoundingPolys() { + if (boundingPolysBuilder_ == null) { + boundingPolys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + boundingPolysBuilder_.clear(); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public Builder removeBoundingPolys(int index) { + if (boundingPolysBuilder_ == null) { + ensureBoundingPolysIsMutable(); + boundingPolys_.remove(index); + onChanged(); + } else { + boundingPolysBuilder_.remove(index); + } + return this; + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingPolysBuilder( + int index) { + return getBoundingPolysFieldBuilder().getBuilder(index); + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolysOrBuilder( + int index) { + if (boundingPolysBuilder_ == null) { + return boundingPolys_.get(index); } else { + return boundingPolysBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public java.util.List + getBoundingPolysOrBuilderList() { + if (boundingPolysBuilder_ != null) { + return boundingPolysBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(boundingPolys_); + } + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder addBoundingPolysBuilder() { + return getBoundingPolysFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance()); + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder addBoundingPolysBuilder( + int index) { + return getBoundingPolysFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance()); + } + /** + *
+     * Bounding polygons around the areas of interest in the reference image.
+     * Optional. If this field is empty, the system will try to detect regions of
+     * interest. At most 10 bounding polygons will be used.
+     * The provided shape is converted into a non-rotated rectangle. Once
+     * converted, the small edge of the rectangle must be greater than or equal
+     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+     * is not).
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + public java.util.List + getBoundingPolysBuilderList() { + return getBoundingPolysFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingPolysFieldBuilder() { + if (boundingPolysBuilder_ == null) { + boundingPolysBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + boundingPolys_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + boundingPolys_ = null; + } + return boundingPolysBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ReferenceImage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ReferenceImage) + private static final com.google.cloud.vision.v1p3beta1.ReferenceImage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ReferenceImage(); + } + + public static com.google.cloud.vision.v1p3beta1.ReferenceImage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ReferenceImage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReferenceImage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.ReferenceImage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImageName.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImageName.java new file mode 100644 index 000000000000..bf5fe827900a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImageName.java @@ -0,0 +1,235 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.vision.v1p3beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ReferenceImageName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String product; + private final String referenceImage; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProduct() { + return product; + } + + public String getReferenceImage() { + return referenceImage; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ReferenceImageName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + product = Preconditions.checkNotNull(builder.getProduct()); + referenceImage = Preconditions.checkNotNull(builder.getReferenceImage()); + } + + public static ReferenceImageName of(String project, String location, String product, String referenceImage) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProduct(product) + .setReferenceImage(referenceImage) + .build(); + } + + public static String format(String project, String location, String product, String referenceImage) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProduct(product) + .setReferenceImage(referenceImage) + .build() + .toString(); + } + + public static ReferenceImageName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ReferenceImageName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("product"), matchMap.get("reference_image")); + } + + 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 (ReferenceImageName 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("product", product); + fieldMapBuilder.put("referenceImage", referenceImage); + 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, "product", product, "reference_image", referenceImage); + } + + /** Builder for ReferenceImageName. */ + public static class Builder { + + private String project; + private String location; + private String product; + private String referenceImage; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProduct() { + return product; + } + + public String getReferenceImage() { + return referenceImage; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + public Builder setReferenceImage(String referenceImage) { + this.referenceImage = referenceImage; + return this; + } + + private Builder() { + } + + private Builder(ReferenceImageName referenceImageName) { + project = referenceImageName.project; + location = referenceImageName.location; + product = referenceImageName.product; + referenceImage = referenceImageName.referenceImage; + } + + public ReferenceImageName build() { + return new ReferenceImageName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ReferenceImageName) { + ReferenceImageName that = (ReferenceImageName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.product.equals(that.product)) + && (this.referenceImage.equals(that.referenceImage)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= product.hashCode(); + h *= 1000003; + h ^= referenceImage.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImageOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImageOrBuilder.java new file mode 100644 index 000000000000..6f17f2d99c15 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/ReferenceImageOrBuilder.java @@ -0,0 +1,129 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface ReferenceImageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.ReferenceImage) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the reference image.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+   * This field is ignored when creating a reference image.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The resource name of the reference image.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
+   * This field is ignored when creating a reference image.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The Google Cloud Storage URI of the reference image.
+   * The URI must start with `gs://`.
+   * Required.
+   * 
+ * + * string uri = 2; + */ + java.lang.String getUri(); + /** + *
+   * The Google Cloud Storage URI of the reference image.
+   * The URI must start with `gs://`.
+   * Required.
+   * 
+ * + * string uri = 2; + */ + com.google.protobuf.ByteString + getUriBytes(); + + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + java.util.List + getBoundingPolysList(); + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPolys(int index); + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + int getBoundingPolysCount(); + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + java.util.List + getBoundingPolysOrBuilderList(); + /** + *
+   * Bounding polygons around the areas of interest in the reference image.
+   * Optional. If this field is empty, the system will try to detect regions of
+   * interest. At most 10 bounding polygons will be used.
+   * The provided shape is converted into a non-rotated rectangle. Once
+   * converted, the small edge of the rectangle must be greater than or equal
+   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
+   * is not).
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolysOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/RemoveProductFromProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/RemoveProductFromProductSetRequest.java new file mode 100644 index 000000000000..e1ff795e3fba --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/RemoveProductFromProductSetRequest.java @@ -0,0 +1,735 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `RemoveProductFromProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest} + */ +public final class RemoveProductFromProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) + RemoveProductFromProductSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use RemoveProductFromProductSetRequest.newBuilder() to construct. + private RemoveProductFromProductSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RemoveProductFromProductSetRequest() { + name_ = ""; + product_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RemoveProductFromProductSetRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + product_ = s; + 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.class, com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name for the ProductSet to modify.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+   * The resource name for the ProductSet to modify.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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 PRODUCT_FIELD_NUMBER = 2; + private volatile java.lang.Object product_; + /** + *
+   * The resource name for the Product to be removed from this ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string product = 2; + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + *
+   * The resource name for the Product to be removed from this ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string product = 2; + */ + public com.google.protobuf.ByteString + getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getProductBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, product_); + } + unknownFields.writeTo(output); + } + + 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 (!getProductBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, product_); + } + 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.vision.v1p3beta1.RemoveProductFromProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest other = (com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getProduct() + .equals(other.getProduct()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest 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.vision.v1p3beta1.RemoveProductFromProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest 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.vision.v1p3beta1.RemoveProductFromProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest 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.vision.v1p3beta1.RemoveProductFromProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest 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.vision.v1p3beta1.RemoveProductFromProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `RemoveProductFromProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.class, com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + product_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_RemoveProductFromProductSetRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest build() { + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest result = new com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest(this); + result.name_ = name_; + result.product_ = product_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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; + } + } + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name for the ProductSet to modify.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_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 product_ = ""; + /** + *
+     * The resource name for the Product to be removed from this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name for the Product to be removed from this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public com.google.protobuf.ByteString + getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name for the Product to be removed from this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public Builder setProduct( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name for the Product to be removed from this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + *
+     * The resource name for the Product to be removed from this ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+     * 
+ * + * string product = 2; + */ + public Builder setProductBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) + private static final com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public RemoveProductFromProductSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveProductFromProductSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/RemoveProductFromProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/RemoveProductFromProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..89a62aca8d96 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/RemoveProductFromProductSetRequestOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface RemoveProductFromProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name for the ProductSet to modify.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The resource name for the ProductSet to modify.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The resource name for the Product to be removed from this ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string product = 2; + */ + java.lang.String getProduct(); + /** + *
+   * The resource name for the Product to be removed from this ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
+   * 
+ * + * string product = 2; + */ + com.google.protobuf.ByteString + getProductBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SafeSearchAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SafeSearchAnnotation.java new file mode 100644 index 000000000000..3a3d39206313 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SafeSearchAnnotation.java @@ -0,0 +1,1005 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Set of features pertaining to the image, computed by computer vision
+ * methods over safe-search verticals (for example, adult, spoof, medical,
+ * violence).
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.SafeSearchAnnotation} + */ +public final class SafeSearchAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.SafeSearchAnnotation) + SafeSearchAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use SafeSearchAnnotation.newBuilder() to construct. + private SafeSearchAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SafeSearchAnnotation() { + adult_ = 0; + spoof_ = 0; + medical_ = 0; + violence_ = 0; + racy_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SafeSearchAnnotation( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + adult_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + + spoof_ = rawValue; + break; + } + case 24: { + int rawValue = input.readEnum(); + + medical_ = rawValue; + break; + } + case 32: { + int rawValue = input.readEnum(); + + violence_ = rawValue; + break; + } + case 72: { + int rawValue = input.readEnum(); + + racy_ = rawValue; + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.class, com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.Builder.class); + } + + public static final int ADULT_FIELD_NUMBER = 1; + private int adult_; + /** + *
+   * Represents the adult content likelihood for the image. Adult content may
+   * contain elements such as nudity, pornographic images or cartoons, or
+   * sexual activities.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + public int getAdultValue() { + return adult_; + } + /** + *
+   * Represents the adult content likelihood for the image. Adult content may
+   * contain elements such as nudity, pornographic images or cartoons, or
+   * sexual activities.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getAdult() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(adult_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int SPOOF_FIELD_NUMBER = 2; + private int spoof_; + /** + *
+   * Spoof likelihood. The likelihood that an modification
+   * was made to the image's canonical version to make it appear
+   * funny or offensive.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + public int getSpoofValue() { + return spoof_; + } + /** + *
+   * Spoof likelihood. The likelihood that an modification
+   * was made to the image's canonical version to make it appear
+   * funny or offensive.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getSpoof() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(spoof_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int MEDICAL_FIELD_NUMBER = 3; + private int medical_; + /** + *
+   * Likelihood that this is a medical image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + public int getMedicalValue() { + return medical_; + } + /** + *
+   * Likelihood that this is a medical image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getMedical() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(medical_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int VIOLENCE_FIELD_NUMBER = 4; + private int violence_; + /** + *
+   * Likelihood that this image contains violent content.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + public int getViolenceValue() { + return violence_; + } + /** + *
+   * Likelihood that this image contains violent content.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getViolence() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(violence_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int RACY_FIELD_NUMBER = 9; + private int racy_; + /** + *
+   * Likelihood that the request image contains racy content. Racy content may
+   * include (but is not limited to) skimpy or sheer clothing, strategically
+   * covered nudity, lewd or provocative poses, or close-ups of sensitive
+   * body areas.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + public int getRacyValue() { + return racy_; + } + /** + *
+   * Likelihood that the request image contains racy content. Racy content may
+   * include (but is not limited to) skimpy or sheer clothing, strategically
+   * covered nudity, lewd or provocative poses, or close-ups of sensitive
+   * body areas.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getRacy() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(racy_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (adult_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(1, adult_); + } + if (spoof_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(2, spoof_); + } + if (medical_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(3, medical_); + } + if (violence_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(4, violence_); + } + if (racy_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(9, racy_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (adult_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, adult_); + } + if (spoof_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, spoof_); + } + if (medical_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, medical_); + } + if (violence_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, violence_); + } + if (racy_ != com.google.cloud.vision.v1p3beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(9, racy_); + } + 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.vision.v1p3beta1.SafeSearchAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation other = (com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation) obj; + + boolean result = true; + result = result && adult_ == other.adult_; + result = result && spoof_ == other.spoof_; + result = result && medical_ == other.medical_; + result = result && violence_ == other.violence_; + result = result && racy_ == other.racy_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ADULT_FIELD_NUMBER; + hash = (53 * hash) + adult_; + hash = (37 * hash) + SPOOF_FIELD_NUMBER; + hash = (53 * hash) + spoof_; + hash = (37 * hash) + MEDICAL_FIELD_NUMBER; + hash = (53 * hash) + medical_; + hash = (37 * hash) + VIOLENCE_FIELD_NUMBER; + hash = (53 * hash) + violence_; + hash = (37 * hash) + RACY_FIELD_NUMBER; + hash = (53 * hash) + racy_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation 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.vision.v1p3beta1.SafeSearchAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation 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.vision.v1p3beta1.SafeSearchAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation 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.vision.v1p3beta1.SafeSearchAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation 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.vision.v1p3beta1.SafeSearchAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Set of features pertaining to the image, computed by computer vision
+   * methods over safe-search verticals (for example, adult, spoof, medical,
+   * violence).
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.SafeSearchAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.SafeSearchAnnotation) + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.class, com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + adult_ = 0; + + spoof_ = 0; + + medical_ = 0; + + violence_ = 0; + + racy_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_SafeSearchAnnotation_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation build() { + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation buildPartial() { + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation result = new com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation(this); + result.adult_ = adult_; + result.spoof_ = spoof_; + result.medical_ = medical_; + result.violence_ = violence_; + result.racy_ = racy_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation other) { + if (other == com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.getDefaultInstance()) return this; + if (other.adult_ != 0) { + setAdultValue(other.getAdultValue()); + } + if (other.spoof_ != 0) { + setSpoofValue(other.getSpoofValue()); + } + if (other.medical_ != 0) { + setMedicalValue(other.getMedicalValue()); + } + if (other.violence_ != 0) { + setViolenceValue(other.getViolenceValue()); + } + if (other.racy_ != 0) { + setRacyValue(other.getRacyValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int adult_ = 0; + /** + *
+     * Represents the adult content likelihood for the image. Adult content may
+     * contain elements such as nudity, pornographic images or cartoons, or
+     * sexual activities.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + public int getAdultValue() { + return adult_; + } + /** + *
+     * Represents the adult content likelihood for the image. Adult content may
+     * contain elements such as nudity, pornographic images or cartoons, or
+     * sexual activities.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + public Builder setAdultValue(int value) { + adult_ = value; + onChanged(); + return this; + } + /** + *
+     * Represents the adult content likelihood for the image. Adult content may
+     * contain elements such as nudity, pornographic images or cartoons, or
+     * sexual activities.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getAdult() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(adult_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Represents the adult content likelihood for the image. Adult content may
+     * contain elements such as nudity, pornographic images or cartoons, or
+     * sexual activities.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + public Builder setAdult(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + adult_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Represents the adult content likelihood for the image. Adult content may
+     * contain elements such as nudity, pornographic images or cartoons, or
+     * sexual activities.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + public Builder clearAdult() { + + adult_ = 0; + onChanged(); + return this; + } + + private int spoof_ = 0; + /** + *
+     * Spoof likelihood. The likelihood that an modification
+     * was made to the image's canonical version to make it appear
+     * funny or offensive.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + public int getSpoofValue() { + return spoof_; + } + /** + *
+     * Spoof likelihood. The likelihood that an modification
+     * was made to the image's canonical version to make it appear
+     * funny or offensive.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + public Builder setSpoofValue(int value) { + spoof_ = value; + onChanged(); + return this; + } + /** + *
+     * Spoof likelihood. The likelihood that an modification
+     * was made to the image's canonical version to make it appear
+     * funny or offensive.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getSpoof() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(spoof_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Spoof likelihood. The likelihood that an modification
+     * was made to the image's canonical version to make it appear
+     * funny or offensive.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + public Builder setSpoof(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + spoof_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Spoof likelihood. The likelihood that an modification
+     * was made to the image's canonical version to make it appear
+     * funny or offensive.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + public Builder clearSpoof() { + + spoof_ = 0; + onChanged(); + return this; + } + + private int medical_ = 0; + /** + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + public int getMedicalValue() { + return medical_; + } + /** + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + public Builder setMedicalValue(int value) { + medical_ = value; + onChanged(); + return this; + } + /** + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getMedical() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(medical_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + public Builder setMedical(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + medical_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + public Builder clearMedical() { + + medical_ = 0; + onChanged(); + return this; + } + + private int violence_ = 0; + /** + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + public int getViolenceValue() { + return violence_; + } + /** + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + public Builder setViolenceValue(int value) { + violence_ = value; + onChanged(); + return this; + } + /** + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getViolence() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(violence_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + public Builder setViolence(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + violence_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + public Builder clearViolence() { + + violence_ = 0; + onChanged(); + return this; + } + + private int racy_ = 0; + /** + *
+     * Likelihood that the request image contains racy content. Racy content may
+     * include (but is not limited to) skimpy or sheer clothing, strategically
+     * covered nudity, lewd or provocative poses, or close-ups of sensitive
+     * body areas.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + public int getRacyValue() { + return racy_; + } + /** + *
+     * Likelihood that the request image contains racy content. Racy content may
+     * include (but is not limited to) skimpy or sheer clothing, strategically
+     * covered nudity, lewd or provocative poses, or close-ups of sensitive
+     * body areas.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + public Builder setRacyValue(int value) { + racy_ = value; + onChanged(); + return this; + } + /** + *
+     * Likelihood that the request image contains racy content. Racy content may
+     * include (but is not limited to) skimpy or sheer clothing, strategically
+     * covered nudity, lewd or provocative poses, or close-ups of sensitive
+     * body areas.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + public com.google.cloud.vision.v1p3beta1.Likelihood getRacy() { + com.google.cloud.vision.v1p3beta1.Likelihood result = com.google.cloud.vision.v1p3beta1.Likelihood.valueOf(racy_); + return result == null ? com.google.cloud.vision.v1p3beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Likelihood that the request image contains racy content. Racy content may
+     * include (but is not limited to) skimpy or sheer clothing, strategically
+     * covered nudity, lewd or provocative poses, or close-ups of sensitive
+     * body areas.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + public Builder setRacy(com.google.cloud.vision.v1p3beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + racy_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Likelihood that the request image contains racy content. Racy content may
+     * include (but is not limited to) skimpy or sheer clothing, strategically
+     * covered nudity, lewd or provocative poses, or close-ups of sensitive
+     * body areas.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + public Builder clearRacy() { + + racy_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.SafeSearchAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.SafeSearchAnnotation) + private static final com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation(); + } + + public static com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public SafeSearchAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SafeSearchAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.SafeSearchAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SafeSearchAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SafeSearchAnnotationOrBuilder.java new file mode 100644 index 000000000000..1222fd0bbc60 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SafeSearchAnnotationOrBuilder.java @@ -0,0 +1,108 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface SafeSearchAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.SafeSearchAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Represents the adult content likelihood for the image. Adult content may
+   * contain elements such as nudity, pornographic images or cartoons, or
+   * sexual activities.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + int getAdultValue(); + /** + *
+   * Represents the adult content likelihood for the image. Adult content may
+   * contain elements such as nudity, pornographic images or cartoons, or
+   * sexual activities.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood adult = 1; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getAdult(); + + /** + *
+   * Spoof likelihood. The likelihood that an modification
+   * was made to the image's canonical version to make it appear
+   * funny or offensive.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + int getSpoofValue(); + /** + *
+   * Spoof likelihood. The likelihood that an modification
+   * was made to the image's canonical version to make it appear
+   * funny or offensive.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood spoof = 2; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getSpoof(); + + /** + *
+   * Likelihood that this is a medical image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + int getMedicalValue(); + /** + *
+   * Likelihood that this is a medical image.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood medical = 3; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getMedical(); + + /** + *
+   * Likelihood that this image contains violent content.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + int getViolenceValue(); + /** + *
+   * Likelihood that this image contains violent content.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood violence = 4; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getViolence(); + + /** + *
+   * Likelihood that the request image contains racy content. Racy content may
+   * include (but is not limited to) skimpy or sheer clothing, strategically
+   * covered nudity, lewd or provocative poses, or close-ups of sensitive
+   * body areas.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + int getRacyValue(); + /** + *
+   * Likelihood that the request image contains racy content. Racy content may
+   * include (but is not limited to) skimpy or sheer clothing, strategically
+   * covered nudity, lewd or provocative poses, or close-ups of sensitive
+   * body areas.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Likelihood racy = 9; + */ + com.google.cloud.vision.v1p3beta1.Likelihood getRacy(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Symbol.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Symbol.java new file mode 100644 index 000000000000..3992c5b8f900 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Symbol.java @@ -0,0 +1,1255 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A single symbol representation.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Symbol} + */ +public final class Symbol extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Symbol) + SymbolOrBuilder { +private static final long serialVersionUID = 0L; + // Use Symbol.newBuilder() to construct. + private Symbol(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Symbol() { + text_ = ""; + confidence_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Symbol( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder subBuilder = null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = input.readMessage(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingBox_); + boundingBox_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + text_ = s; + break; + } + case 37: { + + confidence_ = input.readFloat(); + 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.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Symbol_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Symbol.class, com.google.cloud.vision.v1p3beta1.Symbol.Builder.class); + } + + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_; + /** + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + /** + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + return getProperty(); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_; + /** + *
+   * The bounding box for the symbol.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public boolean hasBoundingBox() { + return boundingBox_ != null; + } + /** + *
+   * The bounding box for the symbol.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() { + return boundingBox_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } + /** + *
+   * The bounding box for the symbol.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + return getBoundingBox(); + } + + public static final int TEXT_FIELD_NUMBER = 3; + private volatile java.lang.Object text_; + /** + *
+   * The actual UTF-8 representation of the symbol.
+   * 
+ * + * string text = 3; + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + *
+   * The actual UTF-8 representation of the symbol.
+   * 
+ * + * string text = 3; + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIDENCE_FIELD_NUMBER = 4; + private float confidence_; + /** + *
+   * Confidence of the OCR results for the symbol. Range [0, 1].
+   * 
+ * + * float confidence = 4; + */ + public float getConfidence() { + return confidence_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (property_ != null) { + output.writeMessage(1, getProperty()); + } + if (boundingBox_ != null) { + output.writeMessage(2, getBoundingBox()); + } + if (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, text_); + } + if (confidence_ != 0F) { + output.writeFloat(4, confidence_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (property_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProperty()); + } + if (boundingBox_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getBoundingBox()); + } + if (!getTextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, text_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, confidence_); + } + 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.vision.v1p3beta1.Symbol)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Symbol other = (com.google.cloud.vision.v1p3beta1.Symbol) obj; + + boolean result = true; + result = result && (hasProperty() == other.hasProperty()); + if (hasProperty()) { + result = result && getProperty() + .equals(other.getProperty()); + } + result = result && (hasBoundingBox() == other.hasBoundingBox()); + if (hasBoundingBox()) { + result = result && getBoundingBox() + .equals(other.getBoundingBox()); + } + result = result && getText() + .equals(other.getText()); + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProperty()) { + hash = (37 * hash) + PROPERTY_FIELD_NUMBER; + hash = (53 * hash) + getProperty().hashCode(); + } + if (hasBoundingBox()) { + hash = (37 * hash) + BOUNDING_BOX_FIELD_NUMBER; + hash = (53 * hash) + getBoundingBox().hashCode(); + } + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Symbol 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.vision.v1p3beta1.Symbol parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Symbol 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.vision.v1p3beta1.Symbol parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Symbol 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.vision.v1p3beta1.Symbol parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Symbol 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.vision.v1p3beta1.Symbol parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Symbol prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 single symbol representation.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Symbol} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Symbol) + com.google.cloud.vision.v1p3beta1.SymbolOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Symbol_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Symbol.class, com.google.cloud.vision.v1p3beta1.Symbol.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Symbol.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (propertyBuilder_ == null) { + property_ = null; + } else { + property_ = null; + propertyBuilder_ = null; + } + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + text_ = ""; + + confidence_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Symbol getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Symbol.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Symbol build() { + com.google.cloud.vision.v1p3beta1.Symbol result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Symbol buildPartial() { + com.google.cloud.vision.v1p3beta1.Symbol result = new com.google.cloud.vision.v1p3beta1.Symbol(this); + if (propertyBuilder_ == null) { + result.property_ = property_; + } else { + result.property_ = propertyBuilder_.build(); + } + if (boundingBoxBuilder_ == null) { + result.boundingBox_ = boundingBox_; + } else { + result.boundingBox_ = boundingBoxBuilder_.build(); + } + result.text_ = text_; + result.confidence_ = confidence_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Symbol) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Symbol)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Symbol other) { + if (other == com.google.cloud.vision.v1p3beta1.Symbol.getDefaultInstance()) return this; + if (other.hasProperty()) { + mergeProperty(other.getProperty()); + } + if (other.hasBoundingBox()) { + mergeBoundingBox(other.getBoundingBox()); + } + if (!other.getText().isEmpty()) { + text_ = other.text_; + onChanged(); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Symbol parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Symbol) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> propertyBuilder_; + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + property_ = value; + onChanged(); + } else { + propertyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder builderForValue) { + if (propertyBuilder_ == null) { + property_ = builderForValue.build(); + onChanged(); + } else { + propertyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.newBuilder(property_).mergeFrom(value).buildPartial(); + } else { + property_ = value; + } + onChanged(); + } else { + propertyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder clearProperty() { + if (propertyBuilder_ == null) { + property_ = null; + onChanged(); + } else { + property_ = null; + propertyBuilder_ = null; + } + + return this; + } + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null ? + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + } + /** + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), + getParentForChildren(), + isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingBoxBuilder_; + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public boolean hasBoundingBox() { + return boundingBoxBuilder_ != null || boundingBox_ != null; + } + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } else { + return boundingBoxBuilder_.getMessage(); + } + } + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingBox_ = value; + onChanged(); + } else { + boundingBoxBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingBoxBuilder_ == null) { + boundingBox_ = builderForValue.build(); + onChanged(); + } else { + boundingBoxBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder mergeBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingBox_).mergeFrom(value).buildPartial(); + } else { + boundingBox_ = value; + } + onChanged(); + } else { + boundingBoxBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder clearBoundingBox() { + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + onChanged(); + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + + return this; + } + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingBoxBuilder() { + + onChanged(); + return getBoundingBoxFieldBuilder().getBuilder(); + } + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } + } + /** + *
+     * The bounding box for the symbol.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingBox(), + getParentForChildren(), + isClean()); + boundingBox_ = null; + } + return boundingBoxBuilder_; + } + + private java.lang.Object text_ = ""; + /** + *
+     * The actual UTF-8 representation of the symbol.
+     * 
+ * + * string text = 3; + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The actual UTF-8 representation of the symbol.
+     * 
+ * + * string text = 3; + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The actual UTF-8 representation of the symbol.
+     * 
+ * + * string text = 3; + */ + public Builder setText( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + text_ = value; + onChanged(); + return this; + } + /** + *
+     * The actual UTF-8 representation of the symbol.
+     * 
+ * + * string text = 3; + */ + public Builder clearText() { + + text_ = getDefaultInstance().getText(); + onChanged(); + return this; + } + /** + *
+     * The actual UTF-8 representation of the symbol.
+     * 
+ * + * string text = 3; + */ + public Builder setTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + text_ = value; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+     * Confidence of the OCR results for the symbol. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence of the OCR results for the symbol. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence of the OCR results for the symbol. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Symbol) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Symbol) + private static final com.google.cloud.vision.v1p3beta1.Symbol DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Symbol(); + } + + public static com.google.cloud.vision.v1p3beta1.Symbol getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Symbol parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Symbol(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Symbol getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SymbolOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SymbolOrBuilder.java new file mode 100644 index 000000000000..14b66f5cb8c9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/SymbolOrBuilder.java @@ -0,0 +1,128 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface SymbolOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Symbol) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty(); + /** + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder(); + + /** + *
+   * The bounding box for the symbol.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + boolean hasBoundingBox(); + /** + *
+   * The bounding box for the symbol.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox(); + /** + *
+   * The bounding box for the symbol.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder(); + + /** + *
+   * The actual UTF-8 representation of the symbol.
+   * 
+ * + * string text = 3; + */ + java.lang.String getText(); + /** + *
+   * The actual UTF-8 representation of the symbol.
+   * 
+ * + * string text = 3; + */ + com.google.protobuf.ByteString + getTextBytes(); + + /** + *
+   * Confidence of the OCR results for the symbol. Range [0, 1].
+   * 
+ * + * float confidence = 4; + */ + float getConfidence(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotation.java new file mode 100644 index 000000000000..f9e93d057135 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotation.java @@ -0,0 +1,3607 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * TextAnnotation contains a structured representation of OCR extracted text.
+ * The hierarchy of an OCR extracted text structure is like this:
+ *     TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
+ * Each structural component, starting from Page, may further have their own
+ * properties. Properties describe detected languages, breaks etc.. Please refer
+ * to the [TextAnnotation.TextProperty][google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty] message definition below for more
+ * detail.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.TextAnnotation} + */ +public final class TextAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.TextAnnotation) + TextAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use TextAnnotation.newBuilder() to construct. + private TextAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextAnnotation() { + pages_ = java.util.Collections.emptyList(); + text_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextAnnotation( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + pages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + pages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Page.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + text_ = s; + 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) == 0x00000001)) { + pages_ = java.util.Collections.unmodifiableList(pages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.TextAnnotation.class, com.google.cloud.vision.v1p3beta1.TextAnnotation.Builder.class); + } + + public interface DetectedLanguageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 1; + */ + java.lang.String getLanguageCode(); + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 1; + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); + + /** + *
+     * Confidence of detected language. Range [0, 1].
+     * 
+ * + * float confidence = 2; + */ + float getConfidence(); + } + /** + *
+   * Detected language for a structural component.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage} + */ + public static final class DetectedLanguage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) + DetectedLanguageOrBuilder { + private static final long serialVersionUID = 0L; + // Use DetectedLanguage.newBuilder() to construct. + private DetectedLanguage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DetectedLanguage() { + languageCode_ = ""; + confidence_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DetectedLanguage( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 21: { + + confidence_ = input.readFloat(); + 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.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.class, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder.class); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 1; + private volatile java.lang.Object languageCode_; + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 1; + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + *
+     * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 1; + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIDENCE_FIELD_NUMBER = 2; + private float confidence_; + /** + *
+     * Confidence of detected language. Range [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, languageCode_); + } + if (confidence_ != 0F) { + output.writeFloat(2, confidence_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, languageCode_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, confidence_); + } + 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.vision.v1p3beta1.TextAnnotation.DetectedLanguage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage other = (com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) obj; + + boolean result = true; + result = result && getLanguageCode() + .equals(other.getLanguageCode()); + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage 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.vision.v1p3beta1.TextAnnotation.DetectedLanguage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage 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.vision.v1p3beta1.TextAnnotation.DetectedLanguage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage 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.vision.v1p3beta1.TextAnnotation.DetectedLanguage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage 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.vision.v1p3beta1.TextAnnotation.DetectedLanguage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+     * Detected language for a structural component.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.class, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + languageCode_ = ""; + + confidence_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage build() { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage buildPartial() { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage result = new com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage(this); + result.languageCode_ = languageCode_; + result.confidence_ = confidence_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage other) { + if (other == com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.getDefaultInstance()) return this; + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+       * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+       * information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 1; + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+       * information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 1; + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+       * information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 1; + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+       * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+       * information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 1; + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+       * The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+       * information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 1; + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+       * Confidence of detected language. Range [0, 1].
+       * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+       * Confidence of detected language. Range [0, 1].
+       * 
+ * + * float confidence = 2; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+       * Confidence of detected language. Range [0, 1].
+       * 
+ * + * float confidence = 2; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) + private static final com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage(); + } + + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DetectedLanguage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DetectedLanguage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DetectedBreakOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Detected break type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + int getTypeValue(); + /** + *
+     * Detected break type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType getType(); + + /** + *
+     * True if break prepends the element.
+     * 
+ * + * bool is_prefix = 2; + */ + boolean getIsPrefix(); + } + /** + *
+   * Detected start or end of a structural component.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak} + */ + public static final class DetectedBreak extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) + DetectedBreakOrBuilder { + private static final long serialVersionUID = 0L; + // Use DetectedBreak.newBuilder() to construct. + private DetectedBreak(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DetectedBreak() { + type_ = 0; + isPrefix_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DetectedBreak( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 16: { + + isPrefix_ = input.readBool(); + 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.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.class, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.Builder.class); + } + + /** + *
+     * Enum to denote the type of break found. New line, space etc.
+     * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType} + */ + public enum BreakType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * Unknown break label type.
+       * 
+ * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + *
+       * Regular space.
+       * 
+ * + * SPACE = 1; + */ + SPACE(1), + /** + *
+       * Sure space (very wide).
+       * 
+ * + * SURE_SPACE = 2; + */ + SURE_SPACE(2), + /** + *
+       * Line-wrapping break.
+       * 
+ * + * EOL_SURE_SPACE = 3; + */ + EOL_SURE_SPACE(3), + /** + *
+       * End-line hyphen that is not present in text; does not co-occur with
+       * `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
+       * 
+ * + * HYPHEN = 4; + */ + HYPHEN(4), + /** + *
+       * Line break that ends a paragraph.
+       * 
+ * + * LINE_BREAK = 5; + */ + LINE_BREAK(5), + UNRECOGNIZED(-1), + ; + + /** + *
+       * Unknown break label type.
+       * 
+ * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + *
+       * Regular space.
+       * 
+ * + * SPACE = 1; + */ + public static final int SPACE_VALUE = 1; + /** + *
+       * Sure space (very wide).
+       * 
+ * + * SURE_SPACE = 2; + */ + public static final int SURE_SPACE_VALUE = 2; + /** + *
+       * Line-wrapping break.
+       * 
+ * + * EOL_SURE_SPACE = 3; + */ + public static final int EOL_SURE_SPACE_VALUE = 3; + /** + *
+       * End-line hyphen that is not present in text; does not co-occur with
+       * `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
+       * 
+ * + * HYPHEN = 4; + */ + public static final int HYPHEN_VALUE = 4; + /** + *
+       * Line break that ends a paragraph.
+       * 
+ * + * LINE_BREAK = 5; + */ + public static final int LINE_BREAK_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BreakType valueOf(int value) { + return forNumber(value); + } + + public static BreakType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return SPACE; + case 2: return SURE_SPACE; + case 3: return EOL_SURE_SPACE; + case 4: return HYPHEN; + case 5: return LINE_BREAK; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BreakType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BreakType findValueByNumber(int number) { + return BreakType.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.vision.v1p3beta1.TextAnnotation.DetectedBreak.getDescriptor().getEnumTypes().get(0); + } + + private static final BreakType[] VALUES = values(); + + public static BreakType 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 BreakType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + *
+     * Detected break type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + *
+     * Detected break type.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType getType() { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType result = com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType.valueOf(type_); + return result == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType.UNRECOGNIZED : result; + } + + public static final int IS_PREFIX_FIELD_NUMBER = 2; + private boolean isPrefix_; + /** + *
+     * True if break prepends the element.
+     * 
+ * + * bool is_prefix = 2; + */ + public boolean getIsPrefix() { + return isPrefix_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType.UNKNOWN.getNumber()) { + output.writeEnum(1, type_); + } + if (isPrefix_ != false) { + output.writeBool(2, isPrefix_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (isPrefix_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, isPrefix_); + } + 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.vision.v1p3beta1.TextAnnotation.DetectedBreak)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak other = (com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) obj; + + boolean result = true; + result = result && type_ == other.type_; + result = result && (getIsPrefix() + == other.getIsPrefix()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + IS_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsPrefix()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak 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.vision.v1p3beta1.TextAnnotation.DetectedBreak parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak 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.vision.v1p3beta1.TextAnnotation.DetectedBreak parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak 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.vision.v1p3beta1.TextAnnotation.DetectedBreak parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak 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.vision.v1p3beta1.TextAnnotation.DetectedBreak parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+     * Detected start or end of a structural component.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreakOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.class, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + type_ = 0; + + isPrefix_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak build() { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak buildPartial() { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak result = new com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak(this); + result.type_ = type_; + result.isPrefix_ = isPrefix_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak other) { + if (other == com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.getIsPrefix() != false) { + setIsPrefix(other.getIsPrefix()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType getType() { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType result = com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType.valueOf(type_); + return result == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType.UNRECOGNIZED : result; + } + /** + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public Builder setType(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private boolean isPrefix_ ; + /** + *
+       * True if break prepends the element.
+       * 
+ * + * bool is_prefix = 2; + */ + public boolean getIsPrefix() { + return isPrefix_; + } + /** + *
+       * True if break prepends the element.
+       * 
+ * + * bool is_prefix = 2; + */ + public Builder setIsPrefix(boolean value) { + + isPrefix_ = value; + onChanged(); + return this; + } + /** + *
+       * True if break prepends the element.
+       * 
+ * + * bool is_prefix = 2; + */ + public Builder clearIsPrefix() { + + isPrefix_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) + private static final com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak(); + } + + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DetectedBreak parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DetectedBreak(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TextPropertyOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + java.util.List + getDetectedLanguagesList(); + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage getDetectedLanguages(int index); + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + int getDetectedLanguagesCount(); + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + java.util.List + getDetectedLanguagesOrBuilderList(); + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguageOrBuilder getDetectedLanguagesOrBuilder( + int index); + + /** + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + boolean hasDetectedBreak(); + /** + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak getDetectedBreak(); + /** + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreakOrBuilder getDetectedBreakOrBuilder(); + } + /** + *
+   * Additional information detected on the structural component.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty} + */ + public static final class TextProperty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) + TextPropertyOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextProperty.newBuilder() to construct. + private TextProperty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextProperty() { + detectedLanguages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextProperty( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + detectedLanguages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + detectedLanguages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.parser(), extensionRegistry)); + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.Builder subBuilder = null; + if (detectedBreak_ != null) { + subBuilder = detectedBreak_.toBuilder(); + } + detectedBreak_ = input.readMessage(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(detectedBreak_); + detectedBreak_ = subBuilder.buildPartial(); + } + + 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) == 0x00000001)) { + detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.class, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder.class); + } + + private int bitField0_; + public static final int DETECTED_LANGUAGES_FIELD_NUMBER = 1; + private java.util.List detectedLanguages_; + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public java.util.List getDetectedLanguagesList() { + return detectedLanguages_; + } + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public java.util.List + getDetectedLanguagesOrBuilderList() { + return detectedLanguages_; + } + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public int getDetectedLanguagesCount() { + return detectedLanguages_.size(); + } + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage getDetectedLanguages(int index) { + return detectedLanguages_.get(index); + } + /** + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguageOrBuilder getDetectedLanguagesOrBuilder( + int index) { + return detectedLanguages_.get(index); + } + + public static final int DETECTED_BREAK_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detectedBreak_; + /** + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public boolean hasDetectedBreak() { + return detectedBreak_ != null; + } + /** + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak getDetectedBreak() { + return detectedBreak_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.getDefaultInstance() : detectedBreak_; + } + /** + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreakOrBuilder getDetectedBreakOrBuilder() { + return getDetectedBreak(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < detectedLanguages_.size(); i++) { + output.writeMessage(1, detectedLanguages_.get(i)); + } + if (detectedBreak_ != null) { + output.writeMessage(2, getDetectedBreak()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < detectedLanguages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, detectedLanguages_.get(i)); + } + if (detectedBreak_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDetectedBreak()); + } + 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.vision.v1p3beta1.TextAnnotation.TextProperty)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty other = (com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) obj; + + boolean result = true; + result = result && getDetectedLanguagesList() + .equals(other.getDetectedLanguagesList()); + result = result && (hasDetectedBreak() == other.hasDetectedBreak()); + if (hasDetectedBreak()) { + result = result && getDetectedBreak() + .equals(other.getDetectedBreak()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDetectedLanguagesCount() > 0) { + hash = (37 * hash) + DETECTED_LANGUAGES_FIELD_NUMBER; + hash = (53 * hash) + getDetectedLanguagesList().hashCode(); + } + if (hasDetectedBreak()) { + hash = (37 * hash) + DETECTED_BREAK_FIELD_NUMBER; + hash = (53 * hash) + getDetectedBreak().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty 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.vision.v1p3beta1.TextAnnotation.TextProperty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty 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.vision.v1p3beta1.TextAnnotation.TextProperty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty 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.vision.v1p3beta1.TextAnnotation.TextProperty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty 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.vision.v1p3beta1.TextAnnotation.TextProperty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+     * Additional information detected on the structural component.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.class, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDetectedLanguagesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (detectedLanguagesBuilder_ == null) { + detectedLanguages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + detectedLanguagesBuilder_.clear(); + } + if (detectedBreakBuilder_ == null) { + detectedBreak_ = null; + } else { + detectedBreak_ = null; + detectedBreakBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty build() { + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty buildPartial() { + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty result = new com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (detectedLanguagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.detectedLanguages_ = detectedLanguages_; + } else { + result.detectedLanguages_ = detectedLanguagesBuilder_.build(); + } + if (detectedBreakBuilder_ == null) { + result.detectedBreak_ = detectedBreak_; + } else { + result.detectedBreak_ = detectedBreakBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty other) { + if (other == com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance()) return this; + if (detectedLanguagesBuilder_ == null) { + if (!other.detectedLanguages_.isEmpty()) { + if (detectedLanguages_.isEmpty()) { + detectedLanguages_ = other.detectedLanguages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDetectedLanguagesIsMutable(); + detectedLanguages_.addAll(other.detectedLanguages_); + } + onChanged(); + } + } else { + if (!other.detectedLanguages_.isEmpty()) { + if (detectedLanguagesBuilder_.isEmpty()) { + detectedLanguagesBuilder_.dispose(); + detectedLanguagesBuilder_ = null; + detectedLanguages_ = other.detectedLanguages_; + bitField0_ = (bitField0_ & ~0x00000001); + detectedLanguagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDetectedLanguagesFieldBuilder() : null; + } else { + detectedLanguagesBuilder_.addAllMessages(other.detectedLanguages_); + } + } + } + if (other.hasDetectedBreak()) { + mergeDetectedBreak(other.getDetectedBreak()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List detectedLanguages_ = + java.util.Collections.emptyList(); + private void ensureDetectedLanguagesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + detectedLanguages_ = new java.util.ArrayList(detectedLanguages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguageOrBuilder> detectedLanguagesBuilder_; + + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public java.util.List getDetectedLanguagesList() { + if (detectedLanguagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(detectedLanguages_); + } else { + return detectedLanguagesBuilder_.getMessageList(); + } + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public int getDetectedLanguagesCount() { + if (detectedLanguagesBuilder_ == null) { + return detectedLanguages_.size(); + } else { + return detectedLanguagesBuilder_.getCount(); + } + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage getDetectedLanguages(int index) { + if (detectedLanguagesBuilder_ == null) { + return detectedLanguages_.get(index); + } else { + return detectedLanguagesBuilder_.getMessage(index); + } + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder setDetectedLanguages( + int index, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage value) { + if (detectedLanguagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedLanguagesIsMutable(); + detectedLanguages_.set(index, value); + onChanged(); + } else { + detectedLanguagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder setDetectedLanguages( + int index, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder builderForValue) { + if (detectedLanguagesBuilder_ == null) { + ensureDetectedLanguagesIsMutable(); + detectedLanguages_.set(index, builderForValue.build()); + onChanged(); + } else { + detectedLanguagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder addDetectedLanguages(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage value) { + if (detectedLanguagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedLanguagesIsMutable(); + detectedLanguages_.add(value); + onChanged(); + } else { + detectedLanguagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder addDetectedLanguages( + int index, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage value) { + if (detectedLanguagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedLanguagesIsMutable(); + detectedLanguages_.add(index, value); + onChanged(); + } else { + detectedLanguagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder addDetectedLanguages( + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder builderForValue) { + if (detectedLanguagesBuilder_ == null) { + ensureDetectedLanguagesIsMutable(); + detectedLanguages_.add(builderForValue.build()); + onChanged(); + } else { + detectedLanguagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder addDetectedLanguages( + int index, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder builderForValue) { + if (detectedLanguagesBuilder_ == null) { + ensureDetectedLanguagesIsMutable(); + detectedLanguages_.add(index, builderForValue.build()); + onChanged(); + } else { + detectedLanguagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder addAllDetectedLanguages( + java.lang.Iterable values) { + if (detectedLanguagesBuilder_ == null) { + ensureDetectedLanguagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, detectedLanguages_); + onChanged(); + } else { + detectedLanguagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder clearDetectedLanguages() { + if (detectedLanguagesBuilder_ == null) { + detectedLanguages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + detectedLanguagesBuilder_.clear(); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public Builder removeDetectedLanguages(int index) { + if (detectedLanguagesBuilder_ == null) { + ensureDetectedLanguagesIsMutable(); + detectedLanguages_.remove(index); + onChanged(); + } else { + detectedLanguagesBuilder_.remove(index); + } + return this; + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder getDetectedLanguagesBuilder( + int index) { + return getDetectedLanguagesFieldBuilder().getBuilder(index); + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguageOrBuilder getDetectedLanguagesOrBuilder( + int index) { + if (detectedLanguagesBuilder_ == null) { + return detectedLanguages_.get(index); } else { + return detectedLanguagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public java.util.List + getDetectedLanguagesOrBuilderList() { + if (detectedLanguagesBuilder_ != null) { + return detectedLanguagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(detectedLanguages_); + } + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder addDetectedLanguagesBuilder() { + return getDetectedLanguagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.getDefaultInstance()); + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder addDetectedLanguagesBuilder( + int index) { + return getDetectedLanguagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.getDefaultInstance()); + } + /** + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + */ + public java.util.List + getDetectedLanguagesBuilderList() { + return getDetectedLanguagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguageOrBuilder> + getDetectedLanguagesFieldBuilder() { + if (detectedLanguagesBuilder_ == null) { + detectedLanguagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguageOrBuilder>( + detectedLanguages_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + detectedLanguages_ = null; + } + return detectedLanguagesBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detectedBreak_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreakOrBuilder> detectedBreakBuilder_; + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public boolean hasDetectedBreak() { + return detectedBreakBuilder_ != null || detectedBreak_ != null; + } + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak getDetectedBreak() { + if (detectedBreakBuilder_ == null) { + return detectedBreak_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.getDefaultInstance() : detectedBreak_; + } else { + return detectedBreakBuilder_.getMessage(); + } + } + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public Builder setDetectedBreak(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak value) { + if (detectedBreakBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + detectedBreak_ = value; + onChanged(); + } else { + detectedBreakBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public Builder setDetectedBreak( + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.Builder builderForValue) { + if (detectedBreakBuilder_ == null) { + detectedBreak_ = builderForValue.build(); + onChanged(); + } else { + detectedBreakBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public Builder mergeDetectedBreak(com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak value) { + if (detectedBreakBuilder_ == null) { + if (detectedBreak_ != null) { + detectedBreak_ = + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.newBuilder(detectedBreak_).mergeFrom(value).buildPartial(); + } else { + detectedBreak_ = value; + } + onChanged(); + } else { + detectedBreakBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public Builder clearDetectedBreak() { + if (detectedBreakBuilder_ == null) { + detectedBreak_ = null; + onChanged(); + } else { + detectedBreak_ = null; + detectedBreakBuilder_ = null; + } + + return this; + } + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.Builder getDetectedBreakBuilder() { + + onChanged(); + return getDetectedBreakFieldBuilder().getBuilder(); + } + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreakOrBuilder getDetectedBreakOrBuilder() { + if (detectedBreakBuilder_ != null) { + return detectedBreakBuilder_.getMessageOrBuilder(); + } else { + return detectedBreak_ == null ? + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.getDefaultInstance() : detectedBreak_; + } + } + /** + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreakOrBuilder> + getDetectedBreakFieldBuilder() { + if (detectedBreakBuilder_ == null) { + detectedBreakBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreakOrBuilder>( + getDetectedBreak(), + getParentForChildren(), + isClean()); + detectedBreak_ = null; + } + return detectedBreakBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) + private static final com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty(); + } + + public static com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TextProperty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextProperty(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int PAGES_FIELD_NUMBER = 1; + private java.util.List pages_; + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public java.util.List getPagesList() { + return pages_; + } + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public java.util.List + getPagesOrBuilderList() { + return pages_; + } + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public int getPagesCount() { + return pages_.size(); + } + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p3beta1.Page getPages(int index) { + return pages_.get(index); + } + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p3beta1.PageOrBuilder getPagesOrBuilder( + int index) { + return pages_.get(index); + } + + public static final int TEXT_FIELD_NUMBER = 2; + private volatile java.lang.Object text_; + /** + *
+   * UTF-8 text detected on the pages.
+   * 
+ * + * string text = 2; + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + *
+   * UTF-8 text detected on the pages.
+   * 
+ * + * string text = 2; + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < pages_.size(); i++) { + output.writeMessage(1, pages_.get(i)); + } + if (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, text_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < pages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, pages_.get(i)); + } + if (!getTextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, text_); + } + 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.vision.v1p3beta1.TextAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.TextAnnotation other = (com.google.cloud.vision.v1p3beta1.TextAnnotation) obj; + + boolean result = true; + result = result && getPagesList() + .equals(other.getPagesList()); + result = result && getText() + .equals(other.getText()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPagesCount() > 0) { + hash = (37 * hash) + PAGES_FIELD_NUMBER; + hash = (53 * hash) + getPagesList().hashCode(); + } + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.TextAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation 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.vision.v1p3beta1.TextAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation 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.vision.v1p3beta1.TextAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation 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.vision.v1p3beta1.TextAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation 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.vision.v1p3beta1.TextAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.TextAnnotation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.TextAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * TextAnnotation contains a structured representation of OCR extracted text.
+   * The hierarchy of an OCR extracted text structure is like this:
+   *     TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
+   * Each structural component, starting from Page, may further have their own
+   * properties. Properties describe detected languages, breaks etc.. Please refer
+   * to the [TextAnnotation.TextProperty][google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty] message definition below for more
+   * detail.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.TextAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.TextAnnotation) + com.google.cloud.vision.v1p3beta1.TextAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.TextAnnotation.class, com.google.cloud.vision.v1p3beta1.TextAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.TextAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPagesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (pagesBuilder_ == null) { + pages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + pagesBuilder_.clear(); + } + text_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotation.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation build() { + com.google.cloud.vision.v1p3beta1.TextAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation buildPartial() { + com.google.cloud.vision.v1p3beta1.TextAnnotation result = new com.google.cloud.vision.v1p3beta1.TextAnnotation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (pagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + pages_ = java.util.Collections.unmodifiableList(pages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.pages_ = pages_; + } else { + result.pages_ = pagesBuilder_.build(); + } + result.text_ = text_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.TextAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.TextAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.TextAnnotation other) { + if (other == com.google.cloud.vision.v1p3beta1.TextAnnotation.getDefaultInstance()) return this; + if (pagesBuilder_ == null) { + if (!other.pages_.isEmpty()) { + if (pages_.isEmpty()) { + pages_ = other.pages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePagesIsMutable(); + pages_.addAll(other.pages_); + } + onChanged(); + } + } else { + if (!other.pages_.isEmpty()) { + if (pagesBuilder_.isEmpty()) { + pagesBuilder_.dispose(); + pagesBuilder_ = null; + pages_ = other.pages_; + bitField0_ = (bitField0_ & ~0x00000001); + pagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPagesFieldBuilder() : null; + } else { + pagesBuilder_.addAllMessages(other.pages_); + } + } + } + if (!other.getText().isEmpty()) { + text_ = other.text_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.TextAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.TextAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List pages_ = + java.util.Collections.emptyList(); + private void ensurePagesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + pages_ = new java.util.ArrayList(pages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Page, com.google.cloud.vision.v1p3beta1.Page.Builder, com.google.cloud.vision.v1p3beta1.PageOrBuilder> pagesBuilder_; + + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public java.util.List getPagesList() { + if (pagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(pages_); + } else { + return pagesBuilder_.getMessageList(); + } + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public int getPagesCount() { + if (pagesBuilder_ == null) { + return pages_.size(); + } else { + return pagesBuilder_.getCount(); + } + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p3beta1.Page getPages(int index) { + if (pagesBuilder_ == null) { + return pages_.get(index); + } else { + return pagesBuilder_.getMessage(index); + } + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder setPages( + int index, com.google.cloud.vision.v1p3beta1.Page value) { + if (pagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesIsMutable(); + pages_.set(index, value); + onChanged(); + } else { + pagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder setPages( + int index, com.google.cloud.vision.v1p3beta1.Page.Builder builderForValue) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + pages_.set(index, builderForValue.build()); + onChanged(); + } else { + pagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder addPages(com.google.cloud.vision.v1p3beta1.Page value) { + if (pagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesIsMutable(); + pages_.add(value); + onChanged(); + } else { + pagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder addPages( + int index, com.google.cloud.vision.v1p3beta1.Page value) { + if (pagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesIsMutable(); + pages_.add(index, value); + onChanged(); + } else { + pagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder addPages( + com.google.cloud.vision.v1p3beta1.Page.Builder builderForValue) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + pages_.add(builderForValue.build()); + onChanged(); + } else { + pagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder addPages( + int index, com.google.cloud.vision.v1p3beta1.Page.Builder builderForValue) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + pages_.add(index, builderForValue.build()); + onChanged(); + } else { + pagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder addAllPages( + java.lang.Iterable values) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, pages_); + onChanged(); + } else { + pagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder clearPages() { + if (pagesBuilder_ == null) { + pages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + pagesBuilder_.clear(); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public Builder removePages(int index) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + pages_.remove(index); + onChanged(); + } else { + pagesBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p3beta1.Page.Builder getPagesBuilder( + int index) { + return getPagesFieldBuilder().getBuilder(index); + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p3beta1.PageOrBuilder getPagesOrBuilder( + int index) { + if (pagesBuilder_ == null) { + return pages_.get(index); } else { + return pagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public java.util.List + getPagesOrBuilderList() { + if (pagesBuilder_ != null) { + return pagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pages_); + } + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p3beta1.Page.Builder addPagesBuilder() { + return getPagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Page.getDefaultInstance()); + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p3beta1.Page.Builder addPagesBuilder( + int index) { + return getPagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Page.getDefaultInstance()); + } + /** + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + public java.util.List + getPagesBuilderList() { + return getPagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Page, com.google.cloud.vision.v1p3beta1.Page.Builder, com.google.cloud.vision.v1p3beta1.PageOrBuilder> + getPagesFieldBuilder() { + if (pagesBuilder_ == null) { + pagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Page, com.google.cloud.vision.v1p3beta1.Page.Builder, com.google.cloud.vision.v1p3beta1.PageOrBuilder>( + pages_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + pages_ = null; + } + return pagesBuilder_; + } + + private java.lang.Object text_ = ""; + /** + *
+     * UTF-8 text detected on the pages.
+     * 
+ * + * string text = 2; + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * UTF-8 text detected on the pages.
+     * 
+ * + * string text = 2; + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * UTF-8 text detected on the pages.
+     * 
+ * + * string text = 2; + */ + public Builder setText( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + text_ = value; + onChanged(); + return this; + } + /** + *
+     * UTF-8 text detected on the pages.
+     * 
+ * + * string text = 2; + */ + public Builder clearText() { + + text_ = getDefaultInstance().getText(); + onChanged(); + return this; + } + /** + *
+     * UTF-8 text detected on the pages.
+     * 
+ * + * string text = 2; + */ + public Builder setTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + text_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.TextAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.TextAnnotation) + private static final com.google.cloud.vision.v1p3beta1.TextAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.TextAnnotation(); + } + + public static com.google.cloud.vision.v1p3beta1.TextAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public TextAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.TextAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotationOrBuilder.java new file mode 100644 index 000000000000..864ceeeb02d5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotationOrBuilder.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface TextAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.TextAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + java.util.List + getPagesList(); + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + com.google.cloud.vision.v1p3beta1.Page getPages(int index); + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + int getPagesCount(); + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + java.util.List + getPagesOrBuilderList(); + /** + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Page pages = 1; + */ + com.google.cloud.vision.v1p3beta1.PageOrBuilder getPagesOrBuilder( + int index); + + /** + *
+   * UTF-8 text detected on the pages.
+   * 
+ * + * string text = 2; + */ + java.lang.String getText(); + /** + *
+   * UTF-8 text detected on the pages.
+   * 
+ * + * string text = 2; + */ + com.google.protobuf.ByteString + getTextBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotationProto.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotationProto.java new file mode 100644 index 000000000000..47d12d93f8e0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/TextAnnotationProto.java @@ -0,0 +1,198 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +public final class TextAnnotationProto { + private TextAnnotationProto() {} + 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_vision_v1p3beta1_TextAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Page_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Page_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Block_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Block_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Paragraph_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Paragraph_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Word_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Word_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_Symbol_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/vision/v1p3beta1/text_ann" + + "otation.proto\022\035google.cloud.vision.v1p3b" + + "eta1\032\034google/api/annotations.proto\032,goog" + + "le/cloud/vision/v1p3beta1/geometry.proto" + + "\"\262\004\n\016TextAnnotation\0222\n\005pages\030\001 \003(\0132#.goo" + + "gle.cloud.vision.v1p3beta1.Page\022\014\n\004text\030" + + "\002 \001(\t\032=\n\020DetectedLanguage\022\025\n\rlanguage_co" + + "de\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\032\334\001\n\rDetecte" + + "dBreak\022S\n\004type\030\001 \001(\0162E.google.cloud.visi" + + "on.v1p3beta1.TextAnnotation.DetectedBrea" + + "k.BreakType\022\021\n\tis_prefix\030\002 \001(\010\"c\n\tBreakT" + + "ype\022\013\n\007UNKNOWN\020\000\022\t\n\005SPACE\020\001\022\016\n\nSURE_SPAC" + + "E\020\002\022\022\n\016EOL_SURE_SPACE\020\003\022\n\n\006HYPHEN\020\004\022\016\n\nL" + + "INE_BREAK\020\005\032\277\001\n\014TextProperty\022Z\n\022detected" + + "_languages\030\001 \003(\0132>.google.cloud.vision.v" + + "1p3beta1.TextAnnotation.DetectedLanguage" + + "\022S\n\016detected_break\030\002 \001(\0132;.google.cloud." + + "vision.v1p3beta1.TextAnnotation.Detected" + + "Break\"\275\001\n\004Page\022L\n\010property\030\001 \001(\0132:.googl" + + "e.cloud.vision.v1p3beta1.TextAnnotation." + + "TextProperty\022\r\n\005width\030\002 \001(\005\022\016\n\006height\030\003 " + + "\001(\005\0224\n\006blocks\030\004 \003(\0132$.google.cloud.visio" + + "n.v1p3beta1.Block\022\022\n\nconfidence\030\005 \001(\002\"\202\003" + + "\n\005Block\022L\n\010property\030\001 \001(\0132:.google.cloud" + + ".vision.v1p3beta1.TextAnnotation.TextPro" + + "perty\022A\n\014bounding_box\030\002 \001(\0132+.google.clo" + + "ud.vision.v1p3beta1.BoundingPoly\022<\n\npara" + + "graphs\030\003 \003(\0132(.google.cloud.vision.v1p3b" + + "eta1.Paragraph\022B\n\nblock_type\030\004 \001(\0162..goo" + + "gle.cloud.vision.v1p3beta1.Block.BlockTy" + + "pe\022\022\n\nconfidence\030\005 \001(\002\"R\n\tBlockType\022\013\n\007U" + + "NKNOWN\020\000\022\010\n\004TEXT\020\001\022\t\n\005TABLE\020\002\022\013\n\007PICTURE" + + "\020\003\022\t\n\005RULER\020\004\022\013\n\007BARCODE\020\005\"\344\001\n\tParagraph" + + "\022L\n\010property\030\001 \001(\0132:.google.cloud.vision" + + ".v1p3beta1.TextAnnotation.TextProperty\022A" + + "\n\014bounding_box\030\002 \001(\0132+.google.cloud.visi" + + "on.v1p3beta1.BoundingPoly\0222\n\005words\030\003 \003(\013" + + "2#.google.cloud.vision.v1p3beta1.Word\022\022\n" + + "\nconfidence\030\004 \001(\002\"\343\001\n\004Word\022L\n\010property\030\001" + + " \001(\0132:.google.cloud.vision.v1p3beta1.Tex" + + "tAnnotation.TextProperty\022A\n\014bounding_box" + + "\030\002 \001(\0132+.google.cloud.vision.v1p3beta1.B" + + "oundingPoly\0226\n\007symbols\030\003 \003(\0132%.google.cl" + + "oud.vision.v1p3beta1.Symbol\022\022\n\nconfidenc" + + "e\030\004 \001(\002\"\273\001\n\006Symbol\022L\n\010property\030\001 \001(\0132:.g" + + "oogle.cloud.vision.v1p3beta1.TextAnnotat" + + "ion.TextProperty\022A\n\014bounding_box\030\002 \001(\0132+" + + ".google.cloud.vision.v1p3beta1.BoundingP" + + "oly\022\014\n\004text\030\003 \001(\t\022\022\n\nconfidence\030\004 \001(\002B\202\001" + + "\n!com.google.cloud.vision.v1p3beta1B\023Tex" + + "tAnnotationProtoP\001ZCgoogle.golang.org/ge" + + "nproto/googleapis/cloud/vision/v1p3beta1" + + ";vision\370\001\001b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.vision.v1p3beta1.GeometryProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_descriptor, + new java.lang.String[] { "Pages", "Text", }); + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_descriptor = + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedLanguage_descriptor, + new java.lang.String[] { "LanguageCode", "Confidence", }); + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_descriptor = + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_DetectedBreak_descriptor, + new java.lang.String[] { "Type", "IsPrefix", }); + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_descriptor = + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_TextAnnotation_TextProperty_descriptor, + new java.lang.String[] { "DetectedLanguages", "DetectedBreak", }); + internal_static_google_cloud_vision_v1p3beta1_Page_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p3beta1_Page_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Page_descriptor, + new java.lang.String[] { "Property", "Width", "Height", "Blocks", "Confidence", }); + internal_static_google_cloud_vision_v1p3beta1_Block_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vision_v1p3beta1_Block_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Block_descriptor, + new java.lang.String[] { "Property", "BoundingBox", "Paragraphs", "BlockType", "Confidence", }); + internal_static_google_cloud_vision_v1p3beta1_Paragraph_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vision_v1p3beta1_Paragraph_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Paragraph_descriptor, + new java.lang.String[] { "Property", "BoundingBox", "Words", "Confidence", }); + internal_static_google_cloud_vision_v1p3beta1_Word_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vision_v1p3beta1_Word_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Word_descriptor, + new java.lang.String[] { "Property", "BoundingBox", "Symbols", "Confidence", }); + internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vision_v1p3beta1_Symbol_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor, + new java.lang.String[] { "Property", "BoundingBox", "Text", "Confidence", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.vision.v1p3beta1.GeometryProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductRequest.java new file mode 100644 index 000000000000..944c596af818 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductRequest.java @@ -0,0 +1,915 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `UpdateProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.UpdateProductRequest} + */ +public final class UpdateProductRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.UpdateProductRequest) + UpdateProductRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateProductRequest.newBuilder() to construct. + private UpdateProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateProductRequest() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateProductRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = input.readMessage(com.google.cloud.vision.v1p3beta1.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = 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; + } + } + } + } 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.UpdateProductRequest.class, com.google.cloud.vision.v1p3beta1.UpdateProductRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.Product product_; + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public boolean hasProduct() { + return product_ != null; + } + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product getProduct() { + return product_ == null ? com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+   * to update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask paths include `product_labels`, `display_name` and
+   * `description`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+   * to update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask paths include `product_labels`, `display_name` and
+   * `description`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+   * to update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask paths include `product_labels`, `display_name` and
+   * `description`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (product_ != null) { + output.writeMessage(1, getProduct()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProduct()); + } + 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.vision.v1p3beta1.UpdateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.UpdateProductRequest other = (com.google.cloud.vision.v1p3beta1.UpdateProductRequest) obj; + + boolean result = true; + result = result && (hasProduct() == other.hasProduct()); + if (hasProduct()) { + result = result && getProduct() + .equals(other.getProduct()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().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.vision.v1p3beta1.UpdateProductRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductRequest 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.vision.v1p3beta1.UpdateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductRequest 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.vision.v1p3beta1.UpdateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductRequest 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.vision.v1p3beta1.UpdateProductRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductRequest 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.vision.v1p3beta1.UpdateProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.UpdateProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `UpdateProduct` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.UpdateProductRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.UpdateProductRequest) + com.google.cloud.vision.v1p3beta1.UpdateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.UpdateProductRequest.class, com.google.cloud.vision.v1p3beta1.UpdateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.UpdateProductRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.UpdateProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.UpdateProductRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.UpdateProductRequest build() { + com.google.cloud.vision.v1p3beta1.UpdateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.UpdateProductRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.UpdateProductRequest result = new com.google.cloud.vision.v1p3beta1.UpdateProductRequest(this); + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.UpdateProductRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.UpdateProductRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.UpdateProductRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.UpdateProductRequest.getDefaultInstance()) return this; + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.UpdateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.UpdateProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> productBuilder_; + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null ? com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.vision.v1p3beta1.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public Builder setProduct( + com.google.cloud.vision.v1p3beta1.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public Builder mergeProduct(com.google.cloud.vision.v1p3beta1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1p3beta1.Product.newBuilder(product_).mergeFrom(value).buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null ? + com.google.cloud.vision.v1p3beta1.Product.getDefaultInstance() : product_; + } + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Product, com.google.cloud.vision.v1p3beta1.Product.Builder, com.google.cloud.vision.v1p3beta1.ProductOrBuilder>( + getProduct(), + getParentForChildren(), + isClean()); + product_ = null; + } + return productBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .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(); + } + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .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; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .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; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .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; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .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_; + } + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+     * to update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask paths include `product_labels`, `display_name` and
+     * `description`.
+     * 
+ * + * .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_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.UpdateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.UpdateProductRequest) + private static final com.google.cloud.vision.v1p3beta1.UpdateProductRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.UpdateProductRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.UpdateProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public UpdateProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateProductRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.UpdateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductRequestOrBuilder.java new file mode 100644 index 000000000000..0ddd8959bf26 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface UpdateProductRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.UpdateProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + boolean hasProduct(); + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + com.google.cloud.vision.v1p3beta1.Product getProduct(); + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.Product product = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductOrBuilder getProductOrBuilder(); + + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+   * to update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask paths include `product_labels`, `display_name` and
+   * `description`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+   * to update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask paths include `product_labels`, `display_name` and
+   * `description`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields
+   * to update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask paths include `product_labels`, `display_name` and
+   * `description`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductSetRequest.java new file mode 100644 index 000000000000..3fdc376a5e54 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductSetRequest.java @@ -0,0 +1,891 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Request message for the `UpdateProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.UpdateProductSetRequest} + */ +public final class UpdateProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.UpdateProductSetRequest) + UpdateProductSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateProductSetRequest.newBuilder() to construct. + private UpdateProductSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateProductSetRequest() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateProductSetRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.ProductSet.Builder subBuilder = null; + if (productSet_ != null) { + subBuilder = productSet_.toBuilder(); + } + productSet_ = input.readMessage(com.google.cloud.vision.v1p3beta1.ProductSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productSet_); + productSet_ = 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; + } + } + } + } 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.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest.class, com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest.Builder.class); + } + + public static final int PRODUCT_SET_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.ProductSet productSet_; + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public boolean hasProductSet() { + return productSet_ != null; + } + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet getProductSet() { + return productSet_ == null ? com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance() : productSet_; + } + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetOrBuilder() { + return getProductSet(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+   * update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask path is `display_name`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+   * update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask path is `display_name`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+   * update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask path is `display_name`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (productSet_ != null) { + output.writeMessage(1, getProductSet()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (productSet_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProductSet()); + } + 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.vision.v1p3beta1.UpdateProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest other = (com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest) obj; + + boolean result = true; + result = result && (hasProductSet() == other.hasProductSet()); + if (hasProductSet()) { + result = result && getProductSet() + .equals(other.getProductSet()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProductSet()) { + hash = (37 * hash) + PRODUCT_SET_FIELD_NUMBER; + hash = (53 * hash) + getProductSet().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.vision.v1p3beta1.UpdateProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest 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.vision.v1p3beta1.UpdateProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest 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.vision.v1p3beta1.UpdateProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest 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.vision.v1p3beta1.UpdateProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest 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.vision.v1p3beta1.UpdateProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for the `UpdateProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.UpdateProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.UpdateProductSetRequest) + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest.class, com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (productSetBuilder_ == null) { + productSet_ = null; + } else { + productSet_ = null; + productSetBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1p3beta1_UpdateProductSetRequest_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest build() { + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest buildPartial() { + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest result = new com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest(this); + if (productSetBuilder_ == null) { + result.productSet_ = productSet_; + } else { + result.productSet_ = productSetBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest other) { + if (other == com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest.getDefaultInstance()) return this; + if (other.hasProductSet()) { + mergeProductSet(other.getProductSet()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p3beta1.ProductSet productSet_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder> productSetBuilder_; + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public boolean hasProductSet() { + return productSetBuilder_ != null || productSet_ != null; + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet getProductSet() { + if (productSetBuilder_ == null) { + return productSet_ == null ? com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance() : productSet_; + } else { + return productSetBuilder_.getMessage(); + } + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public Builder setProductSet(com.google.cloud.vision.v1p3beta1.ProductSet value) { + if (productSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productSet_ = value; + onChanged(); + } else { + productSetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public Builder setProductSet( + com.google.cloud.vision.v1p3beta1.ProductSet.Builder builderForValue) { + if (productSetBuilder_ == null) { + productSet_ = builderForValue.build(); + onChanged(); + } else { + productSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public Builder mergeProductSet(com.google.cloud.vision.v1p3beta1.ProductSet value) { + if (productSetBuilder_ == null) { + if (productSet_ != null) { + productSet_ = + com.google.cloud.vision.v1p3beta1.ProductSet.newBuilder(productSet_).mergeFrom(value).buildPartial(); + } else { + productSet_ = value; + } + onChanged(); + } else { + productSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public Builder clearProductSet() { + if (productSetBuilder_ == null) { + productSet_ = null; + onChanged(); + } else { + productSet_ = null; + productSetBuilder_ = null; + } + + return this; + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSet.Builder getProductSetBuilder() { + + onChanged(); + return getProductSetFieldBuilder().getBuilder(); + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetOrBuilder() { + if (productSetBuilder_ != null) { + return productSetBuilder_.getMessageOrBuilder(); + } else { + return productSet_ == null ? + com.google.cloud.vision.v1p3beta1.ProductSet.getDefaultInstance() : productSet_; + } + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder> + getProductSetFieldBuilder() { + if (productSetBuilder_ == null) { + productSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.ProductSet, com.google.cloud.vision.v1p3beta1.ProductSet.Builder, com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder>( + getProductSet(), + getParentForChildren(), + isClean()); + productSet_ = null; + } + return productSetBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .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(); + } + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .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; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .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; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .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; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .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_; + } + } + /** + *
+     * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+     * update.
+     * If update_mask isn't specified, all mutable fields are to be updated.
+     * Valid mask path is `display_name`.
+     * 
+ * + * .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_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.UpdateProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.UpdateProductSetRequest) + private static final com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest(); + } + + public static com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public UpdateProductSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateProductSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..633aac0ed3cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/UpdateProductSetRequestOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/product_search_service.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface UpdateProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.UpdateProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + boolean hasProductSet(); + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductSet getProductSet(); + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.ProductSet product_set = 1; + */ + com.google.cloud.vision.v1p3beta1.ProductSetOrBuilder getProductSetOrBuilder(); + + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+   * update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask path is `display_name`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+   * update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask path is `display_name`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
+   * update.
+   * If update_mask isn't specified, all mutable fields are to be updated.
+   * Valid mask path is `display_name`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Vertex.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Vertex.java new file mode 100644 index 000000000000..ac6c7f58c8c5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Vertex.java @@ -0,0 +1,547 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A vertex represents a 2D point in the image.
+ * NOTE: the vertex coordinates are in the same scale as the original image.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Vertex} + */ +public final class Vertex extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Vertex) + VertexOrBuilder { +private static final long serialVersionUID = 0L; + // Use Vertex.newBuilder() to construct. + private Vertex(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Vertex() { + x_ = 0; + y_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Vertex( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + x_ = input.readInt32(); + break; + } + case 16: { + + y_ = input.readInt32(); + 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.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Vertex_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Vertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Vertex.class, com.google.cloud.vision.v1p3beta1.Vertex.Builder.class); + } + + public static final int X_FIELD_NUMBER = 1; + private int x_; + /** + *
+   * X coordinate.
+   * 
+ * + * int32 x = 1; + */ + public int getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 2; + private int y_; + /** + *
+   * Y coordinate.
+   * 
+ * + * int32 y = 2; + */ + public int getY() { + return y_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (x_ != 0) { + output.writeInt32(1, x_); + } + if (y_ != 0) { + output.writeInt32(2, y_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (x_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, x_); + } + if (y_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, y_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.Vertex)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Vertex other = (com.google.cloud.vision.v1p3beta1.Vertex) obj; + + boolean result = true; + result = result && (getX() + == other.getX()); + result = result && (getY() + == other.getY()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + getX(); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + getY(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Vertex parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Vertex 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.vision.v1p3beta1.Vertex parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Vertex 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.vision.v1p3beta1.Vertex parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Vertex parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Vertex parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Vertex 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.vision.v1p3beta1.Vertex parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Vertex 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.vision.v1p3beta1.Vertex parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Vertex parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Vertex prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A vertex represents a 2D point in the image.
+   * NOTE: the vertex coordinates are in the same scale as the original image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Vertex} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Vertex) + com.google.cloud.vision.v1p3beta1.VertexOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Vertex_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Vertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Vertex.class, com.google.cloud.vision.v1p3beta1.Vertex.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Vertex.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + x_ = 0; + + y_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.GeometryProto.internal_static_google_cloud_vision_v1p3beta1_Vertex_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Vertex getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Vertex.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Vertex build() { + com.google.cloud.vision.v1p3beta1.Vertex result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Vertex buildPartial() { + com.google.cloud.vision.v1p3beta1.Vertex result = new com.google.cloud.vision.v1p3beta1.Vertex(this); + result.x_ = x_; + result.y_ = y_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Vertex) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Vertex)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Vertex other) { + if (other == com.google.cloud.vision.v1p3beta1.Vertex.getDefaultInstance()) return this; + if (other.getX() != 0) { + setX(other.getX()); + } + if (other.getY() != 0) { + setY(other.getY()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Vertex parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Vertex) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int x_ ; + /** + *
+     * X coordinate.
+     * 
+ * + * int32 x = 1; + */ + public int getX() { + return x_; + } + /** + *
+     * X coordinate.
+     * 
+ * + * int32 x = 1; + */ + public Builder setX(int value) { + + x_ = value; + onChanged(); + return this; + } + /** + *
+     * X coordinate.
+     * 
+ * + * int32 x = 1; + */ + public Builder clearX() { + + x_ = 0; + onChanged(); + return this; + } + + private int y_ ; + /** + *
+     * Y coordinate.
+     * 
+ * + * int32 y = 2; + */ + public int getY() { + return y_; + } + /** + *
+     * Y coordinate.
+     * 
+ * + * int32 y = 2; + */ + public Builder setY(int value) { + + y_ = value; + onChanged(); + return this; + } + /** + *
+     * Y coordinate.
+     * 
+ * + * int32 y = 2; + */ + public Builder clearY() { + + y_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Vertex) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Vertex) + private static final com.google.cloud.vision.v1p3beta1.Vertex DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Vertex(); + } + + public static com.google.cloud.vision.v1p3beta1.Vertex getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Vertex parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Vertex(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Vertex getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/VertexOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/VertexOrBuilder.java new file mode 100644 index 000000000000..7ffaa71531e1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/VertexOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/geometry.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface VertexOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Vertex) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * X coordinate.
+   * 
+ * + * int32 x = 1; + */ + int getX(); + + /** + *
+   * Y coordinate.
+   * 
+ * + * int32 y = 2; + */ + int getY(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetection.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetection.java new file mode 100644 index 000000000000..f958d53ee901 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetection.java @@ -0,0 +1,7229 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/web_detection.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Relevant information for the image from the Internet.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection} + */ +public final class WebDetection extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.WebDetection) + WebDetectionOrBuilder { +private static final long serialVersionUID = 0L; + // Use WebDetection.newBuilder() to construct. + private WebDetection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebDetection() { + webEntities_ = java.util.Collections.emptyList(); + fullMatchingImages_ = java.util.Collections.emptyList(); + partialMatchingImages_ = java.util.Collections.emptyList(); + pagesWithMatchingImages_ = java.util.Collections.emptyList(); + visuallySimilarImages_ = java.util.Collections.emptyList(); + bestGuessLabels_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WebDetection( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + webEntities_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + webEntities_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.parser(), extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + fullMatchingImages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + fullMatchingImages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + partialMatchingImages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + partialMatchingImages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + pagesWithMatchingImages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + pagesWithMatchingImages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.parser(), extensionRegistry)); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + visuallySimilarImages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + visuallySimilarImages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.parser(), extensionRegistry)); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + bestGuessLabels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + bestGuessLabels_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.parser(), extensionRegistry)); + 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) == 0x00000001)) { + webEntities_ = java.util.Collections.unmodifiableList(webEntities_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + fullMatchingImages_ = java.util.Collections.unmodifiableList(fullMatchingImages_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + partialMatchingImages_ = java.util.Collections.unmodifiableList(partialMatchingImages_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + pagesWithMatchingImages_ = java.util.Collections.unmodifiableList(pagesWithMatchingImages_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + visuallySimilarImages_ = java.util.Collections.unmodifiableList(visuallySimilarImages_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + bestGuessLabels_ = java.util.Collections.unmodifiableList(bestGuessLabels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.class, com.google.cloud.vision.v1p3beta1.WebDetection.Builder.class); + } + + public interface WebEntityOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.WebDetection.WebEntity) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Opaque entity ID.
+     * 
+ * + * string entity_id = 1; + */ + java.lang.String getEntityId(); + /** + *
+     * Opaque entity ID.
+     * 
+ * + * string entity_id = 1; + */ + com.google.protobuf.ByteString + getEntityIdBytes(); + + /** + *
+     * Overall relevancy score for the entity.
+     * Not normalized and not comparable across different image queries.
+     * 
+ * + * float score = 2; + */ + float getScore(); + + /** + *
+     * Canonical description of the entity, in English.
+     * 
+ * + * string description = 3; + */ + java.lang.String getDescription(); + /** + *
+     * Canonical description of the entity, in English.
+     * 
+ * + * string description = 3; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + } + /** + *
+   * Entity deduced from similar images on the Internet.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection.WebEntity} + */ + public static final class WebEntity extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.WebDetection.WebEntity) + WebEntityOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebEntity.newBuilder() to construct. + private WebEntity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebEntity() { + entityId_ = ""; + score_ = 0F; + description_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WebEntity( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + entityId_ = s; + break; + } + case 21: { + + score_ = input.readFloat(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + 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.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.class, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder.class); + } + + public static final int ENTITY_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object entityId_; + /** + *
+     * Opaque entity ID.
+     * 
+ * + * string entity_id = 1; + */ + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + 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(); + entityId_ = s; + return s; + } + } + /** + *
+     * Opaque entity ID.
+     * 
+ * + * string entity_id = 1; + */ + public com.google.protobuf.ByteString + getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCORE_FIELD_NUMBER = 2; + private float score_; + /** + *
+     * Overall relevancy score for the entity.
+     * Not normalized and not comparable across different image queries.
+     * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + *
+     * Canonical description of the entity, in English.
+     * 
+ * + * 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; + } + } + /** + *
+     * Canonical description of the entity, in English.
+     * 
+ * + * 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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getEntityIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, entityId_); + } + if (score_ != 0F) { + output.writeFloat(2, score_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEntityIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, entityId_); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, score_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + 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.vision.v1p3beta1.WebDetection.WebEntity)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity other = (com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity) obj; + + boolean result = true; + result = result && getEntityId() + .equals(other.getEntityId()); + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && getDescription() + .equals(other.getDescription()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENTITY_ID_FIELD_NUMBER; + hash = (53 * hash) + getEntityId().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity 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.vision.v1p3beta1.WebDetection.WebEntity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity 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.vision.v1p3beta1.WebDetection.WebEntity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity 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.vision.v1p3beta1.WebDetection.WebEntity parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity 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.vision.v1p3beta1.WebDetection.WebEntity parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+     * Entity deduced from similar images on the Internet.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection.WebEntity} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.WebDetection.WebEntity) + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.class, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + entityId_ = ""; + + score_ = 0F; + + description_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity build() { + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity buildPartial() { + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity result = new com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity(this); + result.entityId_ = entityId_; + result.score_ = score_; + result.description_ = description_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity other) { + if (other == com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.getDefaultInstance()) return this; + if (!other.getEntityId().isEmpty()) { + entityId_ = other.entityId_; + onChanged(); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object entityId_ = ""; + /** + *
+       * Opaque entity ID.
+       * 
+ * + * string entity_id = 1; + */ + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Opaque entity ID.
+       * 
+ * + * string entity_id = 1; + */ + public com.google.protobuf.ByteString + getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Opaque entity ID.
+       * 
+ * + * string entity_id = 1; + */ + public Builder setEntityId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityId_ = value; + onChanged(); + return this; + } + /** + *
+       * Opaque entity ID.
+       * 
+ * + * string entity_id = 1; + */ + public Builder clearEntityId() { + + entityId_ = getDefaultInstance().getEntityId(); + onChanged(); + return this; + } + /** + *
+       * Opaque entity ID.
+       * 
+ * + * string entity_id = 1; + */ + public Builder setEntityIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityId_ = value; + onChanged(); + return this; + } + + private float score_ ; + /** + *
+       * Overall relevancy score for the entity.
+       * Not normalized and not comparable across different image queries.
+       * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + /** + *
+       * Overall relevancy score for the entity.
+       * Not normalized and not comparable across different image queries.
+       * 
+ * + * float score = 2; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+       * Overall relevancy score for the entity.
+       * Not normalized and not comparable across different image queries.
+       * 
+ * + * float score = 2; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+       * Canonical description of the entity, in English.
+       * 
+ * + * 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; + } + } + /** + *
+       * Canonical description of the entity, in English.
+       * 
+ * + * 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; + } + } + /** + *
+       * Canonical description of the entity, in English.
+       * 
+ * + * string description = 3; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+       * Canonical description of the entity, in English.
+       * 
+ * + * string description = 3; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+       * Canonical description of the entity, in English.
+       * 
+ * + * string description = 3; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.WebDetection.WebEntity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection.WebEntity) + private static final com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity(); + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WebEntity parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebEntity(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface WebImageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.WebDetection.WebImage) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The result image URL.
+     * 
+ * + * string url = 1; + */ + java.lang.String getUrl(); + /** + *
+     * The result image URL.
+     * 
+ * + * string url = 1; + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+     * (Deprecated) Overall relevancy score for the image.
+     * 
+ * + * float score = 2; + */ + float getScore(); + } + /** + *
+   * Metadata for online images.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection.WebImage} + */ + public static final class WebImage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.WebDetection.WebImage) + WebImageOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebImage.newBuilder() to construct. + private WebImage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebImage() { + url_ = ""; + score_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WebImage( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 21: { + + score_ = input.readFloat(); + 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.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.class, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + private volatile java.lang.Object url_; + /** + *
+     * The result image URL.
+     * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + 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(); + url_ = s; + return s; + } + } + /** + *
+     * The result image URL.
+     * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCORE_FIELD_NUMBER = 2; + private float score_; + /** + *
+     * (Deprecated) Overall relevancy score for the image.
+     * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + if (score_ != 0F) { + output.writeFloat(2, score_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, score_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.WebDetection.WebImage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage other = (com.google.cloud.vision.v1p3beta1.WebDetection.WebImage) obj; + + boolean result = true; + result = result && getUrl() + .equals(other.getUrl()); + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage 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.vision.v1p3beta1.WebDetection.WebImage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage 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.vision.v1p3beta1.WebDetection.WebImage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage 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.vision.v1p3beta1.WebDetection.WebImage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage 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.vision.v1p3beta1.WebDetection.WebImage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 for online images.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection.WebImage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.WebDetection.WebImage) + com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.class, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + url_ = ""; + + score_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage build() { + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage buildPartial() { + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage result = new com.google.cloud.vision.v1p3beta1.WebDetection.WebImage(this); + result.url_ = url_; + result.score_ = score_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.WebDetection.WebImage) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.WebDetection.WebImage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage other) { + if (other == com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.WebDetection.WebImage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object url_ = ""; + /** + *
+       * The result image URL.
+       * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The result image URL.
+       * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The result image URL.
+       * 
+ * + * string url = 1; + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + *
+       * The result image URL.
+       * 
+ * + * string url = 1; + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + *
+       * The result image URL.
+       * 
+ * + * string url = 1; + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + private float score_ ; + /** + *
+       * (Deprecated) Overall relevancy score for the image.
+       * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + /** + *
+       * (Deprecated) Overall relevancy score for the image.
+       * 
+ * + * float score = 2; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+       * (Deprecated) Overall relevancy score for the image.
+       * 
+ * + * float score = 2; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.WebDetection.WebImage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection.WebImage) + private static final com.google.cloud.vision.v1p3beta1.WebDetection.WebImage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.WebDetection.WebImage(); + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WebImage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebImage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface WebPageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.WebDetection.WebPage) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The result web page URL.
+     * 
+ * + * string url = 1; + */ + java.lang.String getUrl(); + /** + *
+     * The result web page URL.
+     * 
+ * + * string url = 1; + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+     * (Deprecated) Overall relevancy score for the web page.
+     * 
+ * + * float score = 2; + */ + float getScore(); + + /** + *
+     * Title for the web page, may contain HTML markups.
+     * 
+ * + * string page_title = 3; + */ + java.lang.String getPageTitle(); + /** + *
+     * Title for the web page, may contain HTML markups.
+     * 
+ * + * string page_title = 3; + */ + com.google.protobuf.ByteString + getPageTitleBytes(); + + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + java.util.List + getFullMatchingImagesList(); + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getFullMatchingImages(int index); + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + int getFullMatchingImagesCount(); + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + java.util.List + getFullMatchingImagesOrBuilderList(); + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getFullMatchingImagesOrBuilder( + int index); + + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + java.util.List + getPartialMatchingImagesList(); + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getPartialMatchingImages(int index); + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + int getPartialMatchingImagesCount(); + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + java.util.List + getPartialMatchingImagesOrBuilderList(); + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getPartialMatchingImagesOrBuilder( + int index); + } + /** + *
+   * Metadata for web pages.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection.WebPage} + */ + public static final class WebPage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.WebDetection.WebPage) + WebPageOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebPage.newBuilder() to construct. + private WebPage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebPage() { + url_ = ""; + score_ = 0F; + pageTitle_ = ""; + fullMatchingImages_ = java.util.Collections.emptyList(); + partialMatchingImages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WebPage( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 21: { + + score_ = input.readFloat(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageTitle_ = s; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + fullMatchingImages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + fullMatchingImages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.parser(), extensionRegistry)); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + partialMatchingImages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + partialMatchingImages_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.parser(), extensionRegistry)); + 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) == 0x00000008)) { + fullMatchingImages_ = java.util.Collections.unmodifiableList(fullMatchingImages_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + partialMatchingImages_ = java.util.Collections.unmodifiableList(partialMatchingImages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.class, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder.class); + } + + private int bitField0_; + public static final int URL_FIELD_NUMBER = 1; + private volatile java.lang.Object url_; + /** + *
+     * The result web page URL.
+     * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + 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(); + url_ = s; + return s; + } + } + /** + *
+     * The result web page URL.
+     * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCORE_FIELD_NUMBER = 2; + private float score_; + /** + *
+     * (Deprecated) Overall relevancy score for the web page.
+     * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + + public static final int PAGE_TITLE_FIELD_NUMBER = 3; + private volatile java.lang.Object pageTitle_; + /** + *
+     * Title for the web page, may contain HTML markups.
+     * 
+ * + * string page_title = 3; + */ + public java.lang.String getPageTitle() { + java.lang.Object ref = pageTitle_; + 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(); + pageTitle_ = s; + return s; + } + } + /** + *
+     * Title for the web page, may contain HTML markups.
+     * 
+ * + * string page_title = 3; + */ + public com.google.protobuf.ByteString + getPageTitleBytes() { + java.lang.Object ref = pageTitle_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageTitle_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FULL_MATCHING_IMAGES_FIELD_NUMBER = 4; + private java.util.List fullMatchingImages_; + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public java.util.List getFullMatchingImagesList() { + return fullMatchingImages_; + } + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public java.util.List + getFullMatchingImagesOrBuilderList() { + return fullMatchingImages_; + } + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public int getFullMatchingImagesCount() { + return fullMatchingImages_.size(); + } + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getFullMatchingImages(int index) { + return fullMatchingImages_.get(index); + } + /** + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getFullMatchingImagesOrBuilder( + int index) { + return fullMatchingImages_.get(index); + } + + public static final int PARTIAL_MATCHING_IMAGES_FIELD_NUMBER = 5; + private java.util.List partialMatchingImages_; + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public java.util.List getPartialMatchingImagesList() { + return partialMatchingImages_; + } + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public java.util.List + getPartialMatchingImagesOrBuilderList() { + return partialMatchingImages_; + } + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public int getPartialMatchingImagesCount() { + return partialMatchingImages_.size(); + } + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getPartialMatchingImages(int index) { + return partialMatchingImages_.get(index); + } + /** + *
+     * Partial matching images on the page.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its
+     * crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getPartialMatchingImagesOrBuilder( + int index) { + return partialMatchingImages_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + if (score_ != 0F) { + output.writeFloat(2, score_); + } + if (!getPageTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageTitle_); + } + for (int i = 0; i < fullMatchingImages_.size(); i++) { + output.writeMessage(4, fullMatchingImages_.get(i)); + } + for (int i = 0; i < partialMatchingImages_.size(); i++) { + output.writeMessage(5, partialMatchingImages_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, score_); + } + if (!getPageTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageTitle_); + } + for (int i = 0; i < fullMatchingImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, fullMatchingImages_.get(i)); + } + for (int i = 0; i < partialMatchingImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, partialMatchingImages_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.WebDetection.WebPage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage other = (com.google.cloud.vision.v1p3beta1.WebDetection.WebPage) obj; + + boolean result = true; + result = result && getUrl() + .equals(other.getUrl()); + result = result && ( + java.lang.Float.floatToIntBits(getScore()) + == java.lang.Float.floatToIntBits( + other.getScore())); + result = result && getPageTitle() + .equals(other.getPageTitle()); + result = result && getFullMatchingImagesList() + .equals(other.getFullMatchingImagesList()); + result = result && getPartialMatchingImagesList() + .equals(other.getPartialMatchingImagesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScore()); + hash = (37 * hash) + PAGE_TITLE_FIELD_NUMBER; + hash = (53 * hash) + getPageTitle().hashCode(); + if (getFullMatchingImagesCount() > 0) { + hash = (37 * hash) + FULL_MATCHING_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getFullMatchingImagesList().hashCode(); + } + if (getPartialMatchingImagesCount() > 0) { + hash = (37 * hash) + PARTIAL_MATCHING_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getPartialMatchingImagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage 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.vision.v1p3beta1.WebDetection.WebPage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage 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.vision.v1p3beta1.WebDetection.WebPage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage 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.vision.v1p3beta1.WebDetection.WebPage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage 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.vision.v1p3beta1.WebDetection.WebPage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.WebDetection.WebPage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 for web pages.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection.WebPage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.WebDetection.WebPage) + com.google.cloud.vision.v1p3beta1.WebDetection.WebPageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.class, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFullMatchingImagesFieldBuilder(); + getPartialMatchingImagesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + url_ = ""; + + score_ = 0F; + + pageTitle_ = ""; + + if (fullMatchingImagesBuilder_ == null) { + fullMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + fullMatchingImagesBuilder_.clear(); + } + if (partialMatchingImagesBuilder_ == null) { + partialMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + partialMatchingImagesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage build() { + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage buildPartial() { + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage result = new com.google.cloud.vision.v1p3beta1.WebDetection.WebPage(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.url_ = url_; + result.score_ = score_; + result.pageTitle_ = pageTitle_; + if (fullMatchingImagesBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + fullMatchingImages_ = java.util.Collections.unmodifiableList(fullMatchingImages_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.fullMatchingImages_ = fullMatchingImages_; + } else { + result.fullMatchingImages_ = fullMatchingImagesBuilder_.build(); + } + if (partialMatchingImagesBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + partialMatchingImages_ = java.util.Collections.unmodifiableList(partialMatchingImages_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.partialMatchingImages_ = partialMatchingImages_; + } else { + result.partialMatchingImages_ = partialMatchingImagesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.WebDetection.WebPage) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.WebDetection.WebPage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.WebDetection.WebPage other) { + if (other == com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + if (!other.getPageTitle().isEmpty()) { + pageTitle_ = other.pageTitle_; + onChanged(); + } + if (fullMatchingImagesBuilder_ == null) { + if (!other.fullMatchingImages_.isEmpty()) { + if (fullMatchingImages_.isEmpty()) { + fullMatchingImages_ = other.fullMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.addAll(other.fullMatchingImages_); + } + onChanged(); + } + } else { + if (!other.fullMatchingImages_.isEmpty()) { + if (fullMatchingImagesBuilder_.isEmpty()) { + fullMatchingImagesBuilder_.dispose(); + fullMatchingImagesBuilder_ = null; + fullMatchingImages_ = other.fullMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000008); + fullMatchingImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFullMatchingImagesFieldBuilder() : null; + } else { + fullMatchingImagesBuilder_.addAllMessages(other.fullMatchingImages_); + } + } + } + if (partialMatchingImagesBuilder_ == null) { + if (!other.partialMatchingImages_.isEmpty()) { + if (partialMatchingImages_.isEmpty()) { + partialMatchingImages_ = other.partialMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.addAll(other.partialMatchingImages_); + } + onChanged(); + } + } else { + if (!other.partialMatchingImages_.isEmpty()) { + if (partialMatchingImagesBuilder_.isEmpty()) { + partialMatchingImagesBuilder_.dispose(); + partialMatchingImagesBuilder_ = null; + partialMatchingImages_ = other.partialMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000010); + partialMatchingImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPartialMatchingImagesFieldBuilder() : null; + } else { + partialMatchingImagesBuilder_.addAllMessages(other.partialMatchingImages_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.WebDetection.WebPage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object url_ = ""; + /** + *
+       * The result web page URL.
+       * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The result web page URL.
+       * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The result web page URL.
+       * 
+ * + * string url = 1; + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + *
+       * The result web page URL.
+       * 
+ * + * string url = 1; + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + *
+       * The result web page URL.
+       * 
+ * + * string url = 1; + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + private float score_ ; + /** + *
+       * (Deprecated) Overall relevancy score for the web page.
+       * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + /** + *
+       * (Deprecated) Overall relevancy score for the web page.
+       * 
+ * + * float score = 2; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + *
+       * (Deprecated) Overall relevancy score for the web page.
+       * 
+ * + * float score = 2; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object pageTitle_ = ""; + /** + *
+       * Title for the web page, may contain HTML markups.
+       * 
+ * + * string page_title = 3; + */ + public java.lang.String getPageTitle() { + java.lang.Object ref = pageTitle_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageTitle_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Title for the web page, may contain HTML markups.
+       * 
+ * + * string page_title = 3; + */ + public com.google.protobuf.ByteString + getPageTitleBytes() { + java.lang.Object ref = pageTitle_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageTitle_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Title for the web page, may contain HTML markups.
+       * 
+ * + * string page_title = 3; + */ + public Builder setPageTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageTitle_ = value; + onChanged(); + return this; + } + /** + *
+       * Title for the web page, may contain HTML markups.
+       * 
+ * + * string page_title = 3; + */ + public Builder clearPageTitle() { + + pageTitle_ = getDefaultInstance().getPageTitle(); + onChanged(); + return this; + } + /** + *
+       * Title for the web page, may contain HTML markups.
+       * 
+ * + * string page_title = 3; + */ + public Builder setPageTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageTitle_ = value; + onChanged(); + return this; + } + + private java.util.List fullMatchingImages_ = + java.util.Collections.emptyList(); + private void ensureFullMatchingImagesIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + fullMatchingImages_ = new java.util.ArrayList(fullMatchingImages_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> fullMatchingImagesBuilder_; + + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public java.util.List getFullMatchingImagesList() { + if (fullMatchingImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(fullMatchingImages_); + } else { + return fullMatchingImagesBuilder_.getMessageList(); + } + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public int getFullMatchingImagesCount() { + if (fullMatchingImagesBuilder_ == null) { + return fullMatchingImages_.size(); + } else { + return fullMatchingImagesBuilder_.getCount(); + } + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getFullMatchingImages(int index) { + if (fullMatchingImagesBuilder_ == null) { + return fullMatchingImages_.get(index); + } else { + return fullMatchingImagesBuilder_.getMessage(index); + } + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder setFullMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (fullMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.set(index, value); + onChanged(); + } else { + fullMatchingImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder setFullMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.set(index, builderForValue.build()); + onChanged(); + } else { + fullMatchingImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder addFullMatchingImages(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (fullMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.add(value); + onChanged(); + } else { + fullMatchingImagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder addFullMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (fullMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.add(index, value); + onChanged(); + } else { + fullMatchingImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder addFullMatchingImages( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.add(builderForValue.build()); + onChanged(); + } else { + fullMatchingImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder addFullMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.add(index, builderForValue.build()); + onChanged(); + } else { + fullMatchingImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder addAllFullMatchingImages( + java.lang.Iterable values) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fullMatchingImages_); + onChanged(); + } else { + fullMatchingImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder clearFullMatchingImages() { + if (fullMatchingImagesBuilder_ == null) { + fullMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + fullMatchingImagesBuilder_.clear(); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public Builder removeFullMatchingImages(int index) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.remove(index); + onChanged(); + } else { + fullMatchingImagesBuilder_.remove(index); + } + return this; + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder getFullMatchingImagesBuilder( + int index) { + return getFullMatchingImagesFieldBuilder().getBuilder(index); + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getFullMatchingImagesOrBuilder( + int index) { + if (fullMatchingImagesBuilder_ == null) { + return fullMatchingImages_.get(index); } else { + return fullMatchingImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public java.util.List + getFullMatchingImagesOrBuilderList() { + if (fullMatchingImagesBuilder_ != null) { + return fullMatchingImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fullMatchingImages_); + } + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addFullMatchingImagesBuilder() { + return getFullMatchingImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addFullMatchingImagesBuilder( + int index) { + return getFullMatchingImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 4; + */ + public java.util.List + getFullMatchingImagesBuilderList() { + return getFullMatchingImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> + getFullMatchingImagesFieldBuilder() { + if (fullMatchingImagesBuilder_ == null) { + fullMatchingImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder>( + fullMatchingImages_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + fullMatchingImages_ = null; + } + return fullMatchingImagesBuilder_; + } + + private java.util.List partialMatchingImages_ = + java.util.Collections.emptyList(); + private void ensurePartialMatchingImagesIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + partialMatchingImages_ = new java.util.ArrayList(partialMatchingImages_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> partialMatchingImagesBuilder_; + + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public java.util.List getPartialMatchingImagesList() { + if (partialMatchingImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(partialMatchingImages_); + } else { + return partialMatchingImagesBuilder_.getMessageList(); + } + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public int getPartialMatchingImagesCount() { + if (partialMatchingImagesBuilder_ == null) { + return partialMatchingImages_.size(); + } else { + return partialMatchingImagesBuilder_.getCount(); + } + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getPartialMatchingImages(int index) { + if (partialMatchingImagesBuilder_ == null) { + return partialMatchingImages_.get(index); + } else { + return partialMatchingImagesBuilder_.getMessage(index); + } + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder setPartialMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (partialMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.set(index, value); + onChanged(); + } else { + partialMatchingImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder setPartialMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.set(index, builderForValue.build()); + onChanged(); + } else { + partialMatchingImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder addPartialMatchingImages(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (partialMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.add(value); + onChanged(); + } else { + partialMatchingImagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder addPartialMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (partialMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.add(index, value); + onChanged(); + } else { + partialMatchingImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder addPartialMatchingImages( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.add(builderForValue.build()); + onChanged(); + } else { + partialMatchingImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder addPartialMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.add(index, builderForValue.build()); + onChanged(); + } else { + partialMatchingImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder addAllPartialMatchingImages( + java.lang.Iterable values) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, partialMatchingImages_); + onChanged(); + } else { + partialMatchingImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder clearPartialMatchingImages() { + if (partialMatchingImagesBuilder_ == null) { + partialMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + partialMatchingImagesBuilder_.clear(); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public Builder removePartialMatchingImages(int index) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.remove(index); + onChanged(); + } else { + partialMatchingImagesBuilder_.remove(index); + } + return this; + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder getPartialMatchingImagesBuilder( + int index) { + return getPartialMatchingImagesFieldBuilder().getBuilder(index); + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getPartialMatchingImagesOrBuilder( + int index) { + if (partialMatchingImagesBuilder_ == null) { + return partialMatchingImages_.get(index); } else { + return partialMatchingImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public java.util.List + getPartialMatchingImagesOrBuilderList() { + if (partialMatchingImagesBuilder_ != null) { + return partialMatchingImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(partialMatchingImages_); + } + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addPartialMatchingImagesBuilder() { + return getPartialMatchingImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addPartialMatchingImagesBuilder( + int index) { + return getPartialMatchingImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+       * Partial matching images on the page.
+       * Those images are similar enough to share some key-point features. For
+       * example an original image will likely have partial matching for its
+       * crops.
+       * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 5; + */ + public java.util.List + getPartialMatchingImagesBuilderList() { + return getPartialMatchingImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> + getPartialMatchingImagesFieldBuilder() { + if (partialMatchingImagesBuilder_ == null) { + partialMatchingImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder>( + partialMatchingImages_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + partialMatchingImages_ = null; + } + return partialMatchingImagesBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.WebDetection.WebPage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection.WebPage) + private static final com.google.cloud.vision.v1p3beta1.WebDetection.WebPage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.WebDetection.WebPage(); + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebPage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WebPage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebPage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface WebLabelOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.WebDetection.WebLabel) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Label for extra metadata.
+     * 
+ * + * string label = 1; + */ + java.lang.String getLabel(); + /** + *
+     * Label for extra metadata.
+     * 
+ * + * string label = 1; + */ + com.google.protobuf.ByteString + getLabelBytes(); + + /** + *
+     * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + java.lang.String getLanguageCode(); + /** + *
+     * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); + } + /** + *
+   * Label to provide extra metadata for the web detection.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection.WebLabel} + */ + public static final class WebLabel extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.WebDetection.WebLabel) + WebLabelOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebLabel.newBuilder() to construct. + private WebLabel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebLabel() { + label_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WebLabel( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + 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.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.class, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder.class); + } + + public static final int LABEL_FIELD_NUMBER = 1; + private volatile java.lang.Object label_; + /** + *
+     * Label for extra metadata.
+     * 
+ * + * string label = 1; + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + 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(); + label_ = s; + return s; + } + } + /** + *
+     * Label for extra metadata.
+     * 
+ * + * string label = 1; + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + *
+     * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + *
+     * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, label_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, label_); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + 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.vision.v1p3beta1.WebDetection.WebLabel)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel other = (com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel) obj; + + boolean result = true; + result = result && getLabel() + .equals(other.getLabel()); + result = result && getLanguageCode() + .equals(other.getLanguageCode()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel 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.vision.v1p3beta1.WebDetection.WebLabel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel 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.vision.v1p3beta1.WebDetection.WebLabel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel 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.vision.v1p3beta1.WebDetection.WebLabel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel 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.vision.v1p3beta1.WebDetection.WebLabel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+     * Label to provide extra metadata for the web detection.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection.WebLabel} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.WebDetection.WebLabel) + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.class, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + label_ = ""; + + languageCode_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel build() { + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel buildPartial() { + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel result = new com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel(this); + result.label_ = label_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel other) { + if (other == com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.getDefaultInstance()) return this; + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object label_ = ""; + /** + *
+       * Label for extra metadata.
+       * 
+ * + * string label = 1; + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Label for extra metadata.
+       * 
+ * + * string label = 1; + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Label for extra metadata.
+       * 
+ * + * string label = 1; + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + *
+       * Label for extra metadata.
+       * 
+ * + * string label = 1; + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + *
+       * Label for extra metadata.
+       * 
+ * + * string label = 1; + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+       * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+       * For more information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 2; + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+       * For more information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 2; + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+       * For more information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 2; + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+       * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+       * For more information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 2; + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+       * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
+       * For more information, see
+       * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+       * 
+ * + * string language_code = 2; + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.WebDetection.WebLabel) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection.WebLabel) + private static final com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel(); + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WebLabel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebLabel(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int WEB_ENTITIES_FIELD_NUMBER = 1; + private java.util.List webEntities_; + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List getWebEntitiesList() { + return webEntities_; + } + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List + getWebEntitiesOrBuilderList() { + return webEntities_; + } + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public int getWebEntitiesCount() { + return webEntities_.size(); + } + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity getWebEntities(int index) { + return webEntities_.get(index); + } + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntityOrBuilder getWebEntitiesOrBuilder( + int index) { + return webEntities_.get(index); + } + + public static final int FULL_MATCHING_IMAGES_FIELD_NUMBER = 2; + private java.util.List fullMatchingImages_; + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public java.util.List getFullMatchingImagesList() { + return fullMatchingImages_; + } + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public java.util.List + getFullMatchingImagesOrBuilderList() { + return fullMatchingImages_; + } + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public int getFullMatchingImagesCount() { + return fullMatchingImages_.size(); + } + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getFullMatchingImages(int index) { + return fullMatchingImages_.get(index); + } + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getFullMatchingImagesOrBuilder( + int index) { + return fullMatchingImages_.get(index); + } + + public static final int PARTIAL_MATCHING_IMAGES_FIELD_NUMBER = 3; + private java.util.List partialMatchingImages_; + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public java.util.List getPartialMatchingImagesList() { + return partialMatchingImages_; + } + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public java.util.List + getPartialMatchingImagesOrBuilderList() { + return partialMatchingImages_; + } + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public int getPartialMatchingImagesCount() { + return partialMatchingImages_.size(); + } + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getPartialMatchingImages(int index) { + return partialMatchingImages_.get(index); + } + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getPartialMatchingImagesOrBuilder( + int index) { + return partialMatchingImages_.get(index); + } + + public static final int PAGES_WITH_MATCHING_IMAGES_FIELD_NUMBER = 4; + private java.util.List pagesWithMatchingImages_; + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public java.util.List getPagesWithMatchingImagesList() { + return pagesWithMatchingImages_; + } + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public java.util.List + getPagesWithMatchingImagesOrBuilderList() { + return pagesWithMatchingImages_; + } + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public int getPagesWithMatchingImagesCount() { + return pagesWithMatchingImages_.size(); + } + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage getPagesWithMatchingImages(int index) { + return pagesWithMatchingImages_.get(index); + } + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPageOrBuilder getPagesWithMatchingImagesOrBuilder( + int index) { + return pagesWithMatchingImages_.get(index); + } + + public static final int VISUALLY_SIMILAR_IMAGES_FIELD_NUMBER = 6; + private java.util.List visuallySimilarImages_; + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public java.util.List getVisuallySimilarImagesList() { + return visuallySimilarImages_; + } + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public java.util.List + getVisuallySimilarImagesOrBuilderList() { + return visuallySimilarImages_; + } + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public int getVisuallySimilarImagesCount() { + return visuallySimilarImages_.size(); + } + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getVisuallySimilarImages(int index) { + return visuallySimilarImages_.get(index); + } + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getVisuallySimilarImagesOrBuilder( + int index) { + return visuallySimilarImages_.get(index); + } + + public static final int BEST_GUESS_LABELS_FIELD_NUMBER = 8; + private java.util.List bestGuessLabels_; + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public java.util.List getBestGuessLabelsList() { + return bestGuessLabels_; + } + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public java.util.List + getBestGuessLabelsOrBuilderList() { + return bestGuessLabels_; + } + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public int getBestGuessLabelsCount() { + return bestGuessLabels_.size(); + } + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel getBestGuessLabels(int index) { + return bestGuessLabels_.get(index); + } + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabelOrBuilder getBestGuessLabelsOrBuilder( + int index) { + return bestGuessLabels_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < webEntities_.size(); i++) { + output.writeMessage(1, webEntities_.get(i)); + } + for (int i = 0; i < fullMatchingImages_.size(); i++) { + output.writeMessage(2, fullMatchingImages_.get(i)); + } + for (int i = 0; i < partialMatchingImages_.size(); i++) { + output.writeMessage(3, partialMatchingImages_.get(i)); + } + for (int i = 0; i < pagesWithMatchingImages_.size(); i++) { + output.writeMessage(4, pagesWithMatchingImages_.get(i)); + } + for (int i = 0; i < visuallySimilarImages_.size(); i++) { + output.writeMessage(6, visuallySimilarImages_.get(i)); + } + for (int i = 0; i < bestGuessLabels_.size(); i++) { + output.writeMessage(8, bestGuessLabels_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < webEntities_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, webEntities_.get(i)); + } + for (int i = 0; i < fullMatchingImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, fullMatchingImages_.get(i)); + } + for (int i = 0; i < partialMatchingImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, partialMatchingImages_.get(i)); + } + for (int i = 0; i < pagesWithMatchingImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, pagesWithMatchingImages_.get(i)); + } + for (int i = 0; i < visuallySimilarImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, visuallySimilarImages_.get(i)); + } + for (int i = 0; i < bestGuessLabels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, bestGuessLabels_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p3beta1.WebDetection)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.WebDetection other = (com.google.cloud.vision.v1p3beta1.WebDetection) obj; + + boolean result = true; + result = result && getWebEntitiesList() + .equals(other.getWebEntitiesList()); + result = result && getFullMatchingImagesList() + .equals(other.getFullMatchingImagesList()); + result = result && getPartialMatchingImagesList() + .equals(other.getPartialMatchingImagesList()); + result = result && getPagesWithMatchingImagesList() + .equals(other.getPagesWithMatchingImagesList()); + result = result && getVisuallySimilarImagesList() + .equals(other.getVisuallySimilarImagesList()); + result = result && getBestGuessLabelsList() + .equals(other.getBestGuessLabelsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWebEntitiesCount() > 0) { + hash = (37 * hash) + WEB_ENTITIES_FIELD_NUMBER; + hash = (53 * hash) + getWebEntitiesList().hashCode(); + } + if (getFullMatchingImagesCount() > 0) { + hash = (37 * hash) + FULL_MATCHING_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getFullMatchingImagesList().hashCode(); + } + if (getPartialMatchingImagesCount() > 0) { + hash = (37 * hash) + PARTIAL_MATCHING_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getPartialMatchingImagesList().hashCode(); + } + if (getPagesWithMatchingImagesCount() > 0) { + hash = (37 * hash) + PAGES_WITH_MATCHING_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getPagesWithMatchingImagesList().hashCode(); + } + if (getVisuallySimilarImagesCount() > 0) { + hash = (37 * hash) + VISUALLY_SIMILAR_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getVisuallySimilarImagesList().hashCode(); + } + if (getBestGuessLabelsCount() > 0) { + hash = (37 * hash) + BEST_GUESS_LABELS_FIELD_NUMBER; + hash = (53 * hash) + getBestGuessLabelsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection 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.vision.v1p3beta1.WebDetection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection 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.vision.v1p3beta1.WebDetection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection 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.vision.v1p3beta1.WebDetection parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection 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.vision.v1p3beta1.WebDetection parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.WebDetection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Relevant information for the image from the Internet.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetection} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.WebDetection) + com.google.cloud.vision.v1p3beta1.WebDetectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetection.class, com.google.cloud.vision.v1p3beta1.WebDetection.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.WebDetection.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getWebEntitiesFieldBuilder(); + getFullMatchingImagesFieldBuilder(); + getPartialMatchingImagesFieldBuilder(); + getPagesWithMatchingImagesFieldBuilder(); + getVisuallySimilarImagesFieldBuilder(); + getBestGuessLabelsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (webEntitiesBuilder_ == null) { + webEntities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + webEntitiesBuilder_.clear(); + } + if (fullMatchingImagesBuilder_ == null) { + fullMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + fullMatchingImagesBuilder_.clear(); + } + if (partialMatchingImagesBuilder_ == null) { + partialMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + partialMatchingImagesBuilder_.clear(); + } + if (pagesWithMatchingImagesBuilder_ == null) { + pagesWithMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + pagesWithMatchingImagesBuilder_.clear(); + } + if (visuallySimilarImagesBuilder_ == null) { + visuallySimilarImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + visuallySimilarImagesBuilder_.clear(); + } + if (bestGuessLabelsBuilder_ == null) { + bestGuessLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + bestGuessLabelsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.WebDetectionProto.internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.WebDetection.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.WebDetection build() { + com.google.cloud.vision.v1p3beta1.WebDetection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection buildPartial() { + com.google.cloud.vision.v1p3beta1.WebDetection result = new com.google.cloud.vision.v1p3beta1.WebDetection(this); + int from_bitField0_ = bitField0_; + if (webEntitiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + webEntities_ = java.util.Collections.unmodifiableList(webEntities_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.webEntities_ = webEntities_; + } else { + result.webEntities_ = webEntitiesBuilder_.build(); + } + if (fullMatchingImagesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + fullMatchingImages_ = java.util.Collections.unmodifiableList(fullMatchingImages_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.fullMatchingImages_ = fullMatchingImages_; + } else { + result.fullMatchingImages_ = fullMatchingImagesBuilder_.build(); + } + if (partialMatchingImagesBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + partialMatchingImages_ = java.util.Collections.unmodifiableList(partialMatchingImages_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.partialMatchingImages_ = partialMatchingImages_; + } else { + result.partialMatchingImages_ = partialMatchingImagesBuilder_.build(); + } + if (pagesWithMatchingImagesBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + pagesWithMatchingImages_ = java.util.Collections.unmodifiableList(pagesWithMatchingImages_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.pagesWithMatchingImages_ = pagesWithMatchingImages_; + } else { + result.pagesWithMatchingImages_ = pagesWithMatchingImagesBuilder_.build(); + } + if (visuallySimilarImagesBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + visuallySimilarImages_ = java.util.Collections.unmodifiableList(visuallySimilarImages_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.visuallySimilarImages_ = visuallySimilarImages_; + } else { + result.visuallySimilarImages_ = visuallySimilarImagesBuilder_.build(); + } + if (bestGuessLabelsBuilder_ == null) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { + bestGuessLabels_ = java.util.Collections.unmodifiableList(bestGuessLabels_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.bestGuessLabels_ = bestGuessLabels_; + } else { + result.bestGuessLabels_ = bestGuessLabelsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.WebDetection) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.WebDetection)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.WebDetection other) { + if (other == com.google.cloud.vision.v1p3beta1.WebDetection.getDefaultInstance()) return this; + if (webEntitiesBuilder_ == null) { + if (!other.webEntities_.isEmpty()) { + if (webEntities_.isEmpty()) { + webEntities_ = other.webEntities_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWebEntitiesIsMutable(); + webEntities_.addAll(other.webEntities_); + } + onChanged(); + } + } else { + if (!other.webEntities_.isEmpty()) { + if (webEntitiesBuilder_.isEmpty()) { + webEntitiesBuilder_.dispose(); + webEntitiesBuilder_ = null; + webEntities_ = other.webEntities_; + bitField0_ = (bitField0_ & ~0x00000001); + webEntitiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getWebEntitiesFieldBuilder() : null; + } else { + webEntitiesBuilder_.addAllMessages(other.webEntities_); + } + } + } + if (fullMatchingImagesBuilder_ == null) { + if (!other.fullMatchingImages_.isEmpty()) { + if (fullMatchingImages_.isEmpty()) { + fullMatchingImages_ = other.fullMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.addAll(other.fullMatchingImages_); + } + onChanged(); + } + } else { + if (!other.fullMatchingImages_.isEmpty()) { + if (fullMatchingImagesBuilder_.isEmpty()) { + fullMatchingImagesBuilder_.dispose(); + fullMatchingImagesBuilder_ = null; + fullMatchingImages_ = other.fullMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000002); + fullMatchingImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFullMatchingImagesFieldBuilder() : null; + } else { + fullMatchingImagesBuilder_.addAllMessages(other.fullMatchingImages_); + } + } + } + if (partialMatchingImagesBuilder_ == null) { + if (!other.partialMatchingImages_.isEmpty()) { + if (partialMatchingImages_.isEmpty()) { + partialMatchingImages_ = other.partialMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.addAll(other.partialMatchingImages_); + } + onChanged(); + } + } else { + if (!other.partialMatchingImages_.isEmpty()) { + if (partialMatchingImagesBuilder_.isEmpty()) { + partialMatchingImagesBuilder_.dispose(); + partialMatchingImagesBuilder_ = null; + partialMatchingImages_ = other.partialMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000004); + partialMatchingImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPartialMatchingImagesFieldBuilder() : null; + } else { + partialMatchingImagesBuilder_.addAllMessages(other.partialMatchingImages_); + } + } + } + if (pagesWithMatchingImagesBuilder_ == null) { + if (!other.pagesWithMatchingImages_.isEmpty()) { + if (pagesWithMatchingImages_.isEmpty()) { + pagesWithMatchingImages_ = other.pagesWithMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePagesWithMatchingImagesIsMutable(); + pagesWithMatchingImages_.addAll(other.pagesWithMatchingImages_); + } + onChanged(); + } + } else { + if (!other.pagesWithMatchingImages_.isEmpty()) { + if (pagesWithMatchingImagesBuilder_.isEmpty()) { + pagesWithMatchingImagesBuilder_.dispose(); + pagesWithMatchingImagesBuilder_ = null; + pagesWithMatchingImages_ = other.pagesWithMatchingImages_; + bitField0_ = (bitField0_ & ~0x00000008); + pagesWithMatchingImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPagesWithMatchingImagesFieldBuilder() : null; + } else { + pagesWithMatchingImagesBuilder_.addAllMessages(other.pagesWithMatchingImages_); + } + } + } + if (visuallySimilarImagesBuilder_ == null) { + if (!other.visuallySimilarImages_.isEmpty()) { + if (visuallySimilarImages_.isEmpty()) { + visuallySimilarImages_ = other.visuallySimilarImages_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureVisuallySimilarImagesIsMutable(); + visuallySimilarImages_.addAll(other.visuallySimilarImages_); + } + onChanged(); + } + } else { + if (!other.visuallySimilarImages_.isEmpty()) { + if (visuallySimilarImagesBuilder_.isEmpty()) { + visuallySimilarImagesBuilder_.dispose(); + visuallySimilarImagesBuilder_ = null; + visuallySimilarImages_ = other.visuallySimilarImages_; + bitField0_ = (bitField0_ & ~0x00000010); + visuallySimilarImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getVisuallySimilarImagesFieldBuilder() : null; + } else { + visuallySimilarImagesBuilder_.addAllMessages(other.visuallySimilarImages_); + } + } + } + if (bestGuessLabelsBuilder_ == null) { + if (!other.bestGuessLabels_.isEmpty()) { + if (bestGuessLabels_.isEmpty()) { + bestGuessLabels_ = other.bestGuessLabels_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.addAll(other.bestGuessLabels_); + } + onChanged(); + } + } else { + if (!other.bestGuessLabels_.isEmpty()) { + if (bestGuessLabelsBuilder_.isEmpty()) { + bestGuessLabelsBuilder_.dispose(); + bestGuessLabelsBuilder_ = null; + bestGuessLabels_ = other.bestGuessLabels_; + bitField0_ = (bitField0_ & ~0x00000020); + bestGuessLabelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getBestGuessLabelsFieldBuilder() : null; + } else { + bestGuessLabelsBuilder_.addAllMessages(other.bestGuessLabels_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.WebDetection parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.WebDetection) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List webEntities_ = + java.util.Collections.emptyList(); + private void ensureWebEntitiesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + webEntities_ = new java.util.ArrayList(webEntities_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntityOrBuilder> webEntitiesBuilder_; + + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List getWebEntitiesList() { + if (webEntitiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(webEntities_); + } else { + return webEntitiesBuilder_.getMessageList(); + } + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public int getWebEntitiesCount() { + if (webEntitiesBuilder_ == null) { + return webEntities_.size(); + } else { + return webEntitiesBuilder_.getCount(); + } + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity getWebEntities(int index) { + if (webEntitiesBuilder_ == null) { + return webEntities_.get(index); + } else { + return webEntitiesBuilder_.getMessage(index); + } + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder setWebEntities( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity value) { + if (webEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebEntitiesIsMutable(); + webEntities_.set(index, value); + onChanged(); + } else { + webEntitiesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder setWebEntities( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder builderForValue) { + if (webEntitiesBuilder_ == null) { + ensureWebEntitiesIsMutable(); + webEntities_.set(index, builderForValue.build()); + onChanged(); + } else { + webEntitiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addWebEntities(com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity value) { + if (webEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebEntitiesIsMutable(); + webEntities_.add(value); + onChanged(); + } else { + webEntitiesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addWebEntities( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity value) { + if (webEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebEntitiesIsMutable(); + webEntities_.add(index, value); + onChanged(); + } else { + webEntitiesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addWebEntities( + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder builderForValue) { + if (webEntitiesBuilder_ == null) { + ensureWebEntitiesIsMutable(); + webEntities_.add(builderForValue.build()); + onChanged(); + } else { + webEntitiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addWebEntities( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder builderForValue) { + if (webEntitiesBuilder_ == null) { + ensureWebEntitiesIsMutable(); + webEntities_.add(index, builderForValue.build()); + onChanged(); + } else { + webEntitiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addAllWebEntities( + java.lang.Iterable values) { + if (webEntitiesBuilder_ == null) { + ensureWebEntitiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, webEntities_); + onChanged(); + } else { + webEntitiesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder clearWebEntities() { + if (webEntitiesBuilder_ == null) { + webEntities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + webEntitiesBuilder_.clear(); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder removeWebEntities(int index) { + if (webEntitiesBuilder_ == null) { + ensureWebEntitiesIsMutable(); + webEntities_.remove(index); + onChanged(); + } else { + webEntitiesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder getWebEntitiesBuilder( + int index) { + return getWebEntitiesFieldBuilder().getBuilder(index); + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntityOrBuilder getWebEntitiesOrBuilder( + int index) { + if (webEntitiesBuilder_ == null) { + return webEntities_.get(index); } else { + return webEntitiesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List + getWebEntitiesOrBuilderList() { + if (webEntitiesBuilder_ != null) { + return webEntitiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(webEntities_); + } + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder addWebEntitiesBuilder() { + return getWebEntitiesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.getDefaultInstance()); + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder addWebEntitiesBuilder( + int index) { + return getWebEntitiesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.getDefaultInstance()); + } + /** + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List + getWebEntitiesBuilderList() { + return getWebEntitiesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntityOrBuilder> + getWebEntitiesFieldBuilder() { + if (webEntitiesBuilder_ == null) { + webEntitiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebEntityOrBuilder>( + webEntities_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + webEntities_ = null; + } + return webEntitiesBuilder_; + } + + private java.util.List fullMatchingImages_ = + java.util.Collections.emptyList(); + private void ensureFullMatchingImagesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + fullMatchingImages_ = new java.util.ArrayList(fullMatchingImages_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> fullMatchingImagesBuilder_; + + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public java.util.List getFullMatchingImagesList() { + if (fullMatchingImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(fullMatchingImages_); + } else { + return fullMatchingImagesBuilder_.getMessageList(); + } + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public int getFullMatchingImagesCount() { + if (fullMatchingImagesBuilder_ == null) { + return fullMatchingImages_.size(); + } else { + return fullMatchingImagesBuilder_.getCount(); + } + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getFullMatchingImages(int index) { + if (fullMatchingImagesBuilder_ == null) { + return fullMatchingImages_.get(index); + } else { + return fullMatchingImagesBuilder_.getMessage(index); + } + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder setFullMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (fullMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.set(index, value); + onChanged(); + } else { + fullMatchingImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder setFullMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.set(index, builderForValue.build()); + onChanged(); + } else { + fullMatchingImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder addFullMatchingImages(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (fullMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.add(value); + onChanged(); + } else { + fullMatchingImagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder addFullMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (fullMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.add(index, value); + onChanged(); + } else { + fullMatchingImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder addFullMatchingImages( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.add(builderForValue.build()); + onChanged(); + } else { + fullMatchingImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder addFullMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.add(index, builderForValue.build()); + onChanged(); + } else { + fullMatchingImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder addAllFullMatchingImages( + java.lang.Iterable values) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fullMatchingImages_); + onChanged(); + } else { + fullMatchingImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder clearFullMatchingImages() { + if (fullMatchingImagesBuilder_ == null) { + fullMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + fullMatchingImagesBuilder_.clear(); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public Builder removeFullMatchingImages(int index) { + if (fullMatchingImagesBuilder_ == null) { + ensureFullMatchingImagesIsMutable(); + fullMatchingImages_.remove(index); + onChanged(); + } else { + fullMatchingImagesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder getFullMatchingImagesBuilder( + int index) { + return getFullMatchingImagesFieldBuilder().getBuilder(index); + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getFullMatchingImagesOrBuilder( + int index) { + if (fullMatchingImagesBuilder_ == null) { + return fullMatchingImages_.get(index); } else { + return fullMatchingImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public java.util.List + getFullMatchingImagesOrBuilderList() { + if (fullMatchingImagesBuilder_ != null) { + return fullMatchingImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fullMatchingImages_); + } + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addFullMatchingImagesBuilder() { + return getFullMatchingImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addFullMatchingImagesBuilder( + int index) { + return getFullMatchingImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + public java.util.List + getFullMatchingImagesBuilderList() { + return getFullMatchingImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> + getFullMatchingImagesFieldBuilder() { + if (fullMatchingImagesBuilder_ == null) { + fullMatchingImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder>( + fullMatchingImages_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + fullMatchingImages_ = null; + } + return fullMatchingImagesBuilder_; + } + + private java.util.List partialMatchingImages_ = + java.util.Collections.emptyList(); + private void ensurePartialMatchingImagesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + partialMatchingImages_ = new java.util.ArrayList(partialMatchingImages_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> partialMatchingImagesBuilder_; + + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public java.util.List getPartialMatchingImagesList() { + if (partialMatchingImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(partialMatchingImages_); + } else { + return partialMatchingImagesBuilder_.getMessageList(); + } + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public int getPartialMatchingImagesCount() { + if (partialMatchingImagesBuilder_ == null) { + return partialMatchingImages_.size(); + } else { + return partialMatchingImagesBuilder_.getCount(); + } + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getPartialMatchingImages(int index) { + if (partialMatchingImagesBuilder_ == null) { + return partialMatchingImages_.get(index); + } else { + return partialMatchingImagesBuilder_.getMessage(index); + } + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder setPartialMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (partialMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.set(index, value); + onChanged(); + } else { + partialMatchingImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder setPartialMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.set(index, builderForValue.build()); + onChanged(); + } else { + partialMatchingImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder addPartialMatchingImages(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (partialMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.add(value); + onChanged(); + } else { + partialMatchingImagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder addPartialMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (partialMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.add(index, value); + onChanged(); + } else { + partialMatchingImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder addPartialMatchingImages( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.add(builderForValue.build()); + onChanged(); + } else { + partialMatchingImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder addPartialMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.add(index, builderForValue.build()); + onChanged(); + } else { + partialMatchingImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder addAllPartialMatchingImages( + java.lang.Iterable values) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, partialMatchingImages_); + onChanged(); + } else { + partialMatchingImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder clearPartialMatchingImages() { + if (partialMatchingImagesBuilder_ == null) { + partialMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + partialMatchingImagesBuilder_.clear(); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public Builder removePartialMatchingImages(int index) { + if (partialMatchingImagesBuilder_ == null) { + ensurePartialMatchingImagesIsMutable(); + partialMatchingImages_.remove(index); + onChanged(); + } else { + partialMatchingImagesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder getPartialMatchingImagesBuilder( + int index) { + return getPartialMatchingImagesFieldBuilder().getBuilder(index); + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getPartialMatchingImagesOrBuilder( + int index) { + if (partialMatchingImagesBuilder_ == null) { + return partialMatchingImages_.get(index); } else { + return partialMatchingImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public java.util.List + getPartialMatchingImagesOrBuilderList() { + if (partialMatchingImagesBuilder_ != null) { + return partialMatchingImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(partialMatchingImages_); + } + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addPartialMatchingImagesBuilder() { + return getPartialMatchingImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addPartialMatchingImagesBuilder( + int index) { + return getPartialMatchingImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+     * Partial matching images from the Internet.
+     * Those images are similar enough to share some key-point features. For
+     * example an original image will likely have partial matching for its crops.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + public java.util.List + getPartialMatchingImagesBuilderList() { + return getPartialMatchingImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> + getPartialMatchingImagesFieldBuilder() { + if (partialMatchingImagesBuilder_ == null) { + partialMatchingImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder>( + partialMatchingImages_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + partialMatchingImages_ = null; + } + return partialMatchingImagesBuilder_; + } + + private java.util.List pagesWithMatchingImages_ = + java.util.Collections.emptyList(); + private void ensurePagesWithMatchingImagesIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + pagesWithMatchingImages_ = new java.util.ArrayList(pagesWithMatchingImages_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebPageOrBuilder> pagesWithMatchingImagesBuilder_; + + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public java.util.List getPagesWithMatchingImagesList() { + if (pagesWithMatchingImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(pagesWithMatchingImages_); + } else { + return pagesWithMatchingImagesBuilder_.getMessageList(); + } + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public int getPagesWithMatchingImagesCount() { + if (pagesWithMatchingImagesBuilder_ == null) { + return pagesWithMatchingImages_.size(); + } else { + return pagesWithMatchingImagesBuilder_.getCount(); + } + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage getPagesWithMatchingImages(int index) { + if (pagesWithMatchingImagesBuilder_ == null) { + return pagesWithMatchingImages_.get(index); + } else { + return pagesWithMatchingImagesBuilder_.getMessage(index); + } + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder setPagesWithMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage value) { + if (pagesWithMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesWithMatchingImagesIsMutable(); + pagesWithMatchingImages_.set(index, value); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder setPagesWithMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder builderForValue) { + if (pagesWithMatchingImagesBuilder_ == null) { + ensurePagesWithMatchingImagesIsMutable(); + pagesWithMatchingImages_.set(index, builderForValue.build()); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder addPagesWithMatchingImages(com.google.cloud.vision.v1p3beta1.WebDetection.WebPage value) { + if (pagesWithMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesWithMatchingImagesIsMutable(); + pagesWithMatchingImages_.add(value); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder addPagesWithMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage value) { + if (pagesWithMatchingImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesWithMatchingImagesIsMutable(); + pagesWithMatchingImages_.add(index, value); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder addPagesWithMatchingImages( + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder builderForValue) { + if (pagesWithMatchingImagesBuilder_ == null) { + ensurePagesWithMatchingImagesIsMutable(); + pagesWithMatchingImages_.add(builderForValue.build()); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder addPagesWithMatchingImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder builderForValue) { + if (pagesWithMatchingImagesBuilder_ == null) { + ensurePagesWithMatchingImagesIsMutable(); + pagesWithMatchingImages_.add(index, builderForValue.build()); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder addAllPagesWithMatchingImages( + java.lang.Iterable values) { + if (pagesWithMatchingImagesBuilder_ == null) { + ensurePagesWithMatchingImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, pagesWithMatchingImages_); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder clearPagesWithMatchingImages() { + if (pagesWithMatchingImagesBuilder_ == null) { + pagesWithMatchingImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.clear(); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public Builder removePagesWithMatchingImages(int index) { + if (pagesWithMatchingImagesBuilder_ == null) { + ensurePagesWithMatchingImagesIsMutable(); + pagesWithMatchingImages_.remove(index); + onChanged(); + } else { + pagesWithMatchingImagesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder getPagesWithMatchingImagesBuilder( + int index) { + return getPagesWithMatchingImagesFieldBuilder().getBuilder(index); + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPageOrBuilder getPagesWithMatchingImagesOrBuilder( + int index) { + if (pagesWithMatchingImagesBuilder_ == null) { + return pagesWithMatchingImages_.get(index); } else { + return pagesWithMatchingImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public java.util.List + getPagesWithMatchingImagesOrBuilderList() { + if (pagesWithMatchingImagesBuilder_ != null) { + return pagesWithMatchingImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pagesWithMatchingImages_); + } + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder addPagesWithMatchingImagesBuilder() { + return getPagesWithMatchingImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.getDefaultInstance()); + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder addPagesWithMatchingImagesBuilder( + int index) { + return getPagesWithMatchingImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.getDefaultInstance()); + } + /** + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + public java.util.List + getPagesWithMatchingImagesBuilderList() { + return getPagesWithMatchingImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebPageOrBuilder> + getPagesWithMatchingImagesFieldBuilder() { + if (pagesWithMatchingImagesBuilder_ == null) { + pagesWithMatchingImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage, com.google.cloud.vision.v1p3beta1.WebDetection.WebPage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebPageOrBuilder>( + pagesWithMatchingImages_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + pagesWithMatchingImages_ = null; + } + return pagesWithMatchingImagesBuilder_; + } + + private java.util.List visuallySimilarImages_ = + java.util.Collections.emptyList(); + private void ensureVisuallySimilarImagesIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + visuallySimilarImages_ = new java.util.ArrayList(visuallySimilarImages_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> visuallySimilarImagesBuilder_; + + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public java.util.List getVisuallySimilarImagesList() { + if (visuallySimilarImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(visuallySimilarImages_); + } else { + return visuallySimilarImagesBuilder_.getMessageList(); + } + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public int getVisuallySimilarImagesCount() { + if (visuallySimilarImagesBuilder_ == null) { + return visuallySimilarImages_.size(); + } else { + return visuallySimilarImagesBuilder_.getCount(); + } + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getVisuallySimilarImages(int index) { + if (visuallySimilarImagesBuilder_ == null) { + return visuallySimilarImages_.get(index); + } else { + return visuallySimilarImagesBuilder_.getMessage(index); + } + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder setVisuallySimilarImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (visuallySimilarImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVisuallySimilarImagesIsMutable(); + visuallySimilarImages_.set(index, value); + onChanged(); + } else { + visuallySimilarImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder setVisuallySimilarImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (visuallySimilarImagesBuilder_ == null) { + ensureVisuallySimilarImagesIsMutable(); + visuallySimilarImages_.set(index, builderForValue.build()); + onChanged(); + } else { + visuallySimilarImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder addVisuallySimilarImages(com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (visuallySimilarImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVisuallySimilarImagesIsMutable(); + visuallySimilarImages_.add(value); + onChanged(); + } else { + visuallySimilarImagesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder addVisuallySimilarImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage value) { + if (visuallySimilarImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVisuallySimilarImagesIsMutable(); + visuallySimilarImages_.add(index, value); + onChanged(); + } else { + visuallySimilarImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder addVisuallySimilarImages( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (visuallySimilarImagesBuilder_ == null) { + ensureVisuallySimilarImagesIsMutable(); + visuallySimilarImages_.add(builderForValue.build()); + onChanged(); + } else { + visuallySimilarImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder addVisuallySimilarImages( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder builderForValue) { + if (visuallySimilarImagesBuilder_ == null) { + ensureVisuallySimilarImagesIsMutable(); + visuallySimilarImages_.add(index, builderForValue.build()); + onChanged(); + } else { + visuallySimilarImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder addAllVisuallySimilarImages( + java.lang.Iterable values) { + if (visuallySimilarImagesBuilder_ == null) { + ensureVisuallySimilarImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, visuallySimilarImages_); + onChanged(); + } else { + visuallySimilarImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder clearVisuallySimilarImages() { + if (visuallySimilarImagesBuilder_ == null) { + visuallySimilarImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + visuallySimilarImagesBuilder_.clear(); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public Builder removeVisuallySimilarImages(int index) { + if (visuallySimilarImagesBuilder_ == null) { + ensureVisuallySimilarImagesIsMutable(); + visuallySimilarImages_.remove(index); + onChanged(); + } else { + visuallySimilarImagesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder getVisuallySimilarImagesBuilder( + int index) { + return getVisuallySimilarImagesFieldBuilder().getBuilder(index); + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getVisuallySimilarImagesOrBuilder( + int index) { + if (visuallySimilarImagesBuilder_ == null) { + return visuallySimilarImages_.get(index); } else { + return visuallySimilarImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public java.util.List + getVisuallySimilarImagesOrBuilderList() { + if (visuallySimilarImagesBuilder_ != null) { + return visuallySimilarImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(visuallySimilarImages_); + } + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addVisuallySimilarImagesBuilder() { + return getVisuallySimilarImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder addVisuallySimilarImagesBuilder( + int index) { + return getVisuallySimilarImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + *
+     * The visually similar image results.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + public java.util.List + getVisuallySimilarImagesBuilderList() { + return getVisuallySimilarImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder> + getVisuallySimilarImagesFieldBuilder() { + if (visuallySimilarImagesBuilder_ == null) { + visuallySimilarImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage, com.google.cloud.vision.v1p3beta1.WebDetection.WebImage.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder>( + visuallySimilarImages_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + visuallySimilarImages_ = null; + } + return visuallySimilarImagesBuilder_; + } + + private java.util.List bestGuessLabels_ = + java.util.Collections.emptyList(); + private void ensureBestGuessLabelsIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + bestGuessLabels_ = new java.util.ArrayList(bestGuessLabels_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabelOrBuilder> bestGuessLabelsBuilder_; + + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public java.util.List getBestGuessLabelsList() { + if (bestGuessLabelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(bestGuessLabels_); + } else { + return bestGuessLabelsBuilder_.getMessageList(); + } + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public int getBestGuessLabelsCount() { + if (bestGuessLabelsBuilder_ == null) { + return bestGuessLabels_.size(); + } else { + return bestGuessLabelsBuilder_.getCount(); + } + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel getBestGuessLabels(int index) { + if (bestGuessLabelsBuilder_ == null) { + return bestGuessLabels_.get(index); + } else { + return bestGuessLabelsBuilder_.getMessage(index); + } + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder setBestGuessLabels( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel value) { + if (bestGuessLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.set(index, value); + onChanged(); + } else { + bestGuessLabelsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder setBestGuessLabels( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder builderForValue) { + if (bestGuessLabelsBuilder_ == null) { + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.set(index, builderForValue.build()); + onChanged(); + } else { + bestGuessLabelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder addBestGuessLabels(com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel value) { + if (bestGuessLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.add(value); + onChanged(); + } else { + bestGuessLabelsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder addBestGuessLabels( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel value) { + if (bestGuessLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.add(index, value); + onChanged(); + } else { + bestGuessLabelsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder addBestGuessLabels( + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder builderForValue) { + if (bestGuessLabelsBuilder_ == null) { + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.add(builderForValue.build()); + onChanged(); + } else { + bestGuessLabelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder addBestGuessLabels( + int index, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder builderForValue) { + if (bestGuessLabelsBuilder_ == null) { + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.add(index, builderForValue.build()); + onChanged(); + } else { + bestGuessLabelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder addAllBestGuessLabels( + java.lang.Iterable values) { + if (bestGuessLabelsBuilder_ == null) { + ensureBestGuessLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, bestGuessLabels_); + onChanged(); + } else { + bestGuessLabelsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder clearBestGuessLabels() { + if (bestGuessLabelsBuilder_ == null) { + bestGuessLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + bestGuessLabelsBuilder_.clear(); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public Builder removeBestGuessLabels(int index) { + if (bestGuessLabelsBuilder_ == null) { + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.remove(index); + onChanged(); + } else { + bestGuessLabelsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder getBestGuessLabelsBuilder( + int index) { + return getBestGuessLabelsFieldBuilder().getBuilder(index); + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabelOrBuilder getBestGuessLabelsOrBuilder( + int index) { + if (bestGuessLabelsBuilder_ == null) { + return bestGuessLabels_.get(index); } else { + return bestGuessLabelsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public java.util.List + getBestGuessLabelsOrBuilderList() { + if (bestGuessLabelsBuilder_ != null) { + return bestGuessLabelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(bestGuessLabels_); + } + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder addBestGuessLabelsBuilder() { + return getBestGuessLabelsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.getDefaultInstance()); + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder addBestGuessLabelsBuilder( + int index) { + return getBestGuessLabelsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.getDefaultInstance()); + } + /** + *
+     * Best guess text labels for the request image.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + public java.util.List + getBestGuessLabelsBuilderList() { + return getBestGuessLabelsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabelOrBuilder> + getBestGuessLabelsFieldBuilder() { + if (bestGuessLabelsBuilder_ == null) { + bestGuessLabelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.Builder, com.google.cloud.vision.v1p3beta1.WebDetection.WebLabelOrBuilder>( + bestGuessLabels_, + ((bitField0_ & 0x00000020) == 0x00000020), + getParentForChildren(), + isClean()); + bestGuessLabels_ = null; + } + return bestGuessLabelsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.WebDetection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection) + private static final com.google.cloud.vision.v1p3beta1.WebDetection DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.WebDetection(); + } + + public static com.google.cloud.vision.v1p3beta1.WebDetection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WebDetection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebDetection(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.WebDetection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionOrBuilder.java new file mode 100644 index 000000000000..d4d1d2ed6404 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionOrBuilder.java @@ -0,0 +1,288 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/web_detection.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface WebDetectionOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.WebDetection) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + java.util.List + getWebEntitiesList(); + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntity getWebEntities(int index); + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + int getWebEntitiesCount(); + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + java.util.List + getWebEntitiesOrBuilderList(); + /** + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebEntity web_entities = 1; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebEntityOrBuilder getWebEntitiesOrBuilder( + int index); + + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + java.util.List + getFullMatchingImagesList(); + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getFullMatchingImages(int index); + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + int getFullMatchingImagesCount(); + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + java.util.List + getFullMatchingImagesOrBuilderList(); + /** + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage full_matching_images = 2; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getFullMatchingImagesOrBuilder( + int index); + + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + java.util.List + getPartialMatchingImagesList(); + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getPartialMatchingImages(int index); + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + int getPartialMatchingImagesCount(); + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + java.util.List + getPartialMatchingImagesOrBuilderList(); + /** + *
+   * Partial matching images from the Internet.
+   * Those images are similar enough to share some key-point features. For
+   * example an original image will likely have partial matching for its crops.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage partial_matching_images = 3; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getPartialMatchingImagesOrBuilder( + int index); + + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + java.util.List + getPagesWithMatchingImagesList(); + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebPage getPagesWithMatchingImages(int index); + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + int getPagesWithMatchingImagesCount(); + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + java.util.List + getPagesWithMatchingImagesOrBuilderList(); + /** + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebPage pages_with_matching_images = 4; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebPageOrBuilder getPagesWithMatchingImagesOrBuilder( + int index); + + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + java.util.List + getVisuallySimilarImagesList(); + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImage getVisuallySimilarImages(int index); + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + int getVisuallySimilarImagesCount(); + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + java.util.List + getVisuallySimilarImagesOrBuilderList(); + /** + *
+   * The visually similar image results.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebImage visually_similar_images = 6; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebImageOrBuilder getVisuallySimilarImagesOrBuilder( + int index); + + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + java.util.List + getBestGuessLabelsList(); + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabel getBestGuessLabels(int index); + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + int getBestGuessLabelsCount(); + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + java.util.List + getBestGuessLabelsOrBuilderList(); + /** + *
+   * Best guess text labels for the request image.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.WebDetection.WebLabel best_guess_labels = 8; + */ + com.google.cloud.vision.v1p3beta1.WebDetection.WebLabelOrBuilder getBestGuessLabelsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionParams.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionParams.java new file mode 100644 index 000000000000..89eaea8a0da3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionParams.java @@ -0,0 +1,472 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * Parameters for web detection request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetectionParams} + */ +public final class WebDetectionParams extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.WebDetectionParams) + WebDetectionParamsOrBuilder { +private static final long serialVersionUID = 0L; + // Use WebDetectionParams.newBuilder() to construct. + private WebDetectionParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebDetectionParams() { + includeGeoResults_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WebDetectionParams( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 16: { + + includeGeoResults_ = input.readBool(); + 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.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetectionParams.class, com.google.cloud.vision.v1p3beta1.WebDetectionParams.Builder.class); + } + + public static final int INCLUDE_GEO_RESULTS_FIELD_NUMBER = 2; + private boolean includeGeoResults_; + /** + *
+   * Whether to include results derived from the geo information in the image.
+   * 
+ * + * bool include_geo_results = 2; + */ + public boolean getIncludeGeoResults() { + return includeGeoResults_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (includeGeoResults_ != false) { + output.writeBool(2, includeGeoResults_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (includeGeoResults_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, includeGeoResults_); + } + 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.vision.v1p3beta1.WebDetectionParams)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.WebDetectionParams other = (com.google.cloud.vision.v1p3beta1.WebDetectionParams) obj; + + boolean result = true; + result = result && (getIncludeGeoResults() + == other.getIncludeGeoResults()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INCLUDE_GEO_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIncludeGeoResults()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams 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.vision.v1p3beta1.WebDetectionParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams 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.vision.v1p3beta1.WebDetectionParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams 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.vision.v1p3beta1.WebDetectionParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams 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.vision.v1p3beta1.WebDetectionParams parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.WebDetectionParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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; + } + /** + *
+   * Parameters for web detection request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.WebDetectionParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.WebDetectionParams) + com.google.cloud.vision.v1p3beta1.WebDetectionParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.WebDetectionParams.class, com.google.cloud.vision.v1p3beta1.WebDetectionParams.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.WebDetectionParams.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + includeGeoResults_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p3beta1_WebDetectionParams_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.WebDetectionParams getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.WebDetectionParams.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.WebDetectionParams build() { + com.google.cloud.vision.v1p3beta1.WebDetectionParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.WebDetectionParams buildPartial() { + com.google.cloud.vision.v1p3beta1.WebDetectionParams result = new com.google.cloud.vision.v1p3beta1.WebDetectionParams(this); + result.includeGeoResults_ = includeGeoResults_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.WebDetectionParams) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.WebDetectionParams)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.WebDetectionParams other) { + if (other == com.google.cloud.vision.v1p3beta1.WebDetectionParams.getDefaultInstance()) return this; + if (other.getIncludeGeoResults() != false) { + setIncludeGeoResults(other.getIncludeGeoResults()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.WebDetectionParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.WebDetectionParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean includeGeoResults_ ; + /** + *
+     * Whether to include results derived from the geo information in the image.
+     * 
+ * + * bool include_geo_results = 2; + */ + public boolean getIncludeGeoResults() { + return includeGeoResults_; + } + /** + *
+     * Whether to include results derived from the geo information in the image.
+     * 
+ * + * bool include_geo_results = 2; + */ + public Builder setIncludeGeoResults(boolean value) { + + includeGeoResults_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether to include results derived from the geo information in the image.
+     * 
+ * + * bool include_geo_results = 2; + */ + public Builder clearIncludeGeoResults() { + + includeGeoResults_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.WebDetectionParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetectionParams) + private static final com.google.cloud.vision.v1p3beta1.WebDetectionParams DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.WebDetectionParams(); + } + + public static com.google.cloud.vision.v1p3beta1.WebDetectionParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WebDetectionParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebDetectionParams(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.WebDetectionParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionParamsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionParamsOrBuilder.java new file mode 100644 index 000000000000..03c27f33b590 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionParamsOrBuilder.java @@ -0,0 +1,18 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/image_annotator.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface WebDetectionParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.WebDetectionParams) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Whether to include results derived from the geo information in the image.
+   * 
+ * + * bool include_geo_results = 2; + */ + boolean getIncludeGeoResults(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionProto.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionProto.java new file mode 100644 index 000000000000..b893fa2f97a3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WebDetectionProto.java @@ -0,0 +1,129 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/web_detection.proto + +package com.google.cloud.vision.v1p3beta1; + +public final class WebDetectionProto { + private WebDetectionProto() {} + 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_vision_v1p3beta1_WebDetection_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_WebDetection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/vision/v1p3beta1/web_dete" + + "ction.proto\022\035google.cloud.vision.v1p3bet" + + "a1\032\034google/api/annotations.proto\"\214\007\n\014Web" + + "Detection\022K\n\014web_entities\030\001 \003(\01325.google" + + ".cloud.vision.v1p3beta1.WebDetection.Web" + + "Entity\022R\n\024full_matching_images\030\002 \003(\01324.g" + + "oogle.cloud.vision.v1p3beta1.WebDetectio" + + "n.WebImage\022U\n\027partial_matching_images\030\003 " + + "\003(\01324.google.cloud.vision.v1p3beta1.WebD" + + "etection.WebImage\022W\n\032pages_with_matching" + + "_images\030\004 \003(\01323.google.cloud.vision.v1p3" + + "beta1.WebDetection.WebPage\022U\n\027visually_s" + + "imilar_images\030\006 \003(\01324.google.cloud.visio" + + "n.v1p3beta1.WebDetection.WebImage\022O\n\021bes" + + "t_guess_labels\030\010 \003(\01324.google.cloud.visi" + + "on.v1p3beta1.WebDetection.WebLabel\032B\n\tWe" + + "bEntity\022\021\n\tentity_id\030\001 \001(\t\022\r\n\005score\030\002 \001(" + + "\002\022\023\n\013description\030\003 \001(\t\032&\n\010WebImage\022\013\n\003ur" + + "l\030\001 \001(\t\022\r\n\005score\030\002 \001(\002\032\344\001\n\007WebPage\022\013\n\003ur" + + "l\030\001 \001(\t\022\r\n\005score\030\002 \001(\002\022\022\n\npage_title\030\003 \001" + + "(\t\022R\n\024full_matching_images\030\004 \003(\01324.googl" + + "e.cloud.vision.v1p3beta1.WebDetection.We" + + "bImage\022U\n\027partial_matching_images\030\005 \003(\0132" + + "4.google.cloud.vision.v1p3beta1.WebDetec" + + "tion.WebImage\0320\n\010WebLabel\022\r\n\005label\030\001 \001(\t" + + "\022\025\n\rlanguage_code\030\002 \001(\tB\200\001\n!com.google.c" + + "loud.vision.v1p3beta1B\021WebDetectionProto" + + "P\001ZCgoogle.golang.org/genproto/googleapi" + + "s/cloud/vision/v1p3beta1;vision\370\001\001b\006prot" + + "o3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor, + new java.lang.String[] { "WebEntities", "FullMatchingImages", "PartialMatchingImages", "PagesWithMatchingImages", "VisuallySimilarImages", "BestGuessLabels", }); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_descriptor = + internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebEntity_descriptor, + new java.lang.String[] { "EntityId", "Score", "Description", }); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_descriptor = + internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebImage_descriptor, + new java.lang.String[] { "Url", "Score", }); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_descriptor = + internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebPage_descriptor, + new java.lang.String[] { "Url", "Score", "PageTitle", "FullMatchingImages", "PartialMatchingImages", }); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_descriptor = + internal_static_google_cloud_vision_v1p3beta1_WebDetection_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p3beta1_WebDetection_WebLabel_descriptor, + new java.lang.String[] { "Label", "LanguageCode", }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Word.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Word.java new file mode 100644 index 000000000000..1edf9192cf45 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/Word.java @@ -0,0 +1,1563 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +/** + *
+ * A word representation.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Word} + */ +public final class Word extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Word) + WordOrBuilder { +private static final long serialVersionUID = 0L; + // Use Word.newBuilder() to construct. + private Word(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Word() { + symbols_ = java.util.Collections.emptyList(); + confidence_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Word( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder subBuilder = null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = input.readMessage(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = input.readMessage(com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingBox_); + boundingBox_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + symbols_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + symbols_.add( + input.readMessage(com.google.cloud.vision.v1p3beta1.Symbol.parser(), extensionRegistry)); + break; + } + case 37: { + + confidence_ = input.readFloat(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + symbols_ = java.util.Collections.unmodifiableList(symbols_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Word_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Word_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Word.class, com.google.cloud.vision.v1p3beta1.Word.Builder.class); + } + + private int bitField0_; + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_; + /** + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + /** + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + return getProperty(); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_; + /** + *
+   * The bounding box for the word.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public boolean hasBoundingBox() { + return boundingBox_ != null; + } + /** + *
+   * The bounding box for the word.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() { + return boundingBox_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } + /** + *
+   * The bounding box for the word.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + return getBoundingBox(); + } + + public static final int SYMBOLS_FIELD_NUMBER = 3; + private java.util.List symbols_; + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public java.util.List getSymbolsList() { + return symbols_; + } + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public java.util.List + getSymbolsOrBuilderList() { + return symbols_; + } + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public int getSymbolsCount() { + return symbols_.size(); + } + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p3beta1.Symbol getSymbols(int index) { + return symbols_.get(index); + } + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p3beta1.SymbolOrBuilder getSymbolsOrBuilder( + int index) { + return symbols_.get(index); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 4; + private float confidence_; + /** + *
+   * Confidence of the OCR results for the word. Range [0, 1].
+   * 
+ * + * float confidence = 4; + */ + public float getConfidence() { + return confidence_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (property_ != null) { + output.writeMessage(1, getProperty()); + } + if (boundingBox_ != null) { + output.writeMessage(2, getBoundingBox()); + } + for (int i = 0; i < symbols_.size(); i++) { + output.writeMessage(3, symbols_.get(i)); + } + if (confidence_ != 0F) { + output.writeFloat(4, confidence_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (property_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProperty()); + } + if (boundingBox_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getBoundingBox()); + } + for (int i = 0; i < symbols_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, symbols_.get(i)); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, confidence_); + } + 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.vision.v1p3beta1.Word)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p3beta1.Word other = (com.google.cloud.vision.v1p3beta1.Word) obj; + + boolean result = true; + result = result && (hasProperty() == other.hasProperty()); + if (hasProperty()) { + result = result && getProperty() + .equals(other.getProperty()); + } + result = result && (hasBoundingBox() == other.hasBoundingBox()); + if (hasBoundingBox()) { + result = result && getBoundingBox() + .equals(other.getBoundingBox()); + } + result = result && getSymbolsList() + .equals(other.getSymbolsList()); + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProperty()) { + hash = (37 * hash) + PROPERTY_FIELD_NUMBER; + hash = (53 * hash) + getProperty().hashCode(); + } + if (hasBoundingBox()) { + hash = (37 * hash) + BOUNDING_BOX_FIELD_NUMBER; + hash = (53 * hash) + getBoundingBox().hashCode(); + } + if (getSymbolsCount() > 0) { + hash = (37 * hash) + SYMBOLS_FIELD_NUMBER; + hash = (53 * hash) + getSymbolsList().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p3beta1.Word parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Word 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.vision.v1p3beta1.Word parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Word 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.vision.v1p3beta1.Word parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1p3beta1.Word parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.vision.v1p3beta1.Word parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Word 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.vision.v1p3beta1.Word parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Word 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.vision.v1p3beta1.Word parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1p3beta1.Word parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Word prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 word representation.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p3beta1.Word} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Word) + com.google.cloud.vision.v1p3beta1.WordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Word_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Word_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p3beta1.Word.class, com.google.cloud.vision.v1p3beta1.Word.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p3beta1.Word.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSymbolsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (propertyBuilder_ == null) { + property_ = null; + } else { + property_ = null; + propertyBuilder_ = null; + } + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + if (symbolsBuilder_ == null) { + symbols_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + symbolsBuilder_.clear(); + } + confidence_ = 0F; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.vision.v1p3beta1.TextAnnotationProto.internal_static_google_cloud_vision_v1p3beta1_Word_descriptor; + } + + public com.google.cloud.vision.v1p3beta1.Word getDefaultInstanceForType() { + return com.google.cloud.vision.v1p3beta1.Word.getDefaultInstance(); + } + + public com.google.cloud.vision.v1p3beta1.Word build() { + com.google.cloud.vision.v1p3beta1.Word result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.vision.v1p3beta1.Word buildPartial() { + com.google.cloud.vision.v1p3beta1.Word result = new com.google.cloud.vision.v1p3beta1.Word(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (propertyBuilder_ == null) { + result.property_ = property_; + } else { + result.property_ = propertyBuilder_.build(); + } + if (boundingBoxBuilder_ == null) { + result.boundingBox_ = boundingBox_; + } else { + result.boundingBox_ = boundingBoxBuilder_.build(); + } + if (symbolsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + symbols_ = java.util.Collections.unmodifiableList(symbols_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.symbols_ = symbols_; + } else { + result.symbols_ = symbolsBuilder_.build(); + } + result.confidence_ = confidence_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p3beta1.Word) { + return mergeFrom((com.google.cloud.vision.v1p3beta1.Word)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Word other) { + if (other == com.google.cloud.vision.v1p3beta1.Word.getDefaultInstance()) return this; + if (other.hasProperty()) { + mergeProperty(other.getProperty()); + } + if (other.hasBoundingBox()) { + mergeBoundingBox(other.getBoundingBox()); + } + if (symbolsBuilder_ == null) { + if (!other.symbols_.isEmpty()) { + if (symbols_.isEmpty()) { + symbols_ = other.symbols_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSymbolsIsMutable(); + symbols_.addAll(other.symbols_); + } + onChanged(); + } + } else { + if (!other.symbols_.isEmpty()) { + if (symbolsBuilder_.isEmpty()) { + symbolsBuilder_.dispose(); + symbolsBuilder_ = null; + symbols_ = other.symbols_; + bitField0_ = (bitField0_ & ~0x00000004); + symbolsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSymbolsFieldBuilder() : null; + } else { + symbolsBuilder_.addAllMessages(other.symbols_); + } + } + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p3beta1.Word parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p3beta1.Word) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> propertyBuilder_; + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + property_ = value; + onChanged(); + } else { + propertyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder builderForValue) { + if (propertyBuilder_ == null) { + property_ = builderForValue.build(); + onChanged(); + } else { + propertyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty(com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.newBuilder(property_).mergeFrom(value).buildPartial(); + } else { + property_ = value; + } + onChanged(); + } else { + propertyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder clearProperty() { + if (propertyBuilder_ == null) { + property_ = null; + onChanged(); + } else { + property_ = null; + propertyBuilder_ = null; + } + + return this; + } + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null ? + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance() : property_; + } + } + /** + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), + getParentForChildren(), + isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> boundingBoxBuilder_; + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public boolean hasBoundingBox() { + return boundingBoxBuilder_ != null || boundingBox_ != null; + } + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } else { + return boundingBoxBuilder_.getMessage(); + } + } + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingBox_ = value; + onChanged(); + } else { + boundingBoxBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox( + com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) { + if (boundingBoxBuilder_ == null) { + boundingBox_ = builderForValue.build(); + onChanged(); + } else { + boundingBoxBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder mergeBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.vision.v1p3beta1.BoundingPoly.newBuilder(boundingBox_).mergeFrom(value).buildPartial(); + } else { + boundingBox_ = value; + } + onChanged(); + } else { + boundingBoxBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public Builder clearBoundingBox() { + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + onChanged(); + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + + return this; + } + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingBoxBuilder() { + + onChanged(); + return getBoundingBoxFieldBuilder().getBuilder(); + } + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null ? + com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance() : boundingBox_; + } + } + /** + *
+     * The bounding box for the word.
+     * The vertices are in the order of top-left, top-right, bottom-right,
+     * bottom-left. When a rotation of the bounding box is detected the rotation
+     * is represented as around the top-left corner as defined when the text is
+     * read in the 'natural' orientation.
+     * For example:
+     *   * when the text is horizontal it might look like:
+     *      0----1
+     *      |    |
+     *      3----2
+     *   * when it's rotated 180 degrees around the top-left corner it becomes:
+     *      2----3
+     *      |    |
+     *      1----0
+     *   and the vertice order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.BoundingPoly, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder, com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>( + getBoundingBox(), + getParentForChildren(), + isClean()); + boundingBox_ = null; + } + return boundingBoxBuilder_; + } + + private java.util.List symbols_ = + java.util.Collections.emptyList(); + private void ensureSymbolsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + symbols_ = new java.util.ArrayList(symbols_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Symbol, com.google.cloud.vision.v1p3beta1.Symbol.Builder, com.google.cloud.vision.v1p3beta1.SymbolOrBuilder> symbolsBuilder_; + + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public java.util.List getSymbolsList() { + if (symbolsBuilder_ == null) { + return java.util.Collections.unmodifiableList(symbols_); + } else { + return symbolsBuilder_.getMessageList(); + } + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public int getSymbolsCount() { + if (symbolsBuilder_ == null) { + return symbols_.size(); + } else { + return symbolsBuilder_.getCount(); + } + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p3beta1.Symbol getSymbols(int index) { + if (symbolsBuilder_ == null) { + return symbols_.get(index); + } else { + return symbolsBuilder_.getMessage(index); + } + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder setSymbols( + int index, com.google.cloud.vision.v1p3beta1.Symbol value) { + if (symbolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymbolsIsMutable(); + symbols_.set(index, value); + onChanged(); + } else { + symbolsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder setSymbols( + int index, com.google.cloud.vision.v1p3beta1.Symbol.Builder builderForValue) { + if (symbolsBuilder_ == null) { + ensureSymbolsIsMutable(); + symbols_.set(index, builderForValue.build()); + onChanged(); + } else { + symbolsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder addSymbols(com.google.cloud.vision.v1p3beta1.Symbol value) { + if (symbolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymbolsIsMutable(); + symbols_.add(value); + onChanged(); + } else { + symbolsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder addSymbols( + int index, com.google.cloud.vision.v1p3beta1.Symbol value) { + if (symbolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymbolsIsMutable(); + symbols_.add(index, value); + onChanged(); + } else { + symbolsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder addSymbols( + com.google.cloud.vision.v1p3beta1.Symbol.Builder builderForValue) { + if (symbolsBuilder_ == null) { + ensureSymbolsIsMutable(); + symbols_.add(builderForValue.build()); + onChanged(); + } else { + symbolsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder addSymbols( + int index, com.google.cloud.vision.v1p3beta1.Symbol.Builder builderForValue) { + if (symbolsBuilder_ == null) { + ensureSymbolsIsMutable(); + symbols_.add(index, builderForValue.build()); + onChanged(); + } else { + symbolsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder addAllSymbols( + java.lang.Iterable values) { + if (symbolsBuilder_ == null) { + ensureSymbolsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, symbols_); + onChanged(); + } else { + symbolsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder clearSymbols() { + if (symbolsBuilder_ == null) { + symbols_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + symbolsBuilder_.clear(); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public Builder removeSymbols(int index) { + if (symbolsBuilder_ == null) { + ensureSymbolsIsMutable(); + symbols_.remove(index); + onChanged(); + } else { + symbolsBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p3beta1.Symbol.Builder getSymbolsBuilder( + int index) { + return getSymbolsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p3beta1.SymbolOrBuilder getSymbolsOrBuilder( + int index) { + if (symbolsBuilder_ == null) { + return symbols_.get(index); } else { + return symbolsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public java.util.List + getSymbolsOrBuilderList() { + if (symbolsBuilder_ != null) { + return symbolsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(symbols_); + } + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p3beta1.Symbol.Builder addSymbolsBuilder() { + return getSymbolsFieldBuilder().addBuilder( + com.google.cloud.vision.v1p3beta1.Symbol.getDefaultInstance()); + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p3beta1.Symbol.Builder addSymbolsBuilder( + int index) { + return getSymbolsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1p3beta1.Symbol.getDefaultInstance()); + } + /** + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + public java.util.List + getSymbolsBuilderList() { + return getSymbolsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Symbol, com.google.cloud.vision.v1p3beta1.Symbol.Builder, com.google.cloud.vision.v1p3beta1.SymbolOrBuilder> + getSymbolsFieldBuilder() { + if (symbolsBuilder_ == null) { + symbolsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p3beta1.Symbol, com.google.cloud.vision.v1p3beta1.Symbol.Builder, com.google.cloud.vision.v1p3beta1.SymbolOrBuilder>( + symbols_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + symbols_ = null; + } + return symbolsBuilder_; + } + + private float confidence_ ; + /** + *
+     * Confidence of the OCR results for the word. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence of the OCR results for the word. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence of the OCR results for the word. Range [0, 1].
+     * 
+ * + * float confidence = 4; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Word) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Word) + private static final com.google.cloud.vision.v1p3beta1.Word DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Word(); + } + + public static com.google.cloud.vision.v1p3beta1.Word getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Word parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Word(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.vision.v1p3beta1.Word getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WordOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WordOrBuilder.java new file mode 100644 index 000000000000..2eaad295ab6e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/java/com/google/cloud/vision/v1p3beta1/WordOrBuilder.java @@ -0,0 +1,159 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p3beta1/text_annotation.proto + +package com.google.cloud.vision.v1p3beta1; + +public interface WordOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p3beta1.Word) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty(); + /** + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder(); + + /** + *
+   * The bounding box for the word.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + boolean hasBoundingBox(); + /** + *
+   * The bounding box for the word.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox(); + /** + *
+   * The bounding box for the word.
+   * The vertices are in the order of top-left, top-right, bottom-right,
+   * bottom-left. When a rotation of the bounding box is detected the rotation
+   * is represented as around the top-left corner as defined when the text is
+   * read in the 'natural' orientation.
+   * For example:
+   *   * when the text is horizontal it might look like:
+   *      0----1
+   *      |    |
+   *      3----2
+   *   * when it's rotated 180 degrees around the top-left corner it becomes:
+   *      2----3
+   *      |    |
+   *      1----0
+   *   and the vertice order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder(); + + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + java.util.List + getSymbolsList(); + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + com.google.cloud.vision.v1p3beta1.Symbol getSymbols(int index); + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + int getSymbolsCount(); + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + java.util.List + getSymbolsOrBuilderList(); + /** + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p3beta1.Symbol symbols = 3; + */ + com.google.cloud.vision.v1p3beta1.SymbolOrBuilder getSymbolsOrBuilder( + int index); + + /** + *
+   * Confidence of the OCR results for the word. Range [0, 1].
+   * 
+ * + * float confidence = 4; + */ + float getConfidence(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/geometry.proto b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/geometry.proto new file mode 100644 index 000000000000..e3042b89d883 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/geometry.proto @@ -0,0 +1,76 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.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.vision.v1p3beta1; + +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "GeometryProto"; +option java_package = "com.google.cloud.vision.v1p3beta1"; + + +// A vertex represents a 2D point in the image. +// NOTE: the vertex coordinates are in the same scale as the original image. +message Vertex { + // X coordinate. + int32 x = 1; + + // Y coordinate. + int32 y = 2; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; +} + +// A bounding polygon for the detected image annotation. +message BoundingPoly { + // The bounding polygon vertices. + repeated Vertex vertices = 1; + + // The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 2; +} + +// A normalized bounding polygon around a portion of an image. +message NormalizedBoundingPoly { + // Normalized vertices of the bounding polygon. + repeated NormalizedVertex vertices = 1; +} + +// A 3D position in the image, used primarily for Face detection landmarks. +// A valid Position must have both x and y coordinates. +// The position coordinates are in the same scale as the original image. +message Position { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; + + // Z coordinate (or depth). + float z = 3; +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/image_annotator.proto b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/image_annotator.proto new file mode 100644 index 000000000000..ceb590176efe --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/image_annotator.proto @@ -0,0 +1,801 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.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.vision.v1p3beta1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1p3beta1/geometry.proto"; +import "google/cloud/vision/v1p3beta1/product_search.proto"; +import "google/cloud/vision/v1p3beta1/text_annotation.proto"; +import "google/cloud/vision/v1p3beta1/web_detection.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/color.proto"; +import "google/type/latlng.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "ImageAnnotatorProto"; +option java_package = "com.google.cloud.vision.v1p3beta1"; + + +// Service that performs Google Cloud Vision API detection tasks over client +// images, such as face, landmark, logo, label, and text detection. The +// ImageAnnotator service returns detected entities from the images. +service ImageAnnotator { + // Run image detection and annotation for a batch of images. + rpc BatchAnnotateImages(BatchAnnotateImagesRequest) returns (BatchAnnotateImagesResponse) { + option (google.api.http) = { + post: "/v1p3beta1/images:annotate" + body: "*" + }; + } + + // Run asynchronous image detection and annotation for a list of generic + // files, such as PDF files, which may contain multiple pages and multiple + // images per page. Progress and results can be retrieved through the + // `google.longrunning.Operations` interface. + // `Operation.metadata` contains `OperationMetadata` (metadata). + // `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + rpc AsyncBatchAnnotateFiles(AsyncBatchAnnotateFilesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p3beta1/files:asyncBatchAnnotate" + body: "*" + }; + } +} + +// The type of Google Cloud Vision API detection to perform, and the maximum +// number of results to return for that type. Multiple `Feature` objects can +// be specified in the `features` list. +message Feature { + // Type of Google Cloud Vision API feature to be extracted. + enum Type { + // Unspecified feature type. + TYPE_UNSPECIFIED = 0; + + // Run face detection. + FACE_DETECTION = 1; + + // Run landmark detection. + LANDMARK_DETECTION = 2; + + // Run logo detection. + LOGO_DETECTION = 3; + + // Run label detection. + LABEL_DETECTION = 4; + + // Run text detection / optical character recognition (OCR). Text detection + // is optimized for areas of text within a larger image; if the image is + // a document, use `DOCUMENT_TEXT_DETECTION` instead. + TEXT_DETECTION = 5; + + // Run dense text document OCR. Takes precedence when both + // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. + DOCUMENT_TEXT_DETECTION = 11; + + // Run Safe Search to detect potentially unsafe + // or undesirable content. + SAFE_SEARCH_DETECTION = 6; + + // Compute a set of image properties, such as the + // image's dominant colors. + IMAGE_PROPERTIES = 7; + + // Run crop hints. + CROP_HINTS = 9; + + // Run web detection. + WEB_DETECTION = 10; + + // Run Product Search. + PRODUCT_SEARCH = 12; + + // Run localizer for object detection. + OBJECT_LOCALIZATION = 19; + } + + // The feature type. + Type type = 1; + + // Maximum number of results of this type. Does not apply to + // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. + int32 max_results = 2; + + // Model to use for the feature. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 3; +} + +// External image source (Google Cloud Storage or web URL image location). +message ImageSource { + // **Use `image_uri` instead.** + // + // The Google Cloud Storage URI of the form + // `gs://bucket_name/object_name`. Object versioning is not supported. See + // [Google Cloud Storage Request + // URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. + string gcs_image_uri = 1; + + // The URI of the source image. Can be either: + // + // 1. A Google Cloud Storage URI of the form + // `gs://bucket_name/object_name`. Object versioning is not supported. See + // [Google Cloud Storage Request + // URIs](https://cloud.google.com/storage/docs/reference-uris) for more + // info. + // + // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + // HTTP/HTTPS URLs, Google cannot guarantee that the request will be + // completed. Your request may fail if the specified host denies the + // request (e.g. due to request throttling or DOS prevention), or if Google + // throttles requests to the site for abuse prevention. You should not + // depend on externally-hosted images for production applications. + // + // When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes + // precedence. + string image_uri = 2; +} + +// Client image to perform Google Cloud Vision API tasks over. +message Image { + // Image content, represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes content = 1; + + // Google Cloud Storage image location, or publicly-accessible image + // URL. If both `content` and `source` are provided for an image, `content` + // takes precedence and is used to perform the image annotation request. + ImageSource source = 2; +} + +// A face annotation object contains the results of face detection. +message FaceAnnotation { + // A face-specific landmark (for example, a face feature). + message Landmark { + // Face landmark (feature) type. + // Left and right are defined from the vantage of the viewer of the image + // without considering mirror projections typical of photos. So, `LEFT_EYE`, + // typically, is the person's right eye. + enum Type { + // Unknown face landmark detected. Should not be filled. + UNKNOWN_LANDMARK = 0; + + // Left eye. + LEFT_EYE = 1; + + // Right eye. + RIGHT_EYE = 2; + + // Left of left eyebrow. + LEFT_OF_LEFT_EYEBROW = 3; + + // Right of left eyebrow. + RIGHT_OF_LEFT_EYEBROW = 4; + + // Left of right eyebrow. + LEFT_OF_RIGHT_EYEBROW = 5; + + // Right of right eyebrow. + RIGHT_OF_RIGHT_EYEBROW = 6; + + // Midpoint between eyes. + MIDPOINT_BETWEEN_EYES = 7; + + // Nose tip. + NOSE_TIP = 8; + + // Upper lip. + UPPER_LIP = 9; + + // Lower lip. + LOWER_LIP = 10; + + // Mouth left. + MOUTH_LEFT = 11; + + // Mouth right. + MOUTH_RIGHT = 12; + + // Mouth center. + MOUTH_CENTER = 13; + + // Nose, bottom right. + NOSE_BOTTOM_RIGHT = 14; + + // Nose, bottom left. + NOSE_BOTTOM_LEFT = 15; + + // Nose, bottom center. + NOSE_BOTTOM_CENTER = 16; + + // Left eye, top boundary. + LEFT_EYE_TOP_BOUNDARY = 17; + + // Left eye, right corner. + LEFT_EYE_RIGHT_CORNER = 18; + + // Left eye, bottom boundary. + LEFT_EYE_BOTTOM_BOUNDARY = 19; + + // Left eye, left corner. + LEFT_EYE_LEFT_CORNER = 20; + + // Right eye, top boundary. + RIGHT_EYE_TOP_BOUNDARY = 21; + + // Right eye, right corner. + RIGHT_EYE_RIGHT_CORNER = 22; + + // Right eye, bottom boundary. + RIGHT_EYE_BOTTOM_BOUNDARY = 23; + + // Right eye, left corner. + RIGHT_EYE_LEFT_CORNER = 24; + + // Left eyebrow, upper midpoint. + LEFT_EYEBROW_UPPER_MIDPOINT = 25; + + // Right eyebrow, upper midpoint. + RIGHT_EYEBROW_UPPER_MIDPOINT = 26; + + // Left ear tragion. + LEFT_EAR_TRAGION = 27; + + // Right ear tragion. + RIGHT_EAR_TRAGION = 28; + + // Left eye pupil. + LEFT_EYE_PUPIL = 29; + + // Right eye pupil. + RIGHT_EYE_PUPIL = 30; + + // Forehead glabella. + FOREHEAD_GLABELLA = 31; + + // Chin gnathion. + CHIN_GNATHION = 32; + + // Chin left gonion. + CHIN_LEFT_GONION = 33; + + // Chin right gonion. + CHIN_RIGHT_GONION = 34; + } + + // Face landmark type. + Type type = 3; + + // Face landmark position. + Position position = 4; + } + + // The bounding polygon around the face. The coordinates of the bounding box + // are in the original image's scale, as returned in `ImageParams`. + // The bounding box is computed to "frame" the face in accordance with human + // expectations. It is based on the landmarker results. + // Note that one or more x and/or y coordinates may not be generated in the + // `BoundingPoly` (the polygon will be unbounded) if only a partial face + // appears in the image to be annotated. + BoundingPoly bounding_poly = 1; + + // The `fd_bounding_poly` bounding polygon is tighter than the + // `boundingPoly`, and encloses only the skin part of the face. Typically, it + // is used to eliminate the face from any image analysis that detects the + // "amount of skin" visible in an image. It is not based on the + // landmarker results, only on the initial face detection, hence + // the fd (face detection) prefix. + BoundingPoly fd_bounding_poly = 2; + + // Detected face landmarks. + repeated Landmark landmarks = 3; + + // Roll angle, which indicates the amount of clockwise/anti-clockwise rotation + // of the face relative to the image vertical about the axis perpendicular to + // the face. Range [-180,180]. + float roll_angle = 4; + + // Yaw angle, which indicates the leftward/rightward angle that the face is + // pointing relative to the vertical plane perpendicular to the image. Range + // [-180,180]. + float pan_angle = 5; + + // Pitch angle, which indicates the upwards/downwards angle that the face is + // pointing relative to the image's horizontal plane. Range [-180,180]. + float tilt_angle = 6; + + // Detection confidence. Range [0, 1]. + float detection_confidence = 7; + + // Face landmarking confidence. Range [0, 1]. + float landmarking_confidence = 8; + + // Joy likelihood. + Likelihood joy_likelihood = 9; + + // Sorrow likelihood. + Likelihood sorrow_likelihood = 10; + + // Anger likelihood. + Likelihood anger_likelihood = 11; + + // Surprise likelihood. + Likelihood surprise_likelihood = 12; + + // Under-exposed likelihood. + Likelihood under_exposed_likelihood = 13; + + // Blurred likelihood. + Likelihood blurred_likelihood = 14; + + // Headwear likelihood. + Likelihood headwear_likelihood = 15; +} + +// Detected entity location information. +message LocationInfo { + // lat/long location coordinates. + google.type.LatLng lat_lng = 1; +} + +// A `Property` consists of a user-supplied name/value pair. +message Property { + // Name of the property. + string name = 1; + + // Value of the property. + string value = 2; + + // Value of numeric properties. + uint64 uint64_value = 3; +} + +// Set of detected entity features. +message EntityAnnotation { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + string mid = 1; + + // The language code for the locale in which the entity textual + // `description` is expressed. + string locale = 2; + + // Entity textual description, expressed in its `locale` language. + string description = 3; + + // Overall score of the result. Range [0, 1]. + float score = 4; + + // **Deprecated. Use `score` instead.** + // The accuracy of the entity detection in an image. + // For example, for an image in which the "Eiffel Tower" entity is detected, + // this field represents the confidence that there is a tower in the query + // image. Range [0, 1]. + float confidence = 5; + + // The relevancy of the ICA (Image Content Annotation) label to the + // image. For example, the relevancy of "tower" is likely higher to an image + // containing the detected "Eiffel Tower" than to an image containing a + // detected distant towering building, even though the confidence that + // there is a tower in each image may be the same. Range [0, 1]. + float topicality = 6; + + // Image region to which this entity belongs. Not produced + // for `LABEL_DETECTION` features. + BoundingPoly bounding_poly = 7; + + // The location information for the detected entity. Multiple + // `LocationInfo` elements can be present because one location may + // indicate the location of the scene in the image, and another location + // may indicate the location of the place where the image was taken. + // Location information is usually present for landmarks. + repeated LocationInfo locations = 8; + + // Some entities may have optional user-supplied `Property` (name/value) + // fields, such a score or string that qualifies the entity. + repeated Property properties = 9; +} + +// Set of detected objects with bounding boxes. +message LocalizedObjectAnnotation { + // Object ID that should align with EntityAnnotation mid. + string mid = 1; + + // The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + string language_code = 2; + + // Object name, expressed in its `language_code` language. + string name = 3; + + // Score of the result. Range [0, 1]. + float score = 4; + + // Image region to which this object belongs. This must be populated. + BoundingPoly bounding_poly = 5; +} + +// Set of features pertaining to the image, computed by computer vision +// methods over safe-search verticals (for example, adult, spoof, medical, +// violence). +message SafeSearchAnnotation { + // Represents the adult content likelihood for the image. Adult content may + // contain elements such as nudity, pornographic images or cartoons, or + // sexual activities. + Likelihood adult = 1; + + // Spoof likelihood. The likelihood that an modification + // was made to the image's canonical version to make it appear + // funny or offensive. + Likelihood spoof = 2; + + // Likelihood that this is a medical image. + Likelihood medical = 3; + + // Likelihood that this image contains violent content. + Likelihood violence = 4; + + // Likelihood that the request image contains racy content. Racy content may + // include (but is not limited to) skimpy or sheer clothing, strategically + // covered nudity, lewd or provocative poses, or close-ups of sensitive + // body areas. + Likelihood racy = 9; +} + +// Rectangle determined by min and max `LatLng` pairs. +message LatLongRect { + // Min lat/long pair. + google.type.LatLng min_lat_lng = 1; + + // Max lat/long pair. + google.type.LatLng max_lat_lng = 2; +} + +// Color information consists of RGB channels, score, and the fraction of +// the image that the color occupies in the image. +message ColorInfo { + // RGB components of the color. + google.type.Color color = 1; + + // Image-specific score for this color. Value in range [0, 1]. + float score = 2; + + // The fraction of pixels the color occupies in the image. + // Value in range [0, 1]. + float pixel_fraction = 3; +} + +// Set of dominant colors and their corresponding scores. +message DominantColorsAnnotation { + // RGB color values with their score and pixel fraction. + repeated ColorInfo colors = 1; +} + +// Stores image properties, such as dominant colors. +message ImageProperties { + // If present, dominant colors completed successfully. + DominantColorsAnnotation dominant_colors = 1; +} + +// Single crop hint that is used to generate a new crop when serving an image. +message CropHint { + // The bounding polygon for the crop region. The coordinates of the bounding + // box are in the original image's scale, as returned in `ImageParams`. + BoundingPoly bounding_poly = 1; + + // Confidence of this being a salient region. Range [0, 1]. + float confidence = 2; + + // Fraction of importance of this salient region with respect to the original + // image. + float importance_fraction = 3; +} + +// Set of crop hints that are used to generate new crops when serving images. +message CropHintsAnnotation { + // Crop hint results. + repeated CropHint crop_hints = 1; +} + +// Parameters for crop hints annotation request. +message CropHintsParams { + // Aspect ratios in floats, representing the ratio of the width to the height + // of the image. For example, if the desired aspect ratio is 4/3, the + // corresponding float value should be 1.33333. If not specified, the + // best possible crop is returned. The number of provided aspect ratios is + // limited to a maximum of 16; any aspect ratios provided after the 16th are + // ignored. + repeated float aspect_ratios = 1; +} + +// Parameters for web detection request. +message WebDetectionParams { + // Whether to include results derived from the geo information in the image. + bool include_geo_results = 2; +} + +// Image context and/or feature-specific parameters. +message ImageContext { + // Not used. + LatLongRect lat_long_rect = 1; + + // List of languages to use for TEXT_DETECTION. In most cases, an empty value + // yields the best results since it enables automatic language detection. For + // languages based on the Latin alphabet, setting `language_hints` is not + // needed. In rare cases, when the language of the text in the image is known, + // setting a hint will help get better results (although it will be a + // significant hindrance if the hint is wrong). Text detection returns an + // error if one or more of the specified languages is not one of the + // [supported languages](/vision/docs/languages). + repeated string language_hints = 2; + + // Parameters for crop hints annotation request. + CropHintsParams crop_hints_params = 4; + + // Parameters for product search. + google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; + + // Parameters for web detection. + WebDetectionParams web_detection_params = 6; +} + +// Request for performing Google Cloud Vision API tasks over a user-provided +// image, with user-requested features. +message AnnotateImageRequest { + // The image to be processed. + Image image = 1; + + // Requested features. + repeated Feature features = 2; + + // Additional context that may accompany the image. + ImageContext image_context = 3; +} + +// If an image was produced from a file (e.g. a PDF), this message gives +// information about the source of that image. +message ImageAnnotationContext { + // The URI of the file used to produce the image. + string uri = 1; + + // If the file was a PDF or TIFF, this field gives the page number within + // the file used to produce the image. + int32 page_number = 2; +} + +// Response to an image annotation request. +message AnnotateImageResponse { + // If present, face detection has completed successfully. + repeated FaceAnnotation face_annotations = 1; + + // If present, landmark detection has completed successfully. + repeated EntityAnnotation landmark_annotations = 2; + + // If present, logo detection has completed successfully. + repeated EntityAnnotation logo_annotations = 3; + + // If present, label detection has completed successfully. + repeated EntityAnnotation label_annotations = 4; + + // If present, localized object detection has completed successfully. + // This will be sorted descending by confidence score. + repeated LocalizedObjectAnnotation localized_object_annotations = 22; + + // If present, text (OCR) detection has completed successfully. + repeated EntityAnnotation text_annotations = 5; + + // If present, text (OCR) detection or document (OCR) text detection has + // completed successfully. + // This annotation provides the structural hierarchy for the OCR detected + // text. + TextAnnotation full_text_annotation = 12; + + // If present, safe-search annotation has completed successfully. + SafeSearchAnnotation safe_search_annotation = 6; + + // If present, image properties were extracted successfully. + ImageProperties image_properties_annotation = 8; + + // If present, crop hints have completed successfully. + CropHintsAnnotation crop_hints_annotation = 11; + + // If present, web detection has completed successfully. + WebDetection web_detection = 13; + + // If present, product search has completed successfully. + google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = 14; + + // If set, represents the error message for the operation. + // Note that filled-in image annotations are guaranteed to be + // correct, even when `error` is set. + google.rpc.Status error = 9; + + // If present, contextual information is needed to understand where this image + // comes from. + ImageAnnotationContext context = 21; +} + +// Response to a single file annotation request. A file may contain one or more +// images, which individually have their own responses. +message AnnotateFileResponse { + // Information about the file for which this response is generated. + InputConfig input_config = 1; + + // Individual responses to images found within the file. + repeated AnnotateImageResponse responses = 2; +} + +// Multiple image annotation requests are batched into a single service call. +message BatchAnnotateImagesRequest { + // Individual image annotation requests for this batch. + repeated AnnotateImageRequest requests = 1; +} + +// Response to a batch image annotation request. +message BatchAnnotateImagesResponse { + // Individual responses to image annotation requests within the batch. + repeated AnnotateImageResponse responses = 1; +} + +// An offline file annotation request. +message AsyncAnnotateFileRequest { + // Required. Information about the input file. + InputConfig input_config = 1; + + // Required. Requested features. + repeated Feature features = 2; + + // Additional context that may accompany the image(s) in the file. + ImageContext image_context = 3; + + // Required. The desired output location and metadata (e.g. format). + OutputConfig output_config = 4; +} + +// The response for a single offline file annotation request. +message AsyncAnnotateFileResponse { + // The output location and metadata from AsyncAnnotateFileRequest. + OutputConfig output_config = 1; +} + +// Multiple async file annotation requests are batched into a single service +// call. +message AsyncBatchAnnotateFilesRequest { + // Individual async file annotation requests for this batch. + repeated AsyncAnnotateFileRequest requests = 1; +} + +// Response to an async batch file annotation request. +message AsyncBatchAnnotateFilesResponse { + // The list of file annotation responses, one for each request in + // AsyncBatchAnnotateFilesRequest. + repeated AsyncAnnotateFileResponse responses = 1; +}; + +// The desired input location and metadata. +message InputConfig { + // The Google Cloud Storage location to read the input from. + GcsSource gcs_source = 1; + + // The type of the file. Currently only "application/pdf" and "image/tiff" + // are supported. Wildcards are not supported. + string mime_type = 2; +} + +// The desired output location and metadata. +message OutputConfig { + // The Google Cloud Storage location to write the output(s) to. + GcsDestination gcs_destination = 1; + + // The max number of response protos to put into each output JSON file on + // Google Cloud Storage. + // The valid range is [1, 100]. If not specified, the default value is 20. + // + // For example, for one pdf file with 100 pages, 100 response protos will + // be generated. If `batch_size` = 20, then 5 json files each + // containing 20 response protos will be written under the prefix + // `gcs_destination`.`uri`. + // + // Currently, batch_size only applies to GcsDestination, with potential future + // support for other output configurations. + int32 batch_size = 2; +} + +// The Google Cloud Storage location where the input will be read from. +message GcsSource { + // Google Cloud Storage URI for the input file. This must only be a + // Google Cloud Storage object. Wildcards are not currently supported. + string uri = 1; +} + +// The Google Cloud Storage location where the output will be written to. +message GcsDestination { + // Google Cloud Storage URI where the results will be stored. Results will + // be in JSON format and preceded by its corresponding input URI. This field + // can either represent a single file, or a prefix for multiple outputs. + // Prefixes must end in a `/`. + // + // Examples: + // + // * File: gs://bucket-name/filename.json + // * Prefix: gs://bucket-name/prefix/here/ + // * File: gs://bucket-name/prefix/here + // + // If multiple outputs, each response is still AnnotateFileResponse, each of + // which contains some subset of the full list of AnnotateImageResponse. + // Multiple outputs can happen if, for example, the output JSON is too large + // and overflows into multiple sharded files. + string uri = 1; +} + +// A bucketized representation of likelihood, which is intended to give clients +// highly stable results across model upgrades. +enum Likelihood { + // Unknown likelihood. + UNKNOWN = 0; + + // It is very unlikely that the image belongs to the specified vertical. + VERY_UNLIKELY = 1; + + // It is unlikely that the image belongs to the specified vertical. + UNLIKELY = 2; + + // It is possible that the image belongs to the specified vertical. + POSSIBLE = 3; + + // It is likely that the image belongs to the specified vertical. + LIKELY = 4; + + // It is very likely that the image belongs to the specified vertical. + VERY_LIKELY = 5; +} + +// Contains metadata for the BatchAnnotateImages operation. +message OperationMetadata { + // Batch operation states. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is received. + CREATED = 1; + + // Request is actively being processed. + RUNNING = 2; + + // The batch processing is done. + DONE = 3; + + // The batch processing was cancelled. + CANCELLED = 4; + } + // Current state of the batch operation. + State state = 1; + + // The time when the batch request was received. + google.protobuf.Timestamp create_time = 5; + + // The time when the operation result was last updated. + google.protobuf.Timestamp update_time = 6; +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/product_search.proto b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/product_search.proto new file mode 100644 index 000000000000..85e4e0784e1c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/product_search.proto @@ -0,0 +1,161 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.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.vision.v1p3beta1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1p3beta1/geometry.proto"; +import "google/cloud/vision/v1p3beta1/product_search_service.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "ProductSearchProto"; +option java_package = "com.google.cloud.vision.v1p3beta1"; + + +// Parameters for a product search request. +message ProductSearchParams { + // The resource name of the catalog to search. + // + // Format is: `productSearch/catalogs/CATALOG_NAME`. + string catalog_name = 1; + + // The category to search in. + // Optional. It is inferred by the system if it is not specified. + // [Deprecated] Use `product_category`. + ProductSearchCategory category = 2; + + // The product category to search in. + // Optional. It is inferred by the system if it is not specified. + // Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`, + // `skirt`, `top`, `shorts`, and `pants`. + string product_category = 5; + + // The bounding polygon around the area of interest in the image. + // Optional. If it is not specified, system discretion will be applied. + // [Deprecated] Use `bounding_poly`. + NormalizedBoundingPoly normalized_bounding_poly = 3; + + // The bounding polygon around the area of interest in the image. + // Optional. If it is not specified, system discretion will be applied. + BoundingPoly bounding_poly = 9; + + // Specifies the verbosity of the product search results. + // Optional. Defaults to `BASIC`. + ProductSearchResultsView view = 4; + + // The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + string product_set = 6; + + // The list of product categories to search in. Currently, we only consider + // the first category, and either "homegoods" or "apparel" should be + // specified. + repeated string product_categories = 7; + + // The filtering expression. This can be used to restrict search results based + // on Product labels. We currently support an AND of OR of key-value + // expressions, where each expression within an OR must have the same key. + // + // For example, "(color = red OR color = blue) AND brand = Google" is + // acceptable, but not "(color = red OR brand = Google)" or "color: red". + string filter = 8; +} + +// Results for a product search request. +message ProductSearchResults { + // Information about a product. + message ProductInfo { + // Product ID. + string product_id = 1; + + // The URI of the image which matched the query image. + // + // This field is returned only if `view` is set to `FULL` in + // the request. + string image_uri = 2; + + // A confidence level on the match, ranging from 0 (no confidence) to + // 1 (full confidence). + // + // This field is returned only if `view` is set to `FULL` in + // the request. + float score = 3; + } + + // Information about a product. + message Result { + // The Product. + Product product = 1; + + // A confidence level on the match, ranging from 0 (no confidence) to + // 1 (full confidence). + // + // This field is returned only if `view` is set to `FULL` in + // the request. + float score = 2; + + // The resource name of the image from the product that is the closest match + // to the query. + string image = 3; + } + + // Product category. + // [Deprecated] Use `product_category`. + ProductSearchCategory category = 1; + + // Product category. + // Supported values are `bag` and `shoe`. + // [Deprecated] `product_category` is provided in each Product. + string product_category = 4; + + // Timestamp of the index which provided these results. Changes made after + // this time are not reflected in the current results. + google.protobuf.Timestamp index_time = 2; + + // List of detected products. + repeated ProductInfo products = 3; + + // List of results, one for each product match. + repeated Result results = 5; +} + +// Supported product search categories. +enum ProductSearchCategory { + // Default value used when a category is not specified. + PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0; + + // Shoes category. + SHOES = 1; + + // Bags category. + BAGS = 2; +} + +// Specifies the fields to include in product search results. +enum ProductSearchResultsView { + // Product search results contain only `product_category` and `product_id`. + // Default value. + BASIC = 0; + + // Product search results contain `product_category`, `product_id`, + // `image_uri`, and `score`. + FULL = 1; +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/product_search_service.proto b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/product_search_service.proto new file mode 100644 index 000000000000..90388e36e228 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/product_search_service.proto @@ -0,0 +1,825 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.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.vision.v1p3beta1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1p3beta1/geometry.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "ProductSearchServiceProto"; +option java_package = "com.google.cloud.vision.v1p3beta1"; + + +// Manages Products and ProductSets of reference images for use in product +// search. It uses the following resource model: +// +// - The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, named +// `projects/*/locations/*/productSets/*`, which acts as a way to put different +// products into groups to limit identification. +// +// In parallel, +// +// - The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, named +// `projects/*/locations/*/products/*` +// +// - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named +// `projects/*/locations/*/products/*/referenceImages/*` +service ProductSearch { + // Creates and returns a new ProductSet resource. + // + // Possible errors: + // + // * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + // 4096 characters. + rpc CreateProductSet(CreateProductSetRequest) returns (ProductSet) { + option (google.api.http) = { + post: "/v1p3beta1/{parent=projects/*/locations/*}/productSets" + body: "product_set" + }; + } + + // Lists ProductSets in an unspecified order. + // + // Possible errors: + // + // * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + // than 1. + rpc ListProductSets(ListProductSetsRequest) returns (ListProductSetsResponse) { + option (google.api.http) = { + get: "/v1p3beta1/{parent=projects/*/locations/*}/productSets" + }; + } + + // Gets information associated with a ProductSet. + // + // Possible errors: + // + // * Returns NOT_FOUND if the ProductSet does not exist. + rpc GetProductSet(GetProductSetRequest) returns (ProductSet) { + option (google.api.http) = { + get: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" + }; + } + + // Makes changes to a ProductSet resource. + // Only display_name can be updated currently. + // + // Possible errors: + // + // * Returns NOT_FOUND if the ProductSet does not exist. + // * Returns INVALID_ARGUMENT if display_name is present in update_mask but + // missing from the request or longer than 4096 characters. + rpc UpdateProductSet(UpdateProductSetRequest) returns (ProductSet) { + option (google.api.http) = { + patch: "/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}" + body: "product_set" + }; + } + + // Permanently deletes a ProductSet. All Products and ReferenceImages in the + // ProductSet will be deleted. + // + // The actual image files are not deleted from Google Cloud Storage. + // + // Possible errors: + // + // * Returns NOT_FOUND if the ProductSet does not exist. + rpc DeleteProductSet(DeleteProductSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" + }; + } + + // Creates and returns a new product resource. + // + // Possible errors: + // + // * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + // characters. + // * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + // * Returns INVALID_ARGUMENT if product_category is missing or invalid. + rpc CreateProduct(CreateProductRequest) returns (Product) { + option (google.api.http) = { + post: "/v1p3beta1/{parent=projects/*/locations/*}/products" + body: "product" + }; + } + + // Lists products in an unspecified order. + // + // Possible errors: + // + // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { + option (google.api.http) = { + get: "/v1p3beta1/{parent=projects/*/locations/*}/products" + }; + } + + // Gets information associated with a Product. + // + // Possible errors: + // + // * Returns NOT_FOUND if the Product does not exist. + rpc GetProduct(GetProductRequest) returns (Product) { + option (google.api.http) = { + get: "/v1p3beta1/{name=projects/*/locations/*/products/*}" + }; + } + + // Makes changes to a Product resource. + // Only display_name, description and labels can be updated right now. + // + // If labels are updated, the change will not be reflected in queries until + // the next index time. + // + // Possible errors: + // + // * Returns NOT_FOUND if the Product does not exist. + // * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + // missing from the request or longer than 4096 characters. + // * Returns INVALID_ARGUMENT if description is present in update_mask but is + // longer than 4096 characters. + // * Returns INVALID_ARGUMENT if product_category is present in update_mask. + rpc UpdateProduct(UpdateProductRequest) returns (Product) { + option (google.api.http) = { + patch: "/v1p3beta1/{product.name=projects/*/locations/*/products/*}" + body: "product" + }; + } + + // Permanently deletes a product and its reference images. + // + // Metadata of the product and all its images will be deleted right away, but + // search queries against ProductSets containing the product may still work + // until all related caches are refreshed. + // + // Possible errors: + // + // * Returns NOT_FOUND if the product does not exist. + rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p3beta1/{name=projects/*/locations/*/products/*}" + }; + } + + // Creates and returns a new ReferenceImage resource. + // + // The `bounding_poly` field is optional. If `bounding_poly` is not specified, + // the system will try to detect regions of interest in the image that are + // compatible with the product_category on the parent product. If it is + // specified, detection is ALWAYS skipped. The system converts polygons into + // non-rotated rectangles. + // + // Note that the pipeline will resize the image if the image resolution is too + // large to process (above 50MP). + // + // Possible errors: + // + // * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + // characters. + // * Returns INVALID_ARGUMENT if the product does not exist. + // * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + // compatible with the parent product's product_category is detected. + // * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. + rpc CreateReferenceImage(CreateReferenceImageRequest) returns (ReferenceImage) { + option (google.api.http) = { + post: "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" + body: "reference_image" + }; + } + + // Permanently deletes a reference image. + // + // The image metadata will be deleted right away, but search queries + // against ProductSets containing the image may still work until all related + // caches are refreshed. + // + // The actual image files are not deleted from Google Cloud Storage. + // + // Possible errors: + // + // * Returns NOT_FOUND if the reference image does not exist. + rpc DeleteReferenceImage(DeleteReferenceImageRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" + }; + } + + // Lists reference images. + // + // Possible errors: + // + // * Returns NOT_FOUND if the parent product does not exist. + // * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + // than 1. + rpc ListReferenceImages(ListReferenceImagesRequest) returns (ListReferenceImagesResponse) { + option (google.api.http) = { + get: "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" + }; + } + + // Gets information associated with a ReferenceImage. + // + // Possible errors: + // + // * Returns NOT_FOUND if the specified image does not exist. + rpc GetReferenceImage(GetReferenceImageRequest) returns (ReferenceImage) { + option (google.api.http) = { + get: "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" + }; + } + + // Adds a Product to the specified ProductSet. If the Product is already + // present, no change is made. + // + // One Product can be added to at most 100 ProductSets. + // + // Possible errors: + // + // * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + rpc AddProductToProductSet(AddProductToProductSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct" + body: "*" + }; + } + + // Removes a Product from the specified ProductSet. + // + // Possible errors: + // + // * Returns NOT_FOUND If the Product is not found under the ProductSet. + rpc RemoveProductFromProductSet(RemoveProductFromProductSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct" + body: "*" + }; + } + + // Lists the Products in a ProductSet, in an unspecified order. If the + // ProductSet does not exist, the products field of the response will be + // empty. + // + // Possible errors: + // + // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + rpc ListProductsInProductSet(ListProductsInProductSetRequest) returns (ListProductsInProductSetResponse) { + option (google.api.http) = { + get: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products" + }; + } + + // Asynchronous API that imports a list of reference images to specified + // product sets based on a list of image information. + // + // The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the + // progress and results of the request. + // `Operation.metadata` contains `BatchOperationMetadata`. (progress) + // `Operation.response` contains `ImportProductSetsResponse`. (results) + // + // The input source of this method is a csv file on Google Cloud Storage. + // For the format of the csv file please see + // [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + rpc ImportProductSets(ImportProductSetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p3beta1/{parent=projects/*/locations/*}/productSets:import" + body: "*" + }; + } +} + +// A Product contains ReferenceImages. +message Product { + // A product label represented as a key-value pair. + message KeyValue { + // The key of the label attached to the product. Cannot be empty and cannot + // exceed 128 bytes. + string key = 1; + + // The value of the label attached to the product. Cannot be empty and + // cannot exceed 128 bytes. + string value = 2; + } + + // The resource name of the product. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + // + // This field is ignored when creating a product. + string name = 1; + + // The user-provided name for this Product. Must not be empty. Must be at most + // 4096 characters long. + string display_name = 2; + + // User-provided metadata to be stored with this product. Must be at most 4096 + // characters long. + string description = 3; + + // The category for the product identified by the reference image. This should + // be either "homegoods" or "apparel". + // + // This field is immutable. + string product_category = 4; + + // Key-value pairs that can be attached to a product. At query time, + // constraints can be specified based on the product_labels. + // + // Note that integer values can be provided as strings, e.g. "1199". Only + // strings with integer values can match a range-based restriction which is + // to be supported soon. + // + // Multiple values can be assigned to the same key. One product may have up to + // 100 product_labels. + repeated KeyValue product_labels = 5; +} + +// A ProductSet contains Products. A ProductSet can contain a maximum of 1 +// million reference images. If the limit is exceeded, periodic indexing will +// fail. +message ProductSet { + // The resource name of the ProductSet. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + // + // This field is ignored when creating a ProductSet. + string name = 1; + + // The user-provided name for this ProductSet. Must not be empty. Must be at + // most 4096 characters long. + string display_name = 2; + + // Output only. The time at which this ProductSet was last indexed. Query + // results will reflect all updates before this time. If this ProductSet has + // never been indexed, this field is 0. + // + // This field is ignored when creating a ProductSet. + google.protobuf.Timestamp index_time = 3; + + // Output only. If there was an error with indexing the product set, the field + // is populated. + // + // This field is ignored when creating a ProductSet. + google.rpc.Status index_error = 4; +} + +// A `ReferenceImage` represents a product image and its associated metadata, +// such as bounding boxes. +message ReferenceImage { + // The resource name of the reference image. + // + // Format is: + // + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + // + // This field is ignored when creating a reference image. + string name = 1; + + // The Google Cloud Storage URI of the reference image. + // + // The URI must start with `gs://`. + // + // Required. + string uri = 2; + + // Bounding polygons around the areas of interest in the reference image. + // Optional. If this field is empty, the system will try to detect regions of + // interest. At most 10 bounding polygons will be used. + // + // The provided shape is converted into a non-rotated rectangle. Once + // converted, the small edge of the rectangle must be greater than or equal + // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 + // is not). + repeated BoundingPoly bounding_polys = 3; +} + +// Request message for the `CreateProduct` method. +message CreateProductRequest { + // The project in which the Product should be created. + // + // Format is + // `projects/PROJECT_ID/locations/LOC_ID`. + string parent = 1; + + // The product to create. + Product product = 2; + + // A user-supplied resource id for this Product. If set, the server will + // attempt to use this value as the resource id. If it is already in use, an + // error is returned with code ALREADY_EXISTS. Must be at most 128 characters + // long. It cannot contain the character `/`. + string product_id = 3; +} + +// Request message for the `ListProducts` method. +message ListProductsRequest { + // The project OR ProductSet from which Products should be listed. + // + // Format: + // `projects/PROJECT_ID/locations/LOC_ID` + string parent = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // The next_page_token returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for the `ListProducts` method. +message ListProductsResponse { + // List of products. + repeated Product products = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for the `GetProduct` method. +message GetProductRequest { + // Resource name of the Product to get. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + string name = 1; +} + +// Request message for the `UpdateProduct` method. +message UpdateProductRequest { + // The Product resource which replaces the one on the server. + // product.name is immutable. + Product product = 1; + + // The [FieldMask][google.protobuf.FieldMask] that specifies which fields + // to update. + // If update_mask isn't specified, all mutable fields are to be updated. + // Valid mask paths include `product_labels`, `display_name` and + // `description`. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for the `DeleteProduct` method. +message DeleteProductRequest { + // Resource name of product to delete. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + string name = 1; +} + +// Request message for the `CreateProductSet` method. +message CreateProductSetRequest { + // The project in which the ProductSet should be created. + // + // Format is `projects/PROJECT_ID/locations/LOC_ID`. + string parent = 1; + + // The ProductSet to create. + ProductSet product_set = 2; + + // A user-supplied resource id for this ProductSet. If set, the server will + // attempt to use this value as the resource id. If it is already in use, an + // error is returned with code ALREADY_EXISTS. Must be at most 128 characters + // long. It cannot contain the character `/`. + string product_set_id = 3; +} + +// Request message for the `ListProductSets` method. +message ListProductSetsRequest { + // The project from which ProductSets should be listed. + // + // Format is `projects/PROJECT_ID/locations/LOC_ID`. + string parent = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // The next_page_token returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for the `ListProductSets` method. +message ListProductSetsResponse { + // List of ProductSets. + repeated ProductSet product_sets = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for the `GetProductSet` method. +message GetProductSetRequest { + // Resource name of the ProductSet to get. + // + // Format is: + // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` + string name = 1; +} + +// Request message for the `UpdateProductSet` method. +message UpdateProductSetRequest { + // The ProductSet resource which replaces the one on the server. + ProductSet product_set = 1; + + // The [FieldMask][google.protobuf.FieldMask] that specifies which fields to + // update. + // If update_mask isn't specified, all mutable fields are to be updated. + // Valid mask path is `display_name`. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for the `DeleteProductSet` method. +message DeleteProductSetRequest { + // Resource name of the ProductSet to delete. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + string name = 1; +} + +// Request message for the `CreateReferenceImage` method. +message CreateReferenceImageRequest { + // Resource name of the product in which to create the reference image. + // + // Format is + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + string parent = 1; + + // The reference image to create. + // If an image ID is specified, it is ignored. + ReferenceImage reference_image = 2; + + // A user-supplied resource id for the ReferenceImage to be added. If set, + // the server will attempt to use this value as the resource id. If it is + // already in use, an error is returned with code ALREADY_EXISTS. Must be at + // most 128 characters long. It cannot contain the character `/`. + string reference_image_id = 3; +} + +// Request message for the `ListReferenceImages` method. +message ListReferenceImagesRequest { + // Resource name of the product containing the reference images. + // + // Format is + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + string parent = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // A token identifying a page of results to be returned. This is the value + // of `nextPageToken` returned in a previous reference image list request. + // + // Defaults to the first page if not specified. + string page_token = 3; +} + +// Response message for the `ListReferenceImages` method. +message ListReferenceImagesResponse { + // The list of reference images. + repeated ReferenceImage reference_images = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // The next_page_token returned from a previous List request, if any. + string next_page_token = 3; +} + +// Request message for the `GetReferenceImage` method. +message GetReferenceImageRequest { + // The resource name of the ReferenceImage to get. + // + // Format is: + // + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + string name = 1; +} + +// Request message for the `DeleteReferenceImage` method. +message DeleteReferenceImageRequest { + // The resource name of the reference image to delete. + // + // Format is: + // + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + string name = 1; +} + +// Request message for the `AddProductToProductSet` method. +message AddProductToProductSetRequest { + // The resource name for the ProductSet to modify. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + string name = 1; + + // The resource name for the Product to be added to this ProductSet. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + string product = 2; +} + +// Request message for the `RemoveProductFromProductSet` method. +message RemoveProductFromProductSetRequest { + // The resource name for the ProductSet to modify. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + string name = 1; + + // The resource name for the Product to be removed from this ProductSet. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + string product = 2; +} + +// Request message for the `ListProductsInProductSet` method. +message ListProductsInProductSetRequest { + // The ProductSet resource for which to retrieve Products. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + string name = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // The next_page_token returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for the `ListProductsInProductSet` method. +message ListProductsInProductSetResponse { + // The list of Products. + repeated Product products = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The Google Cloud Storage location for a csv file which preserves a list of +// ImportProductSetRequests in each line. +message ImportProductSetsGcsSource { + // The Google Cloud Storage URI of the input csv file. + // + // The URI must start with gs:// + // + // The format of the input csv file should be one image per line. + // In each line, there are 6 columns. + // 1. image_uri + // 2, image_id + // 3. product_set_id + // 4. product_id + // 5, product_category + // 6, product_display_name + // 7, labels + // 8. bounding_poly + // + // Columns 1, 3, 4, and 5 are required, other columns are optional. A new + // ProductSet/Product with the same id will be created on the fly + // if the ProductSet/Product specified by product_set_id/product_id does not + // exist. + // + // The image_id field is optional but has to be unique if provided. If it is + // empty, we will automatically assign an unique id to the image. + // + // The product_display_name field is optional. If it is empty, a space (" ") + // is used as the place holder for the product display_name, which can + // be updated later through the realtime API. + // + // If the Product with product_id already exists, the fields + // product_display_name, product_category and labels are ignored. + // + // If a Product doesn't exist and needs to be created on the fly, the + // product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the + // product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the + // labels field refers to [Product.labels][]. + // + // Labels (optional) should be a line containing a list of comma-separated + // key-value pairs, with the format + // "key_1=value_1,key_2=value_2,...,key_n=value_n". + // + // The bounding_poly (optional) field is used to identify one region of + // interest from the image in the same manner as CreateReferenceImage. If no + // bounding_poly is specified, the system will try to detect regions of + // interest automatically. + // + // Note that the pipeline will resize the image if the image resolution is too + // large to process (above 20MP). + // + // Also note that at most one bounding_poly is allowed per line. If the image + // contains multiple regions of interest, the csv should contain one line per + // region of interest. + // + // The bounding_poly column should contain an even number of comma-separated + // numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative + // integers should be used for absolute bounding polygons, and float values + // in [0, 1] should be used for normalized bounding polygons. + string csv_file_uri = 1; +} + +// The input content for the `ImportProductSets` method. +message ImportProductSetsInputConfig { + // The source of the input. + oneof source { + // The Google Cloud Storage location for a csv file which preserves a list + // of ImportProductSetRequests in each line. + ImportProductSetsGcsSource gcs_source = 1; + } +} + +// Request message for the `ImportProductSets` method. +message ImportProductSetsRequest { + // The project in which the ProductSets should be imported. + // + // Format is `projects/PROJECT_ID/locations/LOC_ID`. + string parent = 1; + + // The input content for the list of requests. + ImportProductSetsInputConfig input_config = 2; +} + +// Response message for the `ImportProductSets` method. +// +// This message is returned by the +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. +message ImportProductSetsResponse { + // The list of reference_images that are imported successfully. + repeated ReferenceImage reference_images = 1; + + // The rpc status for each ImportProductSet request, including both successes + // and errors. + // + // The number of statuses here matches the number of lines in the csv file, + // and statuses[i] stores the success or failure status of processing the i-th + // line of the csv, starting from line 0. + repeated google.rpc.Status statuses = 2; +} + +// Metadata for the batch operations such as the current state. +// +// This is included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +message BatchOperationMetadata { + // Enumerates the possible states that the batch request can be in. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is actively being processed. + PROCESSING = 1; + + // The request is done and at least one item has been successfully + // processed. + SUCCESSFUL = 2; + + // The request is done and no item has been successfully processed. + FAILED = 3; + + // The request is done after the longrunning.Operations.CancelOperation has + // been called by the user. Any records that were processed before the + // cancel command are output as specified in the request. + CANCELLED = 4; + } + + // The current state of the batch operation. + State state = 1; + + // The time when the batch request was submitted to the server. + google.protobuf.Timestamp submit_time = 2; + + // The time when the batch request is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. + google.protobuf.Timestamp end_time = 3; +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/text_annotation.proto b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/text_annotation.proto new file mode 100644 index 000000000000..0856b7f95a44 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/text_annotation.proto @@ -0,0 +1,259 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.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.vision.v1p3beta1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1p3beta1/geometry.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "TextAnnotationProto"; +option java_package = "com.google.cloud.vision.v1p3beta1"; + + +// TextAnnotation contains a structured representation of OCR extracted text. +// The hierarchy of an OCR extracted text structure is like this: +// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol +// Each structural component, starting from Page, may further have their own +// properties. Properties describe detected languages, breaks etc.. Please refer +// to the [TextAnnotation.TextProperty][google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty] message definition below for more +// detail. +message TextAnnotation { + // Detected language for a structural component. + message DetectedLanguage { + // The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + string language_code = 1; + + // Confidence of detected language. Range [0, 1]. + float confidence = 2; + } + + // Detected start or end of a structural component. + message DetectedBreak { + // Enum to denote the type of break found. New line, space etc. + enum BreakType { + // Unknown break label type. + UNKNOWN = 0; + + // Regular space. + SPACE = 1; + + // Sure space (very wide). + SURE_SPACE = 2; + + // Line-wrapping break. + EOL_SURE_SPACE = 3; + + // End-line hyphen that is not present in text; does not co-occur with + // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + HYPHEN = 4; + + // Line break that ends a paragraph. + LINE_BREAK = 5; + } + + // Detected break type. + BreakType type = 1; + + // True if break prepends the element. + bool is_prefix = 2; + } + + // Additional information detected on the structural component. + message TextProperty { + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 1; + + // Detected start or end of a text segment. + DetectedBreak detected_break = 2; + } + + // List of pages detected by OCR. + repeated Page pages = 1; + + // UTF-8 text detected on the pages. + string text = 2; +} + +// Detected page from OCR. +message Page { + // Additional information detected on the page. + TextAnnotation.TextProperty property = 1; + + // Page width. For PDFs the unit is points. For images (including + // TIFFs) the unit is pixels. + int32 width = 2; + + // Page height. For PDFs the unit is points. For images (including + // TIFFs) the unit is pixels. + int32 height = 3; + + // List of blocks of text, images etc on this page. + repeated Block blocks = 4; + + // Confidence of the OCR results on the page. Range [0, 1]. + float confidence = 5; +} + +// Logical element on the page. +message Block { + // Type of a block (text, image etc) as identified by OCR. + enum BlockType { + // Unknown block type. + UNKNOWN = 0; + + // Regular text block. + TEXT = 1; + + // Table block. + TABLE = 2; + + // Image block. + PICTURE = 3; + + // Horizontal/vertical line box. + RULER = 4; + + // Barcode block. + BARCODE = 5; + } + + // Additional information detected for the block. + TextAnnotation.TextProperty property = 1; + + // The bounding box for the block. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // + // * when the text is horizontal it might look like: + // + // 0----1 + // | | + // 3----2 + // + // * when it's rotated 180 degrees around the top-left corner it becomes: + // + // 2----3 + // | | + // 1----0 + // + // and the vertice order will still be (0, 1, 2, 3). + BoundingPoly bounding_box = 2; + + // List of paragraphs in this block (if this blocks is of type text). + repeated Paragraph paragraphs = 3; + + // Detected block type (text, image etc) for this block. + BlockType block_type = 4; + + // Confidence of the OCR results on the block. Range [0, 1]. + float confidence = 5; +} + +// Structural unit of text representing a number of words in certain order. +message Paragraph { + // Additional information detected for the paragraph. + TextAnnotation.TextProperty property = 1; + + // The bounding box for the paragraph. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingPoly bounding_box = 2; + + // List of words in this paragraph. + repeated Word words = 3; + + // Confidence of the OCR results for the paragraph. Range [0, 1]. + float confidence = 4; +} + +// A word representation. +message Word { + // Additional information detected for the word. + TextAnnotation.TextProperty property = 1; + + // The bounding box for the word. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingPoly bounding_box = 2; + + // List of symbols in the word. + // The order of the symbols follows the natural reading order. + repeated Symbol symbols = 3; + + // Confidence of the OCR results for the word. Range [0, 1]. + float confidence = 4; +} + +// A single symbol representation. +message Symbol { + // Additional information detected for the symbol. + TextAnnotation.TextProperty property = 1; + + // The bounding box for the symbol. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingPoly bounding_box = 2; + + // The actual UTF-8 representation of the symbol. + string text = 3; + + // Confidence of the OCR results for the symbol. Range [0, 1]. + float confidence = 4; +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/web_detection.proto b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/web_detection.proto new file mode 100644 index 000000000000..ac63b3b8dff6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p3beta1/src/main/proto/google/cloud/vision/v1p3beta1/web_detection.proto @@ -0,0 +1,105 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.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.vision.v1p3beta1; + +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "WebDetectionProto"; +option java_package = "com.google.cloud.vision.v1p3beta1"; + + +// Relevant information for the image from the Internet. +message WebDetection { + // Entity deduced from similar images on the Internet. + message WebEntity { + // Opaque entity ID. + string entity_id = 1; + + // Overall relevancy score for the entity. + // Not normalized and not comparable across different image queries. + float score = 2; + + // Canonical description of the entity, in English. + string description = 3; + } + + // Metadata for online images. + message WebImage { + // The result image URL. + string url = 1; + + // (Deprecated) Overall relevancy score for the image. + float score = 2; + } + + // Metadata for web pages. + message WebPage { + // The result web page URL. + string url = 1; + + // (Deprecated) Overall relevancy score for the web page. + float score = 2; + + // Title for the web page, may contain HTML markups. + string page_title = 3; + + // Fully matching images on the page. + // Can include resized copies of the query image. + repeated WebImage full_matching_images = 4; + + // Partial matching images on the page. + // Those images are similar enough to share some key-point features. For + // example an original image will likely have partial matching for its + // crops. + repeated WebImage partial_matching_images = 5; + } + + // Label to provide extra metadata for the web detection. + message WebLabel { + // Label for extra metadata. + string label = 1; + + // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". + // For more information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + string language_code = 2; + } + + // Deduced entities from similar images on the Internet. + repeated WebEntity web_entities = 1; + + // Fully matching images from the Internet. + // Can include resized copies of the query image. + repeated WebImage full_matching_images = 2; + + // Partial matching images from the Internet. + // Those images are similar enough to share some key-point features. For + // example an original image will likely have partial matching for its crops. + repeated WebImage partial_matching_images = 3; + + // Web pages containing the matching images from the Internet. + repeated WebPage pages_with_matching_images = 4; + + // The visually similar image results. + repeated WebImage visually_similar_images = 6; + + // Best guess text labels for the request image. + repeated WebLabel best_guess_labels = 8; +} diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 4c04217cc3c0..a5523b92bd8c 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -220,11 +220,11 @@
- + 0.54.1-beta-SNAPSHOT + com.google.api.grpc proto-google-cloud-automl-v1beta1 @@ -929,16 +929,16 @@ grpc-google-cloud-vision-v1p2beta1 1.18.1-SNAPSHOT - com.google.api.grpc grpc-google-cloud-vision-v1p3beta1 - 0.19.1-SNAPSHOT - --> + 0.19.1-SNAPSHOT + com.google.cloud google-cloud-video-intelligence diff --git a/google-cloud-clients/google-cloud-automl/README.md b/google-cloud-clients/google-cloud-automl/README.md new file mode 100644 index 000000000000..759768ec9522 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/README.md @@ -0,0 +1,102 @@ +Google Cloud Java Client for Cloud Auto ML +=================================================== + +Java idiomatic client for [Cloud Auto ML][cloud-automl]. + +[![CircleCI](https://circleci.com/gh/GoogleCloudPlatform/google-cloud-java/tree/master.svg?style=shield)](https://circleci.com/gh/GoogleCloudPlatform/google-cloud-java/tree/master) +[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/google-cloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/google-cloud-java?branch=master) +[![Maven](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-automl.svg)](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-automl.svg) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/google-cloud-java) +[![Dependency Status](https://www.versioneye.com/user/projects/58fe4c8d6ac171426c414772/badge.svg?style=flat)](https://www.versioneye.com/user/projects/58fe4c8d6ac171426c414772) + +- [Product Documentation][automl-product-docs] +- [Client Library Documentation][automl-client-lib-docs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +Quickstart +---------- + +[//]: # ({x-version-update-start:google-cloud-automl:released}) +If you are using Maven, add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-automl + 0.54.0-alpha + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-automl:0.54.0-alpha' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-automl" % "0.54.0-alpha" +``` +[//]: # ({x-version-update-end}) + +Authentication +-------------- + +See the [Authentication](https://github.com/GoogleCloudPlatform/google-cloud-java#authentication) section in the base directory's README. + +About Cloud Auto ML +---------------------------- + +[Cloud Auto ML][cloud-automl] is a web security scanner for common vulnerabilities in Google App Engine applications. + +See the [Cloud Auto ML client library docs][automl-client-lib-docs] to learn how to use this Cloud Auto ML Client Library. + +Getting Started +--------------- +#### Prerequisites +You will need a [Google Developers Console](https://console.developers.google.com/) project with the Cloud Auto ML API enabled. [Follow these instructions](https://cloud.google.com/docs/authentication#preparation) to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +#### Installation and setup +You'll need to obtain the `google-cloud-automl` library. See the [Quickstart](#quickstart) section to add `google-cloud-automl` as a dependency in your code. + +Troubleshooting +--------------- + +To get help, follow the instructions in the [shared Troubleshooting document](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/troubleshooting/readme.md#troubleshooting). + +Transport +--------- +Cloud Auto ML uses gRPC for the transport layer. + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Versioning +---------- + +This library follows [Semantic Versioning](http://semver.org/). + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time and the public API should not be considered stable. + +Contributing +------------ + +Contributions to this library are always welcome and highly encouraged. + +See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + +License +------- + +Apache 2.0 - See [LICENSE] for more information. + + +[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CONTRIBUTING.md +[code-of-conduct]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[LICENSE]: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/LICENSE +[cloud-platform]: https://cloud.google.com/ +[cloud-automl]: https://cloud.google.com/security-scanner +[automl-product-docs]: https://cloud.google.com/automl/ +[automl-client-lib-docs]: https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/index.html?com/google/cloud/automl/v1beta1/package-summary.html diff --git a/google-cloud-clients/google-cloud-automl/pom.xml b/google-cloud-clients/google-cloud-automl/pom.xml new file mode 100644 index 000000000000..e4437cc122bb --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + google-cloud-automl + 0.54.1-beta-SNAPSHOT + jar + Google Cloud Web Security Scanner + https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-automl + + Java idiomatic client for Google Cloud Web Security Scanner + + + com.google.cloud + google-cloud-clients + 0.54.1-alpha-SNAPSHOT + + + google-cloud-automl + + + + ${project.groupId} + google-cloud-core + + + ${project.groupId} + google-cloud-core-grpc + + + com.google.api.grpc + proto-google-cloud-automl-v1beta1 + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-stub + + + io.grpc + grpc-auth + + + ${project.groupId} + google-cloud-core + test-jar + test + + + junit + junit + test + + + com.google.api.grpc + grpc-google-cloud-automl-v1beta1 + test + + + com.google.api + gax-grpc + testlib + test + + + diff --git a/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java new file mode 100644 index 000000000000..bb9cbc808874 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java @@ -0,0 +1,2090 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +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.v1beta1.stub.AutoMlStub; +import com.google.cloud.automl.v1beta1.stub.AutoMlStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// 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}`. + * + *

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();
+ *   Dataset 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();
+   *   Dataset 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 Dataset 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();
+   *   Dataset 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 Dataset 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();
+   *   Dataset 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 Dataset 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<Dataset> future = autoMlClient.createDatasetCallable().futureCall(request);
+   *   // Do something
+   *   Dataset response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createDatasetCallable() { + return stub.createDatasetCallable(); + } + + // 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 + */ + private 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]");
+   *   Empty response = 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]");
+   *   Empty response = 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();
+   *   Empty response = 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.") + private 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<Operation> future = autoMlClient.deleteDatasetOperationCallable().futureCall(request);
+   *   // Do something
+   *   Empty response = 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. 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]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   Empty response = 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. + * @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. 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]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   Empty response = 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. + * @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. 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]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataRequest request = ImportDataRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   Empty response = 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. 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]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataRequest request = ImportDataRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   OperationFuture<Operation> future = autoMlClient.importDataOperationCallable().futureCall(request);
+   *   // Do something
+   *   Empty response = 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. 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]");
+   *   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 a Google Cloud Storage bucket. 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();
+   *   Empty response = 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 a Google Cloud Storage bucket. 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();
+   *   Empty response = 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 a Google Cloud Storage bucket. 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();
+   *   Empty response = 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 a Google Cloud Storage bucket. 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<Operation> future = autoMlClient.exportDataOperationCallable().futureCall(request);
+   *   // Do something
+   *   Empty response = 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 a Google Cloud Storage bucket. 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<Operation> 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 + */ + private 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 + /** + * 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. If a model is already deployed, this only deletes the model in AutoML BE, and + * does not change the status of the deployed model in the production environment. 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]");
+   *   Empty response = 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. If a model is already deployed, this only deletes the model in AutoML BE, and + * does not change the status of the deployed model in the production environment. 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]");
+   *   Empty response = 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. If a model is already deployed, this only deletes the model in AutoML BE, and + * does not change the status of the deployed model in the production environment. 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();
+   *   Empty response = 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.") + private final OperationFuture deleteModelAsync( + DeleteModelRequest request) { + return deleteModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. If a model is already deployed, this only deletes the model in AutoML BE, and + * does not change the status of the deployed model in the production environment. 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<Operation> future = autoMlClient.deleteModelOperationCallable().futureCall(request);
+   *   // Do something
+   *   Empty response = 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. If a model is already deployed, this only deletes the model in AutoML BE, and + * does not change the status of the deployed model in the production environment. 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 + /** + * Deploys model. Returns a [DeployModelResponse][] in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   Operation response = autoMlClient.deployModel(name);
+   * }
+   * 
+ * + * @param name Resource name of the model to deploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation deployModel(ModelName name) { + + DeployModelRequest request = + DeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deployModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deploys model. Returns a [DeployModelResponse][] in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   Operation response = autoMlClient.deployModel(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the model to deploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation deployModel(String name) { + + DeployModelRequest request = DeployModelRequest.newBuilder().setName(name).build(); + return deployModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deploys model. Returns a [DeployModelResponse][] in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Operation response = autoMlClient.deployModel(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 + */ + private final Operation deployModel(DeployModelRequest request) { + return deployModelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deploys model. Returns a [DeployModelResponse][] in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.deployModelCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deployModelCallable() { + return stub.deployModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys model. Returns an `UndeployModelResponse` in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   Operation response = autoMlClient.undeployModel(name);
+   * }
+   * 
+ * + * @param name Resource name of the model to undeploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation undeployModel(ModelName name) { + + UndeployModelRequest request = + UndeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return undeployModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys model. Returns an `UndeployModelResponse` in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   Operation response = autoMlClient.undeployModel(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the model to undeploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation undeployModel(String name) { + + UndeployModelRequest request = UndeployModelRequest.newBuilder().setName(name).build(); + return undeployModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys model. Returns an `UndeployModelResponse` in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Operation response = autoMlClient.undeployModel(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 + */ + private final Operation undeployModel(UndeployModelRequest request) { + return undeployModelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys model. Returns an `UndeployModelResponse` in the + * [response][google.longrunning.Operation.response] field when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable undeployModelCallable() { + return stub.undeployModelCallable(); + } + + // 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 + */ + private 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]");
+   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelEvaluationsPagedResponse listModelEvaluations(ModelName parent) { + ListModelEvaluationsRequest request = + ListModelEvaluationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .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]");
+   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent.toString()).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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelEvaluationsPagedResponse listModelEvaluations(String parent) { + ListModelEvaluationsRequest request = + ListModelEvaluationsRequest.newBuilder().setParent(parent).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]");
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .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]");
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .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]");
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .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); + } + }); + } + + 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); + } + }); + } + + 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); + } + }); + } + + 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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java new file mode 100644 index 000000000000..198a22d71807 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java @@ -0,0 +1,404 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1beta1.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.v1beta1.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 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 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 deployModel. */ + public UnaryCallSettings deployModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).deployModelSettings(); + } + + /** Returns the object with the settings used for calls to undeployModel. */ + public UnaryCallSettings undeployModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).undeployModelSettings(); + } + + /** Returns the object with the settings used for calls to 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 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 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 deployModel. */ + public UnaryCallSettings.Builder deployModelSettings() { + return getStubSettingsBuilder().deployModelSettings(); + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + public UnaryCallSettings.Builder undeployModelSettings() { + return getStubSettingsBuilder().undeployModelSettings(); + } + + /** Returns the builder for the settings used for calls to 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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceClient.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceClient.java new file mode 100644 index 000000000000..ca705d3974b5 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceClient.java @@ -0,0 +1,301 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +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.v1beta1.stub.PredictionServiceStub; +import com.google.cloud.automl.v1beta1.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. + * + *

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 a prediction. + * + *

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. + *

* For Image Classification: + *

`score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions + * for an image, it will only produce results that have at least this confidence score + * threshold. The default is 0.5. + * @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 a prediction. + * + *

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. + *

* For Image Classification: + *

`score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions + * for an image, it will only produce results that have at least this confidence score + * threshold. The default is 0.5. + * @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 a prediction. + * + *

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 a prediction. + * + *

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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceSettings.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceSettings.java new file mode 100644 index 000000000000..04484e7a32d0 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceSettings.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.automl.v1beta1.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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/package-info.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/package-info.java new file mode 100644 index 000000000000..78c349836a5f --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/package-info.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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. + * + *

======================= PredictionServiceClient ======================= + * + *

Service Description: AutoML Prediction API. + * + *

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);
+ * }
+ * 
+ * 
+ * + * ============ 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}`. + * + *

Sample for AutoMlClient: + * + *

+ * 
+ * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Dataset dataset = Dataset.newBuilder().build();
+ *   Dataset response = autoMlClient.createDataset(parent, dataset);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.automl.v1beta1; diff --git a/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java new file mode 100644 index 000000000000..4cb2ca1a4388 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java @@ -0,0 +1,169 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.stub; + +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1beta1.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.v1beta1.CreateDatasetRequest; +import com.google.cloud.automl.v1beta1.CreateModelRequest; +import com.google.cloud.automl.v1beta1.Dataset; +import com.google.cloud.automl.v1beta1.DeleteDatasetRequest; +import com.google.cloud.automl.v1beta1.DeleteModelRequest; +import com.google.cloud.automl.v1beta1.DeployModelRequest; +import com.google.cloud.automl.v1beta1.ExportDataRequest; +import com.google.cloud.automl.v1beta1.GetDatasetRequest; +import com.google.cloud.automl.v1beta1.GetModelEvaluationRequest; +import com.google.cloud.automl.v1beta1.GetModelRequest; +import com.google.cloud.automl.v1beta1.ImportDataRequest; +import com.google.cloud.automl.v1beta1.ListDatasetsRequest; +import com.google.cloud.automl.v1beta1.ListDatasetsResponse; +import com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest; +import com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse; +import com.google.cloud.automl.v1beta1.ListModelsRequest; +import com.google.cloud.automl.v1beta1.ListModelsResponse; +import com.google.cloud.automl.v1beta1.Model; +import com.google.cloud.automl.v1beta1.ModelEvaluation; +import com.google.cloud.automl.v1beta1.OperationMetadata; +import com.google.cloud.automl.v1beta1.UndeployModelRequest; +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 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 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 deployModelCallable() { + throw new UnsupportedOperationException("Not implemented: deployModelCallable()"); + } + + public UnaryCallable undeployModelCallable() { + throw new UnsupportedOperationException("Not implemented: undeployModelCallable()"); + } + + 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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStubSettings.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStubSettings.java new file mode 100644 index 000000000000..066c763e6f30 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStubSettings.java @@ -0,0 +1,1018 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.stub; + +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1beta1.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.v1beta1.CreateDatasetRequest; +import com.google.cloud.automl.v1beta1.CreateModelRequest; +import com.google.cloud.automl.v1beta1.Dataset; +import com.google.cloud.automl.v1beta1.DeleteDatasetRequest; +import com.google.cloud.automl.v1beta1.DeleteModelRequest; +import com.google.cloud.automl.v1beta1.DeployModelRequest; +import com.google.cloud.automl.v1beta1.ExportDataRequest; +import com.google.cloud.automl.v1beta1.GetDatasetRequest; +import com.google.cloud.automl.v1beta1.GetModelEvaluationRequest; +import com.google.cloud.automl.v1beta1.GetModelRequest; +import com.google.cloud.automl.v1beta1.ImportDataRequest; +import com.google.cloud.automl.v1beta1.ListDatasetsRequest; +import com.google.cloud.automl.v1beta1.ListDatasetsResponse; +import com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest; +import com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse; +import com.google.cloud.automl.v1beta1.ListModelsRequest; +import com.google.cloud.automl.v1beta1.ListModelsResponse; +import com.google.cloud.automl.v1beta1.Model; +import com.google.cloud.automl.v1beta1.ModelEvaluation; +import com.google.cloud.automl.v1beta1.OperationMetadata; +import com.google.cloud.automl.v1beta1.UndeployModelRequest; +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 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 PagedCallSettings + listModelsSettings; + private final UnaryCallSettings deleteModelSettings; + private final OperationCallSettings + deleteModelOperationSettings; + private final UnaryCallSettings deployModelSettings; + private final UnaryCallSettings undeployModelSettings; + 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 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 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 deployModel. */ + public UnaryCallSettings deployModelSettings() { + return deployModelSettings; + } + + /** Returns the object with the settings used for calls to undeployModel. */ + public UnaryCallSettings undeployModelSettings() { + return undeployModelSettings; + } + + /** Returns the object with the settings used for calls to 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(); + } + + 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(); + 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(); + listModelsSettings = settingsBuilder.listModelsSettings().build(); + deleteModelSettings = settingsBuilder.deleteModelSettings().build(); + deleteModelOperationSettings = settingsBuilder.deleteModelOperationSettings().build(); + deployModelSettings = settingsBuilder.deployModelSettings().build(); + undeployModelSettings = settingsBuilder.undeployModelSettings().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(); + } + }; + + 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(); + } + }; + + 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(); + } + }; + + 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 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 PagedCallSettings.Builder< + ListModelsRequest, ListModelsResponse, ListModelsPagedResponse> + listModelsSettings; + private final UnaryCallSettings.Builder deleteModelSettings; + private final OperationCallSettings.Builder + deleteModelOperationSettings; + private final UnaryCallSettings.Builder deployModelSettings; + private final UnaryCallSettings.Builder undeployModelSettings; + 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(); + + 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(); + + listModelsSettings = PagedCallSettings.newBuilder(LIST_MODELS_PAGE_STR_FACT); + + deleteModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteModelOperationSettings = OperationCallSettings.newBuilder(); + + deployModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + undeployModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getModelEvaluationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listModelEvaluationsSettings = + PagedCallSettings.newBuilder(LIST_MODEL_EVALUATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDatasetSettings, + getDatasetSettings, + listDatasetsSettings, + deleteDatasetSettings, + importDataSettings, + exportDataSettings, + createModelSettings, + getModelSettings, + listModelsSettings, + deleteModelSettings, + deployModelSettings, + undeployModelSettings, + 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 + .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 + .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 + .deployModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .undeployModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getModelEvaluationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listModelEvaluationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_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("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 + .exportDataOperationSettings() + .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 + .createModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("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(); + 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(); + listModelsSettings = settings.listModelsSettings.toBuilder(); + deleteModelSettings = settings.deleteModelSettings.toBuilder(); + deleteModelOperationSettings = settings.deleteModelOperationSettings.toBuilder(); + deployModelSettings = settings.deployModelSettings.toBuilder(); + undeployModelSettings = settings.undeployModelSettings.toBuilder(); + getModelEvaluationSettings = settings.getModelEvaluationSettings.toBuilder(); + listModelEvaluationsSettings = settings.listModelEvaluationsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDatasetSettings, + getDatasetSettings, + listDatasetsSettings, + deleteDatasetSettings, + importDataSettings, + exportDataSettings, + createModelSettings, + getModelSettings, + listModelsSettings, + deleteModelSettings, + deployModelSettings, + undeployModelSettings, + 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 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 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 deployModel. */ + public UnaryCallSettings.Builder deployModelSettings() { + return deployModelSettings; + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + public UnaryCallSettings.Builder undeployModelSettings() { + return undeployModelSettings; + } + + /** Returns the builder for the settings used for calls to 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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlCallableFactory.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlCallableFactory.java new file mode 100644 index 000000000000..af93eef1f961 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlCallableFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.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.Operation; +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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlStub.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlStub.java new file mode 100644 index 000000000000..6ba3f8699059 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlStub.java @@ -0,0 +1,539 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.stub; + +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1beta1.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.UnaryCallable; +import com.google.cloud.automl.v1beta1.CreateDatasetRequest; +import com.google.cloud.automl.v1beta1.CreateModelRequest; +import com.google.cloud.automl.v1beta1.Dataset; +import com.google.cloud.automl.v1beta1.DeleteDatasetRequest; +import com.google.cloud.automl.v1beta1.DeleteModelRequest; +import com.google.cloud.automl.v1beta1.DeployModelRequest; +import com.google.cloud.automl.v1beta1.ExportDataRequest; +import com.google.cloud.automl.v1beta1.GetDatasetRequest; +import com.google.cloud.automl.v1beta1.GetModelEvaluationRequest; +import com.google.cloud.automl.v1beta1.GetModelRequest; +import com.google.cloud.automl.v1beta1.ImportDataRequest; +import com.google.cloud.automl.v1beta1.ListDatasetsRequest; +import com.google.cloud.automl.v1beta1.ListDatasetsResponse; +import com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest; +import com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse; +import com.google.cloud.automl.v1beta1.ListModelsRequest; +import com.google.cloud.automl.v1beta1.ListModelsResponse; +import com.google.cloud.automl.v1beta1.Model; +import com.google.cloud.automl.v1beta1.ModelEvaluation; +import com.google.cloud.automl.v1beta1.OperationMetadata; +import com.google.cloud.automl.v1beta1.UndeployModelRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for 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.v1beta1.AutoMl/CreateDataset") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) + .build(); + private static final MethodDescriptor getDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.AutoMl/GetModel") + .setRequestMarshaller(ProtoUtils.marshaller(GetModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listModelsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.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.v1beta1.AutoMl/DeleteModel") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor deployModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/DeployModel") + .setRequestMarshaller(ProtoUtils.marshaller(DeployModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + undeployModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/UndeployModel") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeployModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getModelEvaluationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.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.v1beta1.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 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 listModelsCallable; + private final UnaryCallable listModelsPagedCallable; + private final UnaryCallable deleteModelCallable; + private final OperationCallable + deleteModelOperationCallable; + private final UnaryCallable deployModelCallable; + private final UnaryCallable undeployModelCallable; + 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) + .build(); + GrpcCallSettings getDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDatasetMethodDescriptor) + .build(); + GrpcCallSettings listDatasetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDatasetsMethodDescriptor) + .build(); + GrpcCallSettings deleteDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDatasetMethodDescriptor) + .build(); + GrpcCallSettings importDataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importDataMethodDescriptor) + .build(); + GrpcCallSettings exportDataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportDataMethodDescriptor) + .build(); + GrpcCallSettings createModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createModelMethodDescriptor) + .build(); + GrpcCallSettings getModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getModelMethodDescriptor) + .build(); + GrpcCallSettings listModelsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listModelsMethodDescriptor) + .build(); + GrpcCallSettings deleteModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteModelMethodDescriptor) + .build(); + GrpcCallSettings deployModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deployModelMethodDescriptor) + .build(); + GrpcCallSettings undeployModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeployModelMethodDescriptor) + .build(); + GrpcCallSettings + getModelEvaluationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getModelEvaluationMethodDescriptor) + .build(); + GrpcCallSettings + listModelEvaluationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listModelEvaluationsMethodDescriptor) + .build(); + + this.createDatasetCallable = + callableFactory.createUnaryCallable( + createDatasetTransportSettings, settings.createDatasetSettings(), 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.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.deployModelCallable = + callableFactory.createUnaryCallable( + deployModelTransportSettings, settings.deployModelSettings(), clientContext); + this.undeployModelCallable = + callableFactory.createUnaryCallable( + undeployModelTransportSettings, settings.undeployModelSettings(), clientContext); + 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 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 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 deployModelCallable() { + return deployModelCallable; + } + + public UnaryCallable undeployModelCallable() { + return undeployModelCallable; + } + + 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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcPredictionServiceCallableFactory.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcPredictionServiceCallableFactory.java new file mode 100644 index 000000000000..df4c9a822d18 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcPredictionServiceCallableFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.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.Operation; +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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcPredictionServiceStub.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcPredictionServiceStub.java new file mode 100644 index 000000000000..1db990c8b656 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcPredictionServiceStub.java @@ -0,0 +1,141 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1beta1.PredictRequest; +import com.google.cloud.automl.v1beta1.PredictResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for 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.v1beta1.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) + .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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStub.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStub.java new file mode 100644 index 000000000000..01f7cf357b92 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStub.java @@ -0,0 +1,41 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.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.v1beta1.PredictRequest; +import com.google.cloud.automl.v1beta1.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-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStubSettings.java b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStubSettings.java new file mode 100644 index 000000000000..bc8cbbb07a79 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStubSettings.java @@ -0,0 +1,264 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.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.v1beta1.PredictRequest; +import com.google.cloud.automl.v1beta1.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(); + } + + 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(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .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-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/AutoMlClientTest.java b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/AutoMlClientTest.java new file mode 100644 index 000000000000..b6768a33360e --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/AutoMlClientTest.java @@ -0,0 +1,744 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListDatasetsPagedResponse; +import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelEvaluationsPagedResponse; +import static com.google.cloud.automl.v1beta1.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.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +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 MockPredictionService mockPredictionService; + private static MockAutoMl mockAutoMl; + private static MockServiceHelper serviceHelper; + private AutoMlClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPredictionService = new MockPredictionService(); + mockAutoMl = new MockAutoMl(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockPredictionService, mockAutoMl)); + 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"; + String displayName = "displayName1615086568"; + int exampleCount = 1517063674; + Dataset expectedResponse = + Dataset.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setExampleCount(exampleCount) + .build(); + mockAutoMl.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dataset dataset = Dataset.newBuilder().build(); + + Dataset 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 getDatasetTest() { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + int exampleCount = 1517063674; + Dataset expectedResponse = + Dataset.newBuilder() + .setName(name2) + .setDisplayName(displayName) + .setExampleCount(exampleCount) + .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 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 deployModelTest() { + String name2 = "name2-1052831874"; + boolean done = true; + Operation expectedResponse = Operation.newBuilder().setName(name2).setDone(done).build(); + mockAutoMl.addResponse(expectedResponse); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + Operation actualResponse = client.deployModel(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeployModelRequest actualRequest = (DeployModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deployModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.deployModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void undeployModelTest() { + String name2 = "name2-1052831874"; + boolean done = true; + Operation expectedResponse = Operation.newBuilder().setName(name2).setDone(done).build(); + mockAutoMl.addResponse(expectedResponse); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + Operation actualResponse = client.undeployModel(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeployModelRequest actualRequest = (UndeployModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void undeployModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.undeployModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @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]"); + + ListModelEvaluationsPagedResponse pagedListResponse = client.listModelEvaluations(parent); + + 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.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]"); + + client.listModelEvaluations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockAutoMl.java b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockAutoMl.java new file mode 100644 index 000000000000..2e5d8289d391 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockAutoMl.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +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(GeneratedMessageV3 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-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockAutoMlImpl.java b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockAutoMlImpl.java new file mode 100644 index 000000000000..b4c4bacb3eaf --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockAutoMlImpl.java @@ -0,0 +1,263 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.automl.v1beta1.AutoMlGrpc.AutoMlImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.GeneratedMessageV3; +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 ArrayList requests; + private Queue responses; + + public MockAutoMlImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 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 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 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 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 deployModel(DeployModelRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void undeployModel( + UndeployModelRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void 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-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockPredictionService.java b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockPredictionService.java new file mode 100644 index 000000000000..502be6c843a8 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockPredictionService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +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(GeneratedMessageV3 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-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockPredictionServiceImpl.java b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockPredictionServiceImpl.java new file mode 100644 index 000000000000..91dc5e89cb96 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/MockPredictionServiceImpl.java @@ -0,0 +1,72 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.automl.v1beta1.PredictionServiceGrpc.PredictionServiceImplBase; +import com.google.protobuf.GeneratedMessageV3; +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 ArrayList requests; + private Queue responses; + + public MockPredictionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 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-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/PredictionServiceClientTest.java b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/PredictionServiceClientTest.java new file mode 100644 index 000000000000..4dec684819a1 --- /dev/null +++ b/google-cloud-clients/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/PredictionServiceClientTest.java @@ -0,0 +1,123 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +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.GeneratedMessageV3; +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 MockPredictionService mockPredictionService; + private static MockAutoMl mockAutoMl; + private static MockServiceHelper serviceHelper; + private PredictionServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPredictionService = new MockPredictionService(); + mockAutoMl = new MockAutoMl(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockPredictionService, mockAutoMl)); + 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/google-cloud-clients/google-cloud-vision/pom.xml b/google-cloud-clients/google-cloud-vision/pom.xml index 8d9f310b8f41..7042ff869257 100644 --- a/google-cloud-clients/google-cloud-vision/pom.xml +++ b/google-cloud-clients/google-cloud-vision/pom.xml @@ -38,10 +38,10 @@ com.google.api.grpc proto-google-cloud-vision-v1p2beta1 - + io.grpc grpc-netty-shaded @@ -90,11 +90,11 @@ grpc-google-cloud-vision-v1p2beta1 test - + com.google.api gax-grpc diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorClient.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorClient.java new file mode 100644 index 000000000000..527ae2a3d2a8 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorClient.java @@ -0,0 +1,383 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.vision.v1p3beta1.stub.ImageAnnotatorStub; +import com.google.cloud.vision.v1p3beta1.stub.ImageAnnotatorStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service that performs Google Cloud Vision API detection tasks over client + * images, such as face, landmark, logo, label, and text detection. The ImageAnnotator service + * returns detected entities from the images. + * + *

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 (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+ *   List<AnnotateImageRequest> requests = new ArrayList<>();
+ *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the imageAnnotatorClient 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 ImageAnnotatorSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ImageAnnotatorSettings imageAnnotatorSettings =
+ *     ImageAnnotatorSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ImageAnnotatorClient imageAnnotatorClient =
+ *     ImageAnnotatorClient.create(imageAnnotatorSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ImageAnnotatorSettings imageAnnotatorSettings =
+ *     ImageAnnotatorSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ImageAnnotatorClient imageAnnotatorClient =
+ *     ImageAnnotatorClient.create(imageAnnotatorSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ImageAnnotatorClient implements BackgroundResource { + private final ImageAnnotatorSettings settings; + private final ImageAnnotatorStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ImageAnnotatorClient with default settings. */ + public static final ImageAnnotatorClient create() throws IOException { + return create(ImageAnnotatorSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ImageAnnotatorClient, 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 ImageAnnotatorClient create(ImageAnnotatorSettings settings) + throws IOException { + return new ImageAnnotatorClient(settings); + } + + /** + * Constructs an instance of ImageAnnotatorClient, using the given stub for making calls. This is + * for advanced usage - prefer to use ImageAnnotatorSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ImageAnnotatorClient create(ImageAnnotatorStub stub) { + return new ImageAnnotatorClient(stub); + } + + /** + * Constructs an instance of ImageAnnotatorClient, 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 ImageAnnotatorClient(ImageAnnotatorSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ImageAnnotatorStubSettings) 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 ImageAnnotatorClient(ImageAnnotatorStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ImageAnnotatorSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ImageAnnotatorStub 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 + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
+   * }
+   * 
+ * + * @param requests Individual image annotation requests for this batch. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchAnnotateImagesResponse batchAnnotateImages( + List requests) { + + BatchAnnotateImagesRequest request = + BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build(); + return batchAnnotateImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(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 + */ + private final BatchAnnotateImagesResponse batchAnnotateImages( + BatchAnnotateImagesRequest request) { + return batchAnnotateImagesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<BatchAnnotateImagesResponse> future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
+   *   // Do something
+   *   BatchAnnotateImagesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchAnnotateImagesCallable() { + return stub.batchAnnotateImagesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run asynchronous image detection and annotation for a list of generic files, such as PDF files, + * which may contain multiple pages and multiple images per page. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains + * `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + * (results). + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AsyncAnnotateFileRequest> requests = new ArrayList<>();
+   *   AsyncBatchAnnotateFilesResponse response = imageAnnotatorClient.asyncBatchAnnotateFilesAsync(requests).get();
+   * }
+   * 
+ * + * @param requests Individual async file annotation requests for this batch. + * @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 + asyncBatchAnnotateFilesAsync(List requests) { + + AsyncBatchAnnotateFilesRequest request = + AsyncBatchAnnotateFilesRequest.newBuilder().addAllRequests(requests).build(); + return asyncBatchAnnotateFilesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run asynchronous image detection and annotation for a list of generic files, such as PDF files, + * which may contain multiple pages and multiple images per page. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains + * `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + * (results). + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AsyncAnnotateFileRequest> requests = new ArrayList<>();
+   *   AsyncBatchAnnotateFilesRequest request = AsyncBatchAnnotateFilesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   AsyncBatchAnnotateFilesResponse response = imageAnnotatorClient.asyncBatchAnnotateFilesAsync(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.") + private final OperationFuture + asyncBatchAnnotateFilesAsync(AsyncBatchAnnotateFilesRequest request) { + return asyncBatchAnnotateFilesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run asynchronous image detection and annotation for a list of generic files, such as PDF files, + * which may contain multiple pages and multiple images per page. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains + * `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + * (results). + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AsyncAnnotateFileRequest> requests = new ArrayList<>();
+   *   AsyncBatchAnnotateFilesRequest request = AsyncBatchAnnotateFilesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   OperationFuture<Operation> future = imageAnnotatorClient.asyncBatchAnnotateFilesOperationCallable().futureCall(request);
+   *   // Do something
+   *   AsyncBatchAnnotateFilesResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationCallable() { + return stub.asyncBatchAnnotateFilesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run asynchronous image detection and annotation for a list of generic files, such as PDF files, + * which may contain multiple pages and multiple images per page. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains + * `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + * (results). + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AsyncAnnotateFileRequest> requests = new ArrayList<>();
+   *   AsyncBatchAnnotateFilesRequest request = AsyncBatchAnnotateFilesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<Operation> future = imageAnnotatorClient.asyncBatchAnnotateFilesCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + asyncBatchAnnotateFilesCallable() { + return stub.asyncBatchAnnotateFilesCallable(); + } + + @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-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorSettings.java new file mode 100644 index 000000000000..fbf85fdf5cdc --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorSettings.java @@ -0,0 +1,209 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.vision.v1p3beta1.stub.ImageAnnotatorStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ImageAnnotatorClient}. + * + *

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

    + *
  • The default service address (vision.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 batchAnnotateImages to 30 seconds: + * + *

+ * 
+ * ImageAnnotatorSettings.Builder imageAnnotatorSettingsBuilder =
+ *     ImageAnnotatorSettings.newBuilder();
+ * imageAnnotatorSettingsBuilder.batchAnnotateImagesSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ImageAnnotatorSettings imageAnnotatorSettings = imageAnnotatorSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ImageAnnotatorSettings extends ClientSettings { + /** Returns the object with the settings used for calls to batchAnnotateImages. */ + public UnaryCallSettings + batchAnnotateImagesSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings(); + } + + /** Returns the object with the settings used for calls to asyncBatchAnnotateFiles. */ + public UnaryCallSettings + asyncBatchAnnotateFilesSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()).asyncBatchAnnotateFilesSettings(); + } + + /** Returns the object with the settings used for calls to asyncBatchAnnotateFiles. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()) + .asyncBatchAnnotateFilesOperationSettings(); + } + + public static final ImageAnnotatorSettings create(ImageAnnotatorStubSettings stub) + throws IOException { + return new ImageAnnotatorSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ImageAnnotatorStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ImageAnnotatorStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ImageAnnotatorStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ImageAnnotatorStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ImageAnnotatorStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ImageAnnotatorStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ImageAnnotatorStubSettings.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 ImageAnnotatorSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ImageAnnotatorSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ImageAnnotatorStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ImageAnnotatorStubSettings.newBuilder()); + } + + protected Builder(ImageAnnotatorSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ImageAnnotatorStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ImageAnnotatorStubSettings.Builder getStubSettingsBuilder() { + return ((ImageAnnotatorStubSettings.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 batchAnnotateImages. */ + public UnaryCallSettings.Builder + batchAnnotateImagesSettings() { + return getStubSettingsBuilder().batchAnnotateImagesSettings(); + } + + /** Returns the builder for the settings used for calls to asyncBatchAnnotateFiles. */ + public UnaryCallSettings.Builder + asyncBatchAnnotateFilesSettings() { + return getStubSettingsBuilder().asyncBatchAnnotateFilesSettings(); + } + + /** Returns the builder for the settings used for calls to asyncBatchAnnotateFiles. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationSettings() { + return getStubSettingsBuilder().asyncBatchAnnotateFilesOperationSettings(); + } + + @Override + public ImageAnnotatorSettings build() throws IOException { + return new ImageAnnotatorSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java new file mode 100644 index 000000000000..7519ca143a17 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java @@ -0,0 +1,2999 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +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.vision.v1p3beta1.stub.ProductSearchStub; +import com.google.cloud.vision.v1p3beta1.stub.ProductSearchStubSettings; +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: Manages Products and ProductSets of reference images for use in product + * search. It uses the following resource model: + * + *

- The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] + * resources, named `projects/*/locations/*/productSets/*`, which acts as a way to put + * different products into groups to limit identification. + * + *

In parallel, + * + *

- The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, + * named `projects/*/locations/*/products/*` + * + *

- Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of + * [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named + * `projects/*/locations/*/products/*/referenceImages/*` + * + *

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 (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   ProductSet productSet = ProductSet.newBuilder().build();
+ *   String productSetId = "";
+ *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the productSearchClient 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 ProductSearchSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ProductSearchSettings productSearchSettings =
+ *     ProductSearchSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ProductSearchClient productSearchClient =
+ *     ProductSearchClient.create(productSearchSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ProductSearchSettings productSearchSettings =
+ *     ProductSearchSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ProductSearchClient productSearchClient =
+ *     ProductSearchClient.create(productSearchSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ProductSearchClient implements BackgroundResource { + private final ProductSearchSettings settings; + private final ProductSearchStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ProductSearchClient with default settings. */ + public static final ProductSearchClient create() throws IOException { + return create(ProductSearchSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ProductSearchClient, 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 ProductSearchClient create(ProductSearchSettings settings) + throws IOException { + return new ProductSearchClient(settings); + } + + /** + * Constructs an instance of ProductSearchClient, using the given stub for making calls. This is + * for advanced usage - prefer to use ProductSearchSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ProductSearchClient create(ProductSearchStub stub) { + return new ProductSearchClient(stub); + } + + /** + * Constructs an instance of ProductSearchClient, 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 ProductSearchClient(ProductSearchSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ProductSearchStubSettings) 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 ProductSearchClient(ProductSearchStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ProductSearchSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ProductSearchStub 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 and returns a new ProductSet resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   String productSetId = "";
+   *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
+   * }
+   * 
+ * + * @param parent The project in which the ProductSet should be created. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param productSet The ProductSet to create. + * @param productSetId A user-supplied resource id for this ProductSet. If set, the server will + * attempt to use this value as the resource id. If it is already in use, an error is returned + * with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the + * character `/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ProductSet createProductSet( + LocationName parent, ProductSet productSet, String productSetId) { + + CreateProductSetRequest request = + CreateProductSetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProductSet(productSet) + .setProductSetId(productSetId) + .build(); + return createProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new ProductSet resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   String productSetId = "";
+   *   ProductSet response = productSearchClient.createProductSet(parent.toString(), productSet, productSetId);
+   * }
+   * 
+ * + * @param parent The project in which the ProductSet should be created. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param productSet The ProductSet to create. + * @param productSetId A user-supplied resource id for this ProductSet. If set, the server will + * attempt to use this value as the resource id. If it is already in use, an error is returned + * with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the + * character `/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ProductSet createProductSet( + String parent, ProductSet productSet, String productSetId) { + + CreateProductSetRequest request = + CreateProductSetRequest.newBuilder() + .setParent(parent) + .setProductSet(productSet) + .setProductSetId(productSetId) + .build(); + return createProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new ProductSet resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   String productSetId = "";
+   *   CreateProductSetRequest request = CreateProductSetRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setProductSet(productSet)
+   *     .setProductSetId(productSetId)
+   *     .build();
+   *   ProductSet response = productSearchClient.createProductSet(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 ProductSet createProductSet(CreateProductSetRequest request) { + return createProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new ProductSet resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   String productSetId = "";
+   *   CreateProductSetRequest request = CreateProductSetRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setProductSet(productSet)
+   *     .setProductSetId(productSetId)
+   *     .build();
+   *   ApiFuture<ProductSet> future = productSearchClient.createProductSetCallable().futureCall(request);
+   *   // Do something
+   *   ProductSet response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createProductSetCallable() { + return stub.createProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ProductSets in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ProductSet element : productSearchClient.listProductSets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The project from which ProductSets should be listed. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductSetsPagedResponse listProductSets(LocationName parent) { + ListProductSetsRequest request = + ListProductSetsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProductSets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ProductSets in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ProductSet element : productSearchClient.listProductSets(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The project from which ProductSets should be listed. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductSetsPagedResponse listProductSets(String parent) { + ListProductSetsRequest request = ListProductSetsRequest.newBuilder().setParent(parent).build(); + return listProductSets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ProductSets in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (ProductSet element : productSearchClient.listProductSets(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 ListProductSetsPagedResponse listProductSets(ListProductSetsRequest request) { + return listProductSetsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ProductSets in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListProductSetsPagedResponse> future = productSearchClient.listProductSetsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ProductSet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listProductSetsPagedCallable() { + return stub.listProductSetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ProductSets in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListProductSetsResponse response = productSearchClient.listProductSetsCallable().call(request);
+   *     for (ProductSet element : response.getProductSetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listProductSetsCallable() { + return stub.listProductSetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ProductSet response = productSearchClient.getProductSet(name);
+   * }
+   * 
+ * + * @param name Resource name of the ProductSet to get. + *

Format is: `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ProductSet getProductSet(ProductSetName name) { + + GetProductSetRequest request = + GetProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ProductSet response = productSearchClient.getProductSet(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the ProductSet to get. + *

Format is: `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ProductSet getProductSet(String name) { + + GetProductSetRequest request = GetProductSetRequest.newBuilder().setName(name).build(); + return getProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   GetProductSetRequest request = GetProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ProductSet response = productSearchClient.getProductSet(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 + */ + private final ProductSet getProductSet(GetProductSetRequest request) { + return getProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   GetProductSetRequest request = GetProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<ProductSet> future = productSearchClient.getProductSetCallable().futureCall(request);
+   *   // Do something
+   *   ProductSet response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getProductSetCallable() { + return stub.getProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes changes to a ProductSet resource. Only display_name can be updated currently. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but missing from the request or longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ProductSet response = productSearchClient.updateProductSet(productSet, updateMask);
+   * }
+   * 
+ * + * @param productSet The ProductSet resource which replaces the one on the server. + * @param updateMask The [FieldMask][google.protobuf.FieldMask] that specifies which fields to + * update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask + * path is `display_name`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ProductSet updateProductSet(ProductSet productSet, FieldMask updateMask) { + + UpdateProductSetRequest request = + UpdateProductSetRequest.newBuilder() + .setProductSet(productSet) + .setUpdateMask(updateMask) + .build(); + return updateProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes changes to a ProductSet resource. Only display_name can be updated currently. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but missing from the request or longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
+   *     .setProductSet(productSet)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ProductSet response = productSearchClient.updateProductSet(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 ProductSet updateProductSet(UpdateProductSetRequest request) { + return updateProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes changes to a ProductSet resource. Only display_name can be updated currently. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but missing from the request or longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
+   *     .setProductSet(productSet)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<ProductSet> future = productSearchClient.updateProductSetCallable().futureCall(request);
+   *   // Do something
+   *   ProductSet response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateProductSetCallable() { + return stub.updateProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(name);
+   * }
+   * 
+ * + * @param name Resource name of the ProductSet to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProductSet(ProductSetName name) { + + DeleteProductSetRequest request = + DeleteProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the ProductSet to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProductSet(String name) { + + DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder().setName(name).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteProductSet(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 + */ + private final void deleteProductSet(DeleteProductSetRequest request) { + deleteProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteProductSetCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteProductSetCallable() { + return stub.deleteProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new product resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns + * INVALID_ARGUMENT if product_category is missing or invalid. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "";
+   *   Product response = productSearchClient.createProduct(parent, product, productId);
+   * }
+   * 
+ * + * @param parent The project in which the Product should be created. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param product The product to create. + * @param productId A user-supplied resource id for this Product. If set, the server will attempt + * to use this value as the resource id. If it is already in use, an error is returned with + * code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character + * `/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product createProduct(LocationName parent, Product product, String productId) { + + CreateProductRequest request = + CreateProductRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProduct(product) + .setProductId(productId) + .build(); + return createProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new product resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns + * INVALID_ARGUMENT if product_category is missing or invalid. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "";
+   *   Product response = productSearchClient.createProduct(parent.toString(), product, productId);
+   * }
+   * 
+ * + * @param parent The project in which the Product should be created. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param product The product to create. + * @param productId A user-supplied resource id for this Product. If set, the server will attempt + * to use this value as the resource id. If it is already in use, an error is returned with + * code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character + * `/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product createProduct(String parent, Product product, String productId) { + + CreateProductRequest request = + CreateProductRequest.newBuilder() + .setParent(parent) + .setProduct(product) + .setProductId(productId) + .build(); + return createProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new product resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns + * INVALID_ARGUMENT if product_category is missing or invalid. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "";
+   *   CreateProductRequest request = CreateProductRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setProduct(product)
+   *     .setProductId(productId)
+   *     .build();
+   *   Product response = productSearchClient.createProduct(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 Product createProduct(CreateProductRequest request) { + return createProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new product resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns + * INVALID_ARGUMENT if product_category is missing or invalid. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "";
+   *   CreateProductRequest request = CreateProductRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setProduct(product)
+   *     .setProductId(productId)
+   *     .build();
+   *   ApiFuture<Product> future = productSearchClient.createProductCallable().futureCall(request);
+   *   // Do something
+   *   Product response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createProductCallable() { + return stub.createProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists products in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Product element : productSearchClient.listProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The project OR ProductSet from which Products should be listed. + *

Format: `projects/PROJECT_ID/locations/LOC_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(LocationName parent) { + ListProductsRequest request = + ListProductsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists products in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Product element : productSearchClient.listProducts(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The project OR ProductSet from which Products should be listed. + *

Format: `projects/PROJECT_ID/locations/LOC_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(String parent) { + ListProductsRequest request = ListProductsRequest.newBuilder().setParent(parent).build(); + return listProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists products in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductsRequest request = ListProductsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Product element : productSearchClient.listProducts(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 ListProductsPagedResponse listProducts(ListProductsRequest request) { + return listProductsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists products in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductsRequest request = ListProductsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListProductsPagedResponse> future = productSearchClient.listProductsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Product element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listProductsPagedCallable() { + return stub.listProductsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists products in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductsRequest request = ListProductsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListProductsResponse response = productSearchClient.listProductsCallable().call(request);
+   *     for (Product element : response.getProductsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listProductsCallable() { + return stub.listProductsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a Product. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   Product response = productSearchClient.getProduct(name);
+   * }
+   * 
+ * + * @param name Resource name of the Product to get. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product getProduct(ProductName name) { + + GetProductRequest request = + GetProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a Product. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   Product response = productSearchClient.getProduct(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of the Product to get. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product getProduct(String name) { + + GetProductRequest request = GetProductRequest.newBuilder().setName(name).build(); + return getProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a Product. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   GetProductRequest request = GetProductRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Product response = productSearchClient.getProduct(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 + */ + private final Product getProduct(GetProductRequest request) { + return getProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a Product. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   GetProductRequest request = GetProductRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Product> future = productSearchClient.getProductCallable().futureCall(request);
+   *   // Do something
+   *   Product response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getProductCallable() { + return stub.getProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes changes to a Product resource. Only display_name, description and labels can be updated + * right now. + * + *

If labels are updated, the change will not be reflected in queries until the next index + * time. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but is missing from the request or longer than 4096 + * characters. * Returns INVALID_ARGUMENT if description is present in update_mask but is + * longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in + * update_mask. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   Product product = Product.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Product response = productSearchClient.updateProduct(product, updateMask);
+   * }
+   * 
+ * + * @param product The Product resource which replaces the one on the server. product.name is + * immutable. + * @param updateMask The [FieldMask][google.protobuf.FieldMask] that specifies which fields to + * update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask + * paths include `product_labels`, `display_name` and `description`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product updateProduct(Product product, FieldMask updateMask) { + + UpdateProductRequest request = + UpdateProductRequest.newBuilder().setProduct(product).setUpdateMask(updateMask).build(); + return updateProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes changes to a Product resource. Only display_name, description and labels can be updated + * right now. + * + *

If labels are updated, the change will not be reflected in queries until the next index + * time. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but is missing from the request or longer than 4096 + * characters. * Returns INVALID_ARGUMENT if description is present in update_mask but is + * longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in + * update_mask. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   Product product = Product.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateProductRequest request = UpdateProductRequest.newBuilder()
+   *     .setProduct(product)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Product response = productSearchClient.updateProduct(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 Product updateProduct(UpdateProductRequest request) { + return updateProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes changes to a Product resource. Only display_name, description and labels can be updated + * right now. + * + *

If labels are updated, the change will not be reflected in queries until the next index + * time. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but is missing from the request or longer than 4096 + * characters. * Returns INVALID_ARGUMENT if description is present in update_mask but is + * longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in + * update_mask. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   Product product = Product.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateProductRequest request = UpdateProductRequest.newBuilder()
+   *     .setProduct(product)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Product> future = productSearchClient.updateProductCallable().futureCall(request);
+   *   // Do something
+   *   Product response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateProductCallable() { + return stub.updateProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   productSearchClient.deleteProduct(name);
+   * }
+   * 
+ * + * @param name Resource name of product to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(ProductName name) { + + DeleteProductRequest request = + DeleteProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   productSearchClient.deleteProduct(name.toString());
+   * }
+   * 
+ * + * @param name Resource name of product to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(String name) { + + DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteProduct(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 + */ + private final void deleteProduct(DeleteProductRequest request) { + deleteProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteProductCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteProductCallable() { + return stub.deleteProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new ReferenceImage resource. + * + *

The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will + * try to detect regions of interest in the image that are compatible with the product_category on + * the parent product. If it is specified, detection is ALWAYS skipped. The system converts + * polygons into non-rotated rectangles. + * + *

Note that the pipeline will resize the image if the image resolution is too large to process + * (above 50MP). + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if + * bounding_poly is not provided, and nothing compatible with the parent product's + * product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more + * than 10 polygons. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ReferenceImage referenceImage = ReferenceImage.newBuilder().build();
+   *   String referenceImageId = "";
+   *   ReferenceImage response = productSearchClient.createReferenceImage(parent, referenceImage, referenceImageId);
+   * }
+   * 
+ * + * @param parent Resource name of the product in which to create the reference image. + *

Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + * @param referenceImage The reference image to create. If an image ID is specified, it is + * ignored. + * @param referenceImageId A user-supplied resource id for the ReferenceImage to be added. If set, + * the server will attempt to use this value as the resource id. If it is already in use, an + * error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot + * contain the character `/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReferenceImage createReferenceImage( + ProductName parent, ReferenceImage referenceImage, String referenceImageId) { + + CreateReferenceImageRequest request = + CreateReferenceImageRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setReferenceImage(referenceImage) + .setReferenceImageId(referenceImageId) + .build(); + return createReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new ReferenceImage resource. + * + *

The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will + * try to detect regions of interest in the image that are compatible with the product_category on + * the parent product. If it is specified, detection is ALWAYS skipped. The system converts + * polygons into non-rotated rectangles. + * + *

Note that the pipeline will resize the image if the image resolution is too large to process + * (above 50MP). + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if + * bounding_poly is not provided, and nothing compatible with the parent product's + * product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more + * than 10 polygons. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ReferenceImage referenceImage = ReferenceImage.newBuilder().build();
+   *   String referenceImageId = "";
+   *   ReferenceImage response = productSearchClient.createReferenceImage(parent.toString(), referenceImage, referenceImageId);
+   * }
+   * 
+ * + * @param parent Resource name of the product in which to create the reference image. + *

Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + * @param referenceImage The reference image to create. If an image ID is specified, it is + * ignored. + * @param referenceImageId A user-supplied resource id for the ReferenceImage to be added. If set, + * the server will attempt to use this value as the resource id. If it is already in use, an + * error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot + * contain the character `/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReferenceImage createReferenceImage( + String parent, ReferenceImage referenceImage, String referenceImageId) { + + CreateReferenceImageRequest request = + CreateReferenceImageRequest.newBuilder() + .setParent(parent) + .setReferenceImage(referenceImage) + .setReferenceImageId(referenceImageId) + .build(); + return createReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new ReferenceImage resource. + * + *

The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will + * try to detect regions of interest in the image that are compatible with the product_category on + * the parent product. If it is specified, detection is ALWAYS skipped. The system converts + * polygons into non-rotated rectangles. + * + *

Note that the pipeline will resize the image if the image resolution is too large to process + * (above 50MP). + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if + * bounding_poly is not provided, and nothing compatible with the parent product's + * product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more + * than 10 polygons. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ReferenceImage referenceImage = ReferenceImage.newBuilder().build();
+   *   String referenceImageId = "";
+   *   CreateReferenceImageRequest request = CreateReferenceImageRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setReferenceImage(referenceImage)
+   *     .setReferenceImageId(referenceImageId)
+   *     .build();
+   *   ReferenceImage response = productSearchClient.createReferenceImage(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 ReferenceImage createReferenceImage(CreateReferenceImageRequest request) { + return createReferenceImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new ReferenceImage resource. + * + *

The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will + * try to detect regions of interest in the image that are compatible with the product_category on + * the parent product. If it is specified, detection is ALWAYS skipped. The system converts + * polygons into non-rotated rectangles. + * + *

Note that the pipeline will resize the image if the image resolution is too large to process + * (above 50MP). + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if + * bounding_poly is not provided, and nothing compatible with the parent product's + * product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more + * than 10 polygons. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ReferenceImage referenceImage = ReferenceImage.newBuilder().build();
+   *   String referenceImageId = "";
+   *   CreateReferenceImageRequest request = CreateReferenceImageRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setReferenceImage(referenceImage)
+   *     .setReferenceImageId(referenceImageId)
+   *     .build();
+   *   ApiFuture<ReferenceImage> future = productSearchClient.createReferenceImageCallable().futureCall(request);
+   *   // Do something
+   *   ReferenceImage response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + createReferenceImageCallable() { + return stub.createReferenceImageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the reference image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   productSearchClient.deleteReferenceImage(name);
+   * }
+   * 
+ * + * @param name The resource name of the reference image to delete. + *

Format is: + *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReferenceImage(ReferenceImageName name) { + + DeleteReferenceImageRequest request = + DeleteReferenceImageRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the reference image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   productSearchClient.deleteReferenceImage(name.toString());
+   * }
+   * 
+ * + * @param name The resource name of the reference image to delete. + *

Format is: + *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReferenceImage(String name) { + + DeleteReferenceImageRequest request = + DeleteReferenceImageRequest.newBuilder().setName(name).build(); + deleteReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the reference image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteReferenceImage(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 + */ + private final void deleteReferenceImage(DeleteReferenceImageRequest request) { + deleteReferenceImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the reference image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteReferenceImageCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteReferenceImageCallable() { + return stub.deleteReferenceImageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists reference images. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT + * if the page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   for (ReferenceImage element : productSearchClient.listReferenceImages(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the product containing the reference images. + *

Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReferenceImagesPagedResponse listReferenceImages(ProductName parent) { + ListReferenceImagesRequest request = + ListReferenceImagesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listReferenceImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists reference images. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT + * if the page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   for (ReferenceImage element : productSearchClient.listReferenceImages(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the product containing the reference images. + *

Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReferenceImagesPagedResponse listReferenceImages(String parent) { + ListReferenceImagesRequest request = + ListReferenceImagesRequest.newBuilder().setParent(parent).build(); + return listReferenceImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists reference images. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT + * if the page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ListReferenceImagesRequest request = ListReferenceImagesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (ReferenceImage element : productSearchClient.listReferenceImages(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 ListReferenceImagesPagedResponse listReferenceImages( + ListReferenceImagesRequest request) { + return listReferenceImagesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists reference images. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT + * if the page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ListReferenceImagesRequest request = ListReferenceImagesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListReferenceImagesPagedResponse> future = productSearchClient.listReferenceImagesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ReferenceImage element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listReferenceImagesPagedCallable() { + return stub.listReferenceImagesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists reference images. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT + * if the page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ListReferenceImagesRequest request = ListReferenceImagesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListReferenceImagesResponse response = productSearchClient.listReferenceImagesCallable().call(request);
+   *     for (ReferenceImage element : response.getReferenceImagesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listReferenceImagesCallable() { + return stub.listReferenceImagesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ReferenceImage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the specified image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   ReferenceImage response = productSearchClient.getReferenceImage(name);
+   * }
+   * 
+ * + * @param name The resource name of the ReferenceImage to get. + *

Format is: + *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReferenceImage getReferenceImage(ReferenceImageName name) { + + GetReferenceImageRequest request = + GetReferenceImageRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ReferenceImage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the specified image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   ReferenceImage response = productSearchClient.getReferenceImage(name.toString());
+   * }
+   * 
+ * + * @param name The resource name of the ReferenceImage to get. + *

Format is: + *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReferenceImage getReferenceImage(String name) { + + GetReferenceImageRequest request = GetReferenceImageRequest.newBuilder().setName(name).build(); + return getReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ReferenceImage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the specified image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   GetReferenceImageRequest request = GetReferenceImageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ReferenceImage response = productSearchClient.getReferenceImage(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 + */ + private final ReferenceImage getReferenceImage(GetReferenceImageRequest request) { + return getReferenceImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ReferenceImage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the specified image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   GetReferenceImageRequest request = GetReferenceImageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<ReferenceImage> future = productSearchClient.getReferenceImageCallable().futureCall(request);
+   *   // Do something
+   *   ReferenceImage response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getReferenceImageCallable() { + return stub.getReferenceImageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a Product to the specified ProductSet. If the Product is already present, no change is + * made. + * + *

One Product can be added to at most 100 ProductSets. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   productSearchClient.addProductToProductSet(name, product);
+   * }
+   * 
+ * + * @param name The resource name for the ProductSet to modify. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @param product The resource name for the Product to be added to this ProductSet. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void addProductToProductSet(ProductSetName name, String product) { + + AddProductToProductSetRequest request = + AddProductToProductSetRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setProduct(product) + .build(); + addProductToProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a Product to the specified ProductSet. If the Product is already present, no change is + * made. + * + *

One Product can be added to at most 100 ProductSets. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   productSearchClient.addProductToProductSet(name.toString(), product);
+   * }
+   * 
+ * + * @param name The resource name for the ProductSet to modify. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @param product The resource name for the Product to be added to this ProductSet. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void addProductToProductSet(String name, String product) { + + AddProductToProductSetRequest request = + AddProductToProductSetRequest.newBuilder().setName(name).setProduct(product).build(); + addProductToProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a Product to the specified ProductSet. If the Product is already present, no change is + * made. + * + *

One Product can be added to at most 100 ProductSets. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   AddProductToProductSetRequest request = AddProductToProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setProduct(product)
+   *     .build();
+   *   productSearchClient.addProductToProductSet(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 void addProductToProductSet(AddProductToProductSetRequest request) { + addProductToProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a Product to the specified ProductSet. If the Product is already present, no change is + * made. + * + *

One Product can be added to at most 100 ProductSets. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   AddProductToProductSetRequest request = AddProductToProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setProduct(product)
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.addProductToProductSetCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + addProductToProductSetCallable() { + return stub.addProductToProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes a Product from the specified ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND If the Product is not found under the ProductSet. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   productSearchClient.removeProductFromProductSet(name, product);
+   * }
+   * 
+ * + * @param name The resource name for the ProductSet to modify. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @param product The resource name for the Product to be removed from this ProductSet. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void removeProductFromProductSet(ProductSetName name, String product) { + + RemoveProductFromProductSetRequest request = + RemoveProductFromProductSetRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setProduct(product) + .build(); + removeProductFromProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes a Product from the specified ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND If the Product is not found under the ProductSet. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   productSearchClient.removeProductFromProductSet(name.toString(), product);
+   * }
+   * 
+ * + * @param name The resource name for the ProductSet to modify. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @param product The resource name for the Product to be removed from this ProductSet. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void removeProductFromProductSet(String name, String product) { + + RemoveProductFromProductSetRequest request = + RemoveProductFromProductSetRequest.newBuilder().setName(name).setProduct(product).build(); + removeProductFromProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes a Product from the specified ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND If the Product is not found under the ProductSet. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   RemoveProductFromProductSetRequest request = RemoveProductFromProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setProduct(product)
+   *     .build();
+   *   productSearchClient.removeProductFromProductSet(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 void removeProductFromProductSet(RemoveProductFromProductSetRequest request) { + removeProductFromProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes a Product from the specified ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND If the Product is not found under the ProductSet. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   RemoveProductFromProductSetRequest request = RemoveProductFromProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setProduct(product)
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.removeProductFromProductSetCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + removeProductFromProductSetCallable() { + return stub.removeProductFromProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, + * the products field of the response will be empty. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   for (Product element : productSearchClient.listProductsInProductSet(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param name The ProductSet resource for which to retrieve Products. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsInProductSetPagedResponse listProductsInProductSet(ProductSetName name) { + ListProductsInProductSetRequest request = + ListProductsInProductSetRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return listProductsInProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, + * the products field of the response will be empty. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   for (Product element : productSearchClient.listProductsInProductSet(name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param name The ProductSet resource for which to retrieve Products. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsInProductSetPagedResponse listProductsInProductSet(String name) { + ListProductsInProductSetRequest request = + ListProductsInProductSetRequest.newBuilder().setName(name).build(); + return listProductsInProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, + * the products field of the response will be empty. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ListProductsInProductSetRequest request = ListProductsInProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   for (Product element : productSearchClient.listProductsInProductSet(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 ListProductsInProductSetPagedResponse listProductsInProductSet( + ListProductsInProductSetRequest request) { + return listProductsInProductSetPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, + * the products field of the response will be empty. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ListProductsInProductSetRequest request = ListProductsInProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<ListProductsInProductSetPagedResponse> future = productSearchClient.listProductsInProductSetPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Product element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listProductsInProductSetPagedCallable() { + return stub.listProductsInProductSetPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, + * the products field of the response will be empty. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ListProductsInProductSetRequest request = ListProductsInProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   while (true) {
+   *     ListProductsInProductSetResponse response = productSearchClient.listProductsInProductSetCallable().call(request);
+   *     for (Product element : response.getProductsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listProductsInProductSetCallable() { + return stub.listProductsInProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) + * + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(parent, inputConfig).get();
+   * }
+   * 
+ * + * @param parent The project in which the ProductSets should be imported. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param inputConfig The input content for the list of requests. + * @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 + importProductSetsAsync(LocationName parent, ImportProductSetsInputConfig inputConfig) { + + ImportProductSetsRequest request = + ImportProductSetsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInputConfig(inputConfig) + .build(); + return importProductSetsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) + * + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(parent.toString(), inputConfig).get();
+   * }
+   * 
+ * + * @param parent The project in which the ProductSets should be imported. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param inputConfig The input content for the list of requests. + * @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 + importProductSetsAsync(String parent, ImportProductSetsInputConfig inputConfig) { + + ImportProductSetsRequest request = + ImportProductSetsRequest.newBuilder().setParent(parent).setInputConfig(inputConfig).build(); + return importProductSetsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) + * + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(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 + importProductSetsAsync(ImportProductSetsRequest request) { + return importProductSetsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) + * + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   OperationFuture<Operation> future = productSearchClient.importProductSetsOperationCallable().futureCall(request);
+   *   // Do something
+   *   ImportProductSetsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationCallable() { + return stub.importProductSetsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) + * + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = productSearchClient.importProductSetsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable importProductSetsCallable() { + return stub.importProductSetsCallable(); + } + + @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 ListProductSetsPagedResponse + extends AbstractPagedListResponse< + ListProductSetsRequest, ListProductSetsResponse, ProductSet, ListProductSetsPage, + ListProductSetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProductSetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListProductSetsPagedResponse apply(ListProductSetsPage input) { + return new ListProductSetsPagedResponse(input); + } + }); + } + + private ListProductSetsPagedResponse(ListProductSetsPage page) { + super(page, ListProductSetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProductSetsPage + extends AbstractPage< + ListProductSetsRequest, ListProductSetsResponse, ProductSet, ListProductSetsPage> { + + private ListProductSetsPage( + PageContext context, + ListProductSetsResponse response) { + super(context, response); + } + + private static ListProductSetsPage createEmptyPage() { + return new ListProductSetsPage(null, null); + } + + @Override + protected ListProductSetsPage createPage( + PageContext context, + ListProductSetsResponse response) { + return new ListProductSetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProductSetsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProductSetsRequest, ListProductSetsResponse, ProductSet, ListProductSetsPage, + ListProductSetsFixedSizeCollection> { + + private ListProductSetsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProductSetsFixedSizeCollection createEmptyCollection() { + return new ListProductSetsFixedSizeCollection(null, 0); + } + + @Override + protected ListProductSetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProductSetsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListProductsPagedResponse + extends AbstractPagedListResponse< + ListProductsRequest, ListProductsResponse, Product, ListProductsPage, + ListProductsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProductsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListProductsPagedResponse apply(ListProductsPage input) { + return new ListProductsPagedResponse(input); + } + }); + } + + private ListProductsPagedResponse(ListProductsPage page) { + super(page, ListProductsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProductsPage + extends AbstractPage { + + private ListProductsPage( + PageContext context, + ListProductsResponse response) { + super(context, response); + } + + private static ListProductsPage createEmptyPage() { + return new ListProductsPage(null, null); + } + + @Override + protected ListProductsPage createPage( + PageContext context, + ListProductsResponse response) { + return new ListProductsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProductsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProductsRequest, ListProductsResponse, Product, ListProductsPage, + ListProductsFixedSizeCollection> { + + private ListProductsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProductsFixedSizeCollection createEmptyCollection() { + return new ListProductsFixedSizeCollection(null, 0); + } + + @Override + protected ListProductsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProductsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListReferenceImagesPagedResponse + extends AbstractPagedListResponse< + ListReferenceImagesRequest, ListReferenceImagesResponse, ReferenceImage, + ListReferenceImagesPage, ListReferenceImagesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListReferenceImagesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListReferenceImagesPagedResponse apply(ListReferenceImagesPage input) { + return new ListReferenceImagesPagedResponse(input); + } + }); + } + + private ListReferenceImagesPagedResponse(ListReferenceImagesPage page) { + super(page, ListReferenceImagesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListReferenceImagesPage + extends AbstractPage< + ListReferenceImagesRequest, ListReferenceImagesResponse, ReferenceImage, + ListReferenceImagesPage> { + + private ListReferenceImagesPage( + PageContext + context, + ListReferenceImagesResponse response) { + super(context, response); + } + + private static ListReferenceImagesPage createEmptyPage() { + return new ListReferenceImagesPage(null, null); + } + + @Override + protected ListReferenceImagesPage createPage( + PageContext + context, + ListReferenceImagesResponse response) { + return new ListReferenceImagesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListReferenceImagesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListReferenceImagesRequest, ListReferenceImagesResponse, ReferenceImage, + ListReferenceImagesPage, ListReferenceImagesFixedSizeCollection> { + + private ListReferenceImagesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListReferenceImagesFixedSizeCollection createEmptyCollection() { + return new ListReferenceImagesFixedSizeCollection(null, 0); + } + + @Override + protected ListReferenceImagesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListReferenceImagesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListProductsInProductSetPagedResponse + extends AbstractPagedListResponse< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, Product, + ListProductsInProductSetPage, ListProductsInProductSetFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProductsInProductSetPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListProductsInProductSetPagedResponse apply(ListProductsInProductSetPage input) { + return new ListProductsInProductSetPagedResponse(input); + } + }); + } + + private ListProductsInProductSetPagedResponse(ListProductsInProductSetPage page) { + super(page, ListProductsInProductSetFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProductsInProductSetPage + extends AbstractPage< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, Product, + ListProductsInProductSetPage> { + + private ListProductsInProductSetPage( + PageContext + context, + ListProductsInProductSetResponse response) { + super(context, response); + } + + private static ListProductsInProductSetPage createEmptyPage() { + return new ListProductsInProductSetPage(null, null); + } + + @Override + protected ListProductsInProductSetPage createPage( + PageContext + context, + ListProductsInProductSetResponse response) { + return new ListProductsInProductSetPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProductsInProductSetFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, Product, + ListProductsInProductSetPage, ListProductsInProductSetFixedSizeCollection> { + + private ListProductsInProductSetFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProductsInProductSetFixedSizeCollection createEmptyCollection() { + return new ListProductsInProductSetFixedSizeCollection(null, 0); + } + + @Override + protected ListProductsInProductSetFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProductsInProductSetFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchSettings.java new file mode 100644 index 000000000000..0c8e30410825 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchSettings.java @@ -0,0 +1,399 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListReferenceImagesPagedResponse; + +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.vision.v1p3beta1.stub.ProductSearchStubSettings; +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 ProductSearchClient}. + * + *

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

    + *
  • The default service address (vision.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 createProductSet to 30 seconds: + * + *

+ * 
+ * ProductSearchSettings.Builder productSearchSettingsBuilder =
+ *     ProductSearchSettings.newBuilder();
+ * productSearchSettingsBuilder.createProductSetSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ProductSearchSettings productSearchSettings = productSearchSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ProductSearchSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createProductSet. */ + public UnaryCallSettings createProductSetSettings() { + return ((ProductSearchStubSettings) getStubSettings()).createProductSetSettings(); + } + + /** Returns the object with the settings used for calls to listProductSets. */ + public PagedCallSettings< + ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse> + listProductSetsSettings() { + return ((ProductSearchStubSettings) getStubSettings()).listProductSetsSettings(); + } + + /** Returns the object with the settings used for calls to getProductSet. */ + public UnaryCallSettings getProductSetSettings() { + return ((ProductSearchStubSettings) getStubSettings()).getProductSetSettings(); + } + + /** Returns the object with the settings used for calls to updateProductSet. */ + public UnaryCallSettings updateProductSetSettings() { + return ((ProductSearchStubSettings) getStubSettings()).updateProductSetSettings(); + } + + /** Returns the object with the settings used for calls to deleteProductSet. */ + public UnaryCallSettings deleteProductSetSettings() { + return ((ProductSearchStubSettings) getStubSettings()).deleteProductSetSettings(); + } + + /** Returns the object with the settings used for calls to createProduct. */ + public UnaryCallSettings createProductSettings() { + return ((ProductSearchStubSettings) getStubSettings()).createProductSettings(); + } + + /** Returns the object with the settings used for calls to listProducts. */ + public PagedCallSettings + listProductsSettings() { + return ((ProductSearchStubSettings) getStubSettings()).listProductsSettings(); + } + + /** Returns the object with the settings used for calls to getProduct. */ + public UnaryCallSettings getProductSettings() { + return ((ProductSearchStubSettings) getStubSettings()).getProductSettings(); + } + + /** Returns the object with the settings used for calls to updateProduct. */ + public UnaryCallSettings updateProductSettings() { + return ((ProductSearchStubSettings) getStubSettings()).updateProductSettings(); + } + + /** Returns the object with the settings used for calls to deleteProduct. */ + public UnaryCallSettings deleteProductSettings() { + return ((ProductSearchStubSettings) getStubSettings()).deleteProductSettings(); + } + + /** Returns the object with the settings used for calls to createReferenceImage. */ + public UnaryCallSettings + createReferenceImageSettings() { + return ((ProductSearchStubSettings) getStubSettings()).createReferenceImageSettings(); + } + + /** Returns the object with the settings used for calls to deleteReferenceImage. */ + public UnaryCallSettings deleteReferenceImageSettings() { + return ((ProductSearchStubSettings) getStubSettings()).deleteReferenceImageSettings(); + } + + /** Returns the object with the settings used for calls to listReferenceImages. */ + public PagedCallSettings< + ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse> + listReferenceImagesSettings() { + return ((ProductSearchStubSettings) getStubSettings()).listReferenceImagesSettings(); + } + + /** Returns the object with the settings used for calls to getReferenceImage. */ + public UnaryCallSettings getReferenceImageSettings() { + return ((ProductSearchStubSettings) getStubSettings()).getReferenceImageSettings(); + } + + /** Returns the object with the settings used for calls to addProductToProductSet. */ + public UnaryCallSettings addProductToProductSetSettings() { + return ((ProductSearchStubSettings) getStubSettings()).addProductToProductSetSettings(); + } + + /** Returns the object with the settings used for calls to removeProductFromProductSet. */ + public UnaryCallSettings + removeProductFromProductSetSettings() { + return ((ProductSearchStubSettings) getStubSettings()).removeProductFromProductSetSettings(); + } + + /** Returns the object with the settings used for calls to listProductsInProductSet. */ + public PagedCallSettings< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, + ListProductsInProductSetPagedResponse> + listProductsInProductSetSettings() { + return ((ProductSearchStubSettings) getStubSettings()).listProductsInProductSetSettings(); + } + + /** Returns the object with the settings used for calls to importProductSets. */ + public UnaryCallSettings importProductSetsSettings() { + return ((ProductSearchStubSettings) getStubSettings()).importProductSetsSettings(); + } + + /** Returns the object with the settings used for calls to importProductSets. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationSettings() { + return ((ProductSearchStubSettings) getStubSettings()).importProductSetsOperationSettings(); + } + + public static final ProductSearchSettings create(ProductSearchStubSettings stub) + throws IOException { + return new ProductSearchSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ProductSearchStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ProductSearchStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ProductSearchStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ProductSearchStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ProductSearchStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ProductSearchStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ProductSearchStubSettings.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 ProductSearchSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ProductSearchSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ProductSearchStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ProductSearchStubSettings.newBuilder()); + } + + protected Builder(ProductSearchSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ProductSearchStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ProductSearchStubSettings.Builder getStubSettingsBuilder() { + return ((ProductSearchStubSettings.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 createProductSet. */ + public UnaryCallSettings.Builder + createProductSetSettings() { + return getStubSettingsBuilder().createProductSetSettings(); + } + + /** Returns the builder for the settings used for calls to listProductSets. */ + public PagedCallSettings.Builder< + ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse> + listProductSetsSettings() { + return getStubSettingsBuilder().listProductSetsSettings(); + } + + /** Returns the builder for the settings used for calls to getProductSet. */ + public UnaryCallSettings.Builder getProductSetSettings() { + return getStubSettingsBuilder().getProductSetSettings(); + } + + /** Returns the builder for the settings used for calls to updateProductSet. */ + public UnaryCallSettings.Builder + updateProductSetSettings() { + return getStubSettingsBuilder().updateProductSetSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProductSet. */ + public UnaryCallSettings.Builder deleteProductSetSettings() { + return getStubSettingsBuilder().deleteProductSetSettings(); + } + + /** Returns the builder for the settings used for calls to createProduct. */ + public UnaryCallSettings.Builder createProductSettings() { + return getStubSettingsBuilder().createProductSettings(); + } + + /** Returns the builder for the settings used for calls to listProducts. */ + public PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings() { + return getStubSettingsBuilder().listProductsSettings(); + } + + /** Returns the builder for the settings used for calls to getProduct. */ + public UnaryCallSettings.Builder getProductSettings() { + return getStubSettingsBuilder().getProductSettings(); + } + + /** Returns the builder for the settings used for calls to updateProduct. */ + public UnaryCallSettings.Builder updateProductSettings() { + return getStubSettingsBuilder().updateProductSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProduct. */ + public UnaryCallSettings.Builder deleteProductSettings() { + return getStubSettingsBuilder().deleteProductSettings(); + } + + /** Returns the builder for the settings used for calls to createReferenceImage. */ + public UnaryCallSettings.Builder + createReferenceImageSettings() { + return getStubSettingsBuilder().createReferenceImageSettings(); + } + + /** Returns the builder for the settings used for calls to deleteReferenceImage. */ + public UnaryCallSettings.Builder + deleteReferenceImageSettings() { + return getStubSettingsBuilder().deleteReferenceImageSettings(); + } + + /** Returns the builder for the settings used for calls to listReferenceImages. */ + public PagedCallSettings.Builder< + ListReferenceImagesRequest, ListReferenceImagesResponse, + ListReferenceImagesPagedResponse> + listReferenceImagesSettings() { + return getStubSettingsBuilder().listReferenceImagesSettings(); + } + + /** Returns the builder for the settings used for calls to getReferenceImage. */ + public UnaryCallSettings.Builder + getReferenceImageSettings() { + return getStubSettingsBuilder().getReferenceImageSettings(); + } + + /** Returns the builder for the settings used for calls to addProductToProductSet. */ + public UnaryCallSettings.Builder + addProductToProductSetSettings() { + return getStubSettingsBuilder().addProductToProductSetSettings(); + } + + /** Returns the builder for the settings used for calls to removeProductFromProductSet. */ + public UnaryCallSettings.Builder + removeProductFromProductSetSettings() { + return getStubSettingsBuilder().removeProductFromProductSetSettings(); + } + + /** Returns the builder for the settings used for calls to listProductsInProductSet. */ + public PagedCallSettings.Builder< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, + ListProductsInProductSetPagedResponse> + listProductsInProductSetSettings() { + return getStubSettingsBuilder().listProductsInProductSetSettings(); + } + + /** Returns the builder for the settings used for calls to importProductSets. */ + public UnaryCallSettings.Builder + importProductSetsSettings() { + return getStubSettingsBuilder().importProductSetsSettings(); + } + + /** Returns the builder for the settings used for calls to importProductSets. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationSettings() { + return getStubSettingsBuilder().importProductSetsOperationSettings(); + } + + @Override + public ProductSearchSettings build() throws IOException { + return new ProductSearchSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/package-info.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/package-info.java new file mode 100644 index 000000000000..14b1f8c48bd3 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/package-info.java @@ -0,0 +1,70 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Vision API. + * + *

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

=================== ProductSearchClient =================== + * + *

Service Description: Manages Products and ProductSets of reference images for use in product + * search. It uses the following resource model: + * + *

- The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] + * resources, named `projects/*/locations/*/productSets/*`, which acts as a way to put + * different products into groups to limit identification. + * + *

In parallel, + * + *

- The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, + * named `projects/*/locations/*/products/*` + * + *

- Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of + * [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named + * `projects/*/locations/*/products/*/referenceImages/*` + * + *

Sample for ProductSearchClient: + * + *

+ * 
+ * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   ProductSet productSet = ProductSet.newBuilder().build();
+ *   String productSetId = "";
+ *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
+ * }
+ * 
+ * 
+ * + * ==================== ImageAnnotatorClient ==================== + * + *

Service Description: Service that performs Google Cloud Vision API detection tasks over client + * images, such as face, landmark, logo, label, and text detection. The ImageAnnotator service + * returns detected entities from the images. + * + *

Sample for ImageAnnotatorClient: + * + *

+ * 
+ * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+ *   List<AnnotateImageRequest> requests = new ArrayList<>();
+ *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.vision.v1p3beta1; diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcImageAnnotatorCallableFactory.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcImageAnnotatorCallableFactory.java new file mode 100644 index 000000000000..01d4846191bd --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcImageAnnotatorCallableFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1.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.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud Vision 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 GrpcImageAnnotatorCallableFactory 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-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcImageAnnotatorStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcImageAnnotatorStub.java new file mode 100644 index 000000000000..9c91111f1be2 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcImageAnnotatorStub.java @@ -0,0 +1,205 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p3beta1.OperationMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Vision 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 GrpcImageAnnotatorStub extends ImageAnnotatorStub { + + private static final MethodDescriptor + batchAnnotateImagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ImageAnnotator/BatchAnnotateImages") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + asyncBatchAnnotateFilesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.vision.v1p3beta1.ImageAnnotator/AsyncBatchAnnotateFiles") + .setRequestMarshaller( + ProtoUtils.marshaller(AsyncBatchAnnotateFilesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable + batchAnnotateImagesCallable; + private final UnaryCallable + asyncBatchAnnotateFilesCallable; + private final OperationCallable< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcImageAnnotatorStub create(ImageAnnotatorStubSettings settings) + throws IOException { + return new GrpcImageAnnotatorStub(settings, ClientContext.create(settings)); + } + + public static final GrpcImageAnnotatorStub create(ClientContext clientContext) + throws IOException { + return new GrpcImageAnnotatorStub( + ImageAnnotatorStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcImageAnnotatorStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcImageAnnotatorStub( + ImageAnnotatorStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcImageAnnotatorStub, 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 GrpcImageAnnotatorStub(ImageAnnotatorStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcImageAnnotatorCallableFactory()); + } + + /** + * Constructs an instance of GrpcImageAnnotatorStub, 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 GrpcImageAnnotatorStub( + ImageAnnotatorStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + batchAnnotateImagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchAnnotateImagesMethodDescriptor) + .build(); + GrpcCallSettings + asyncBatchAnnotateFilesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(asyncBatchAnnotateFilesMethodDescriptor) + .build(); + + this.batchAnnotateImagesCallable = + callableFactory.createUnaryCallable( + batchAnnotateImagesTransportSettings, + settings.batchAnnotateImagesSettings(), + clientContext); + this.asyncBatchAnnotateFilesCallable = + callableFactory.createUnaryCallable( + asyncBatchAnnotateFilesTransportSettings, + settings.asyncBatchAnnotateFilesSettings(), + clientContext); + this.asyncBatchAnnotateFilesOperationCallable = + callableFactory.createOperationCallable( + asyncBatchAnnotateFilesTransportSettings, + settings.asyncBatchAnnotateFilesOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + batchAnnotateImagesCallable() { + return batchAnnotateImagesCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationCallable() { + return asyncBatchAnnotateFilesOperationCallable; + } + + public UnaryCallable + asyncBatchAnnotateFilesCallable() { + return asyncBatchAnnotateFilesCallable; + } + + @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-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchCallableFactory.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchCallableFactory.java new file mode 100644 index 000000000000..a40b9de34c5e --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchCallableFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1.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.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud Vision 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 GrpcProductSearchCallableFactory 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-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchStub.java new file mode 100644 index 000000000000..b09bdeefddad --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchStub.java @@ -0,0 +1,633 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1.stub; + +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListReferenceImagesPagedResponse; + +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.UnaryCallable; +import com.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1p3beta1.BatchOperationMetadata; +import com.google.cloud.vision.v1p3beta1.CreateProductRequest; +import com.google.cloud.vision.v1p3beta1.CreateProductSetRequest; +import com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.DeleteProductRequest; +import com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest; +import com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.GetProductRequest; +import com.google.cloud.vision.v1p3beta1.GetProductSetRequest; +import com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest; +import com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse; +import com.google.cloud.vision.v1p3beta1.ListProductSetsRequest; +import com.google.cloud.vision.v1p3beta1.ListProductSetsResponse; +import com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1p3beta1.ListProductsRequest; +import com.google.cloud.vision.v1p3beta1.ListProductsResponse; +import com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1p3beta1.Product; +import com.google.cloud.vision.v1p3beta1.ProductSet; +import com.google.cloud.vision.v1p3beta1.ReferenceImage; +import com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1p3beta1.UpdateProductRequest; +import com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Vision 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 GrpcProductSearchStub extends ProductSearchStub { + + private static final MethodDescriptor + createProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/CreateProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProductSet.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listProductSetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/ListProductSets") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProductSetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProductSetsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/GetProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(GetProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProductSet.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/UpdateProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProductSet.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/CreateProduct") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/ListProducts") + .setRequestMarshaller(ProtoUtils.marshaller(ListProductsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProductsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/GetProduct") + .setRequestMarshaller(ProtoUtils.marshaller(GetProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/UpdateProduct") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteProduct") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createReferenceImageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/CreateReferenceImage") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReferenceImage.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteReferenceImageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteReferenceImage") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listReferenceImagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/ListReferenceImages") + .setRequestMarshaller( + ProtoUtils.marshaller(ListReferenceImagesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListReferenceImagesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getReferenceImageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/GetReferenceImage") + .setRequestMarshaller( + ProtoUtils.marshaller(GetReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReferenceImage.getDefaultInstance())) + .build(); + private static final MethodDescriptor + addProductToProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch/AddProductToProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(AddProductToProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + removeProductFromProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch/RemoveProductFromProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveProductFromProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + ListProductsInProductSetRequest, ListProductsInProductSetResponse> + listProductsInProductSetMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.vision.v1p3beta1.ProductSearch/ListProductsInProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProductsInProductSetRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProductsInProductSetResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + importProductSetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/ImportProductSets") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportProductSetsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable createProductSetCallable; + private final UnaryCallable + listProductSetsCallable; + private final UnaryCallable + listProductSetsPagedCallable; + private final UnaryCallable getProductSetCallable; + private final UnaryCallable updateProductSetCallable; + private final UnaryCallable deleteProductSetCallable; + private final UnaryCallable createProductCallable; + private final UnaryCallable listProductsCallable; + private final UnaryCallable + listProductsPagedCallable; + private final UnaryCallable getProductCallable; + private final UnaryCallable updateProductCallable; + private final UnaryCallable deleteProductCallable; + private final UnaryCallable + createReferenceImageCallable; + private final UnaryCallable deleteReferenceImageCallable; + private final UnaryCallable + listReferenceImagesCallable; + private final UnaryCallable + listReferenceImagesPagedCallable; + private final UnaryCallable getReferenceImageCallable; + private final UnaryCallable addProductToProductSetCallable; + private final UnaryCallable + removeProductFromProductSetCallable; + private final UnaryCallable + listProductsInProductSetCallable; + private final UnaryCallable< + ListProductsInProductSetRequest, ListProductsInProductSetPagedResponse> + listProductsInProductSetPagedCallable; + private final UnaryCallable importProductSetsCallable; + private final OperationCallable< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcProductSearchStub create(ProductSearchStubSettings settings) + throws IOException { + return new GrpcProductSearchStub(settings, ClientContext.create(settings)); + } + + public static final GrpcProductSearchStub create(ClientContext clientContext) throws IOException { + return new GrpcProductSearchStub(ProductSearchStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcProductSearchStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcProductSearchStub( + ProductSearchStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcProductSearchStub, 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 GrpcProductSearchStub(ProductSearchStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcProductSearchCallableFactory()); + } + + /** + * Constructs an instance of GrpcProductSearchStub, 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 GrpcProductSearchStub( + ProductSearchStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createProductSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProductSetMethodDescriptor) + .build(); + GrpcCallSettings + listProductSetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProductSetsMethodDescriptor) + .build(); + GrpcCallSettings getProductSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProductSetMethodDescriptor) + .build(); + GrpcCallSettings updateProductSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateProductSetMethodDescriptor) + .build(); + GrpcCallSettings deleteProductSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProductSetMethodDescriptor) + .build(); + GrpcCallSettings createProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProductMethodDescriptor) + .build(); + GrpcCallSettings listProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProductsMethodDescriptor) + .build(); + GrpcCallSettings getProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProductMethodDescriptor) + .build(); + GrpcCallSettings updateProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateProductMethodDescriptor) + .build(); + GrpcCallSettings deleteProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProductMethodDescriptor) + .build(); + GrpcCallSettings + createReferenceImageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createReferenceImageMethodDescriptor) + .build(); + GrpcCallSettings deleteReferenceImageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteReferenceImageMethodDescriptor) + .build(); + GrpcCallSettings + listReferenceImagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listReferenceImagesMethodDescriptor) + .build(); + GrpcCallSettings getReferenceImageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getReferenceImageMethodDescriptor) + .build(); + GrpcCallSettings addProductToProductSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addProductToProductSetMethodDescriptor) + .build(); + GrpcCallSettings + removeProductFromProductSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeProductFromProductSetMethodDescriptor) + .build(); + GrpcCallSettings + listProductsInProductSetTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listProductsInProductSetMethodDescriptor) + .build(); + GrpcCallSettings importProductSetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importProductSetsMethodDescriptor) + .build(); + + this.createProductSetCallable = + callableFactory.createUnaryCallable( + createProductSetTransportSettings, settings.createProductSetSettings(), clientContext); + this.listProductSetsCallable = + callableFactory.createUnaryCallable( + listProductSetsTransportSettings, settings.listProductSetsSettings(), clientContext); + this.listProductSetsPagedCallable = + callableFactory.createPagedCallable( + listProductSetsTransportSettings, settings.listProductSetsSettings(), clientContext); + this.getProductSetCallable = + callableFactory.createUnaryCallable( + getProductSetTransportSettings, settings.getProductSetSettings(), clientContext); + this.updateProductSetCallable = + callableFactory.createUnaryCallable( + updateProductSetTransportSettings, settings.updateProductSetSettings(), clientContext); + this.deleteProductSetCallable = + callableFactory.createUnaryCallable( + deleteProductSetTransportSettings, settings.deleteProductSetSettings(), clientContext); + this.createProductCallable = + callableFactory.createUnaryCallable( + createProductTransportSettings, settings.createProductSettings(), clientContext); + this.listProductsCallable = + callableFactory.createUnaryCallable( + listProductsTransportSettings, settings.listProductsSettings(), clientContext); + this.listProductsPagedCallable = + callableFactory.createPagedCallable( + listProductsTransportSettings, settings.listProductsSettings(), clientContext); + this.getProductCallable = + callableFactory.createUnaryCallable( + getProductTransportSettings, settings.getProductSettings(), clientContext); + this.updateProductCallable = + callableFactory.createUnaryCallable( + updateProductTransportSettings, settings.updateProductSettings(), clientContext); + this.deleteProductCallable = + callableFactory.createUnaryCallable( + deleteProductTransportSettings, settings.deleteProductSettings(), clientContext); + this.createReferenceImageCallable = + callableFactory.createUnaryCallable( + createReferenceImageTransportSettings, + settings.createReferenceImageSettings(), + clientContext); + this.deleteReferenceImageCallable = + callableFactory.createUnaryCallable( + deleteReferenceImageTransportSettings, + settings.deleteReferenceImageSettings(), + clientContext); + this.listReferenceImagesCallable = + callableFactory.createUnaryCallable( + listReferenceImagesTransportSettings, + settings.listReferenceImagesSettings(), + clientContext); + this.listReferenceImagesPagedCallable = + callableFactory.createPagedCallable( + listReferenceImagesTransportSettings, + settings.listReferenceImagesSettings(), + clientContext); + this.getReferenceImageCallable = + callableFactory.createUnaryCallable( + getReferenceImageTransportSettings, + settings.getReferenceImageSettings(), + clientContext); + this.addProductToProductSetCallable = + callableFactory.createUnaryCallable( + addProductToProductSetTransportSettings, + settings.addProductToProductSetSettings(), + clientContext); + this.removeProductFromProductSetCallable = + callableFactory.createUnaryCallable( + removeProductFromProductSetTransportSettings, + settings.removeProductFromProductSetSettings(), + clientContext); + this.listProductsInProductSetCallable = + callableFactory.createUnaryCallable( + listProductsInProductSetTransportSettings, + settings.listProductsInProductSetSettings(), + clientContext); + this.listProductsInProductSetPagedCallable = + callableFactory.createPagedCallable( + listProductsInProductSetTransportSettings, + settings.listProductsInProductSetSettings(), + clientContext); + this.importProductSetsCallable = + callableFactory.createUnaryCallable( + importProductSetsTransportSettings, + settings.importProductSetsSettings(), + clientContext); + this.importProductSetsOperationCallable = + callableFactory.createOperationCallable( + importProductSetsTransportSettings, + settings.importProductSetsOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable createProductSetCallable() { + return createProductSetCallable; + } + + public UnaryCallable + listProductSetsPagedCallable() { + return listProductSetsPagedCallable; + } + + public UnaryCallable listProductSetsCallable() { + return listProductSetsCallable; + } + + public UnaryCallable getProductSetCallable() { + return getProductSetCallable; + } + + public UnaryCallable updateProductSetCallable() { + return updateProductSetCallable; + } + + public UnaryCallable deleteProductSetCallable() { + return deleteProductSetCallable; + } + + public UnaryCallable createProductCallable() { + return createProductCallable; + } + + public UnaryCallable listProductsPagedCallable() { + return listProductsPagedCallable; + } + + public UnaryCallable listProductsCallable() { + return listProductsCallable; + } + + public UnaryCallable getProductCallable() { + return getProductCallable; + } + + public UnaryCallable updateProductCallable() { + return updateProductCallable; + } + + public UnaryCallable deleteProductCallable() { + return deleteProductCallable; + } + + public UnaryCallable createReferenceImageCallable() { + return createReferenceImageCallable; + } + + public UnaryCallable deleteReferenceImageCallable() { + return deleteReferenceImageCallable; + } + + public UnaryCallable + listReferenceImagesPagedCallable() { + return listReferenceImagesPagedCallable; + } + + public UnaryCallable + listReferenceImagesCallable() { + return listReferenceImagesCallable; + } + + public UnaryCallable getReferenceImageCallable() { + return getReferenceImageCallable; + } + + public UnaryCallable addProductToProductSetCallable() { + return addProductToProductSetCallable; + } + + public UnaryCallable + removeProductFromProductSetCallable() { + return removeProductFromProductSetCallable; + } + + public UnaryCallable + listProductsInProductSetPagedCallable() { + return listProductsInProductSetPagedCallable; + } + + public UnaryCallable + listProductsInProductSetCallable() { + return listProductsInProductSetCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationCallable() { + return importProductSetsOperationCallable; + } + + public UnaryCallable importProductSetsCallable() { + return importProductSetsCallable; + } + + @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-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStub.java new file mode 100644 index 000000000000..b449e77cecf6 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStub.java @@ -0,0 +1,66 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1.stub; + +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.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p3beta1.OperationMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud Vision 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 ImageAnnotatorStub 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 + batchAnnotateImagesCallable() { + throw new UnsupportedOperationException("Not implemented: batchAnnotateImagesCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: asyncBatchAnnotateFilesOperationCallable()"); + } + + public UnaryCallable + asyncBatchAnnotateFilesCallable() { + throw new UnsupportedOperationException("Not implemented: asyncBatchAnnotateFilesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStubSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStubSettings.java new file mode 100644 index 000000000000..18205e272330 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStubSettings.java @@ -0,0 +1,359 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1.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.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p3beta1.OperationMetadata; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ImageAnnotatorStub}. + * + *

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

    + *
  • The default service address (vision.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 batchAnnotateImages to 30 seconds: + * + *

+ * 
+ * ImageAnnotatorStubSettings.Builder imageAnnotatorSettingsBuilder =
+ *     ImageAnnotatorStubSettings.newBuilder();
+ * imageAnnotatorSettingsBuilder.batchAnnotateImagesSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ImageAnnotatorStubSettings imageAnnotatorSettings = imageAnnotatorSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ImageAnnotatorStubSettings 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") + .add("https://www.googleapis.com/auth/cloud-vision") + .build(); + + private final UnaryCallSettings + batchAnnotateImagesSettings; + private final UnaryCallSettings + asyncBatchAnnotateFilesSettings; + private final OperationCallSettings< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationSettings; + + /** Returns the object with the settings used for calls to batchAnnotateImages. */ + public UnaryCallSettings + batchAnnotateImagesSettings() { + return batchAnnotateImagesSettings; + } + + /** Returns the object with the settings used for calls to asyncBatchAnnotateFiles. */ + public UnaryCallSettings + asyncBatchAnnotateFilesSettings() { + return asyncBatchAnnotateFilesSettings; + } + + /** Returns the object with the settings used for calls to asyncBatchAnnotateFiles. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationSettings() { + return asyncBatchAnnotateFilesOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ImageAnnotatorStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcImageAnnotatorStub.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 "vision.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(); + } + + 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(ImageAnnotatorStubSettings.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 ImageAnnotatorStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + batchAnnotateImagesSettings = settingsBuilder.batchAnnotateImagesSettings().build(); + asyncBatchAnnotateFilesSettings = settingsBuilder.asyncBatchAnnotateFilesSettings().build(); + asyncBatchAnnotateFilesOperationSettings = + settingsBuilder.asyncBatchAnnotateFilesOperationSettings().build(); + } + + /** Builder for ImageAnnotatorStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + batchAnnotateImagesSettings; + private final UnaryCallSettings.Builder + asyncBatchAnnotateFilesSettings; + private final OperationCallSettings.Builder< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationSettings; + + 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(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .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); + + batchAnnotateImagesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + asyncBatchAnnotateFilesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + asyncBatchAnnotateFilesOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + batchAnnotateImagesSettings, asyncBatchAnnotateFilesSettings); + + 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 + .batchAnnotateImagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .asyncBatchAnnotateFilesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .asyncBatchAnnotateFilesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + AsyncBatchAnnotateFilesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(20000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); + + return builder; + } + + protected Builder(ImageAnnotatorStubSettings settings) { + super(settings); + + batchAnnotateImagesSettings = settings.batchAnnotateImagesSettings.toBuilder(); + asyncBatchAnnotateFilesSettings = settings.asyncBatchAnnotateFilesSettings.toBuilder(); + asyncBatchAnnotateFilesOperationSettings = + settings.asyncBatchAnnotateFilesOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + batchAnnotateImagesSettings, asyncBatchAnnotateFilesSettings); + } + + // 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 batchAnnotateImages. */ + public UnaryCallSettings.Builder + batchAnnotateImagesSettings() { + return batchAnnotateImagesSettings; + } + + /** Returns the builder for the settings used for calls to asyncBatchAnnotateFiles. */ + public UnaryCallSettings.Builder + asyncBatchAnnotateFilesSettings() { + return asyncBatchAnnotateFilesSettings; + } + + /** Returns the builder for the settings used for calls to asyncBatchAnnotateFiles. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> + asyncBatchAnnotateFilesOperationSettings() { + return asyncBatchAnnotateFilesOperationSettings; + } + + @Override + public ImageAnnotatorStubSettings build() throws IOException { + return new ImageAnnotatorStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStub.java new file mode 100644 index 000000000000..579d14c7928d --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStub.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1.stub; + +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListReferenceImagesPagedResponse; + +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.vision.v1p3beta1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1p3beta1.BatchOperationMetadata; +import com.google.cloud.vision.v1p3beta1.CreateProductRequest; +import com.google.cloud.vision.v1p3beta1.CreateProductSetRequest; +import com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.DeleteProductRequest; +import com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest; +import com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.GetProductRequest; +import com.google.cloud.vision.v1p3beta1.GetProductSetRequest; +import com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest; +import com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse; +import com.google.cloud.vision.v1p3beta1.ListProductSetsRequest; +import com.google.cloud.vision.v1p3beta1.ListProductSetsResponse; +import com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1p3beta1.ListProductsRequest; +import com.google.cloud.vision.v1p3beta1.ListProductsResponse; +import com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1p3beta1.Product; +import com.google.cloud.vision.v1p3beta1.ProductSet; +import com.google.cloud.vision.v1p3beta1.ReferenceImage; +import com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1p3beta1.UpdateProductRequest; +import com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest; +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 Vision 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 ProductSearchStub 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 createProductSetCallable() { + throw new UnsupportedOperationException("Not implemented: createProductSetCallable()"); + } + + public UnaryCallable + listProductSetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProductSetsPagedCallable()"); + } + + public UnaryCallable listProductSetsCallable() { + throw new UnsupportedOperationException("Not implemented: listProductSetsCallable()"); + } + + public UnaryCallable getProductSetCallable() { + throw new UnsupportedOperationException("Not implemented: getProductSetCallable()"); + } + + public UnaryCallable updateProductSetCallable() { + throw new UnsupportedOperationException("Not implemented: updateProductSetCallable()"); + } + + public UnaryCallable deleteProductSetCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProductSetCallable()"); + } + + public UnaryCallable createProductCallable() { + throw new UnsupportedOperationException("Not implemented: createProductCallable()"); + } + + public UnaryCallable listProductsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsPagedCallable()"); + } + + public UnaryCallable listProductsCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsCallable()"); + } + + public UnaryCallable getProductCallable() { + throw new UnsupportedOperationException("Not implemented: getProductCallable()"); + } + + public UnaryCallable updateProductCallable() { + throw new UnsupportedOperationException("Not implemented: updateProductCallable()"); + } + + public UnaryCallable deleteProductCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProductCallable()"); + } + + public UnaryCallable createReferenceImageCallable() { + throw new UnsupportedOperationException("Not implemented: createReferenceImageCallable()"); + } + + public UnaryCallable deleteReferenceImageCallable() { + throw new UnsupportedOperationException("Not implemented: deleteReferenceImageCallable()"); + } + + public UnaryCallable + listReferenceImagesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listReferenceImagesPagedCallable()"); + } + + public UnaryCallable + listReferenceImagesCallable() { + throw new UnsupportedOperationException("Not implemented: listReferenceImagesCallable()"); + } + + public UnaryCallable getReferenceImageCallable() { + throw new UnsupportedOperationException("Not implemented: getReferenceImageCallable()"); + } + + public UnaryCallable addProductToProductSetCallable() { + throw new UnsupportedOperationException("Not implemented: addProductToProductSetCallable()"); + } + + public UnaryCallable + removeProductFromProductSetCallable() { + throw new UnsupportedOperationException( + "Not implemented: removeProductFromProductSetCallable()"); + } + + public UnaryCallable + listProductsInProductSetPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listProductsInProductSetPagedCallable()"); + } + + public UnaryCallable + listProductsInProductSetCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsInProductSetCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: importProductSetsOperationCallable()"); + } + + public UnaryCallable importProductSetsCallable() { + throw new UnsupportedOperationException("Not implemented: importProductSetsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStubSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStubSettings.java new file mode 100644 index 000000000000..926eee16f94a --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStubSettings.java @@ -0,0 +1,1047 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1.stub; + +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListReferenceImagesPagedResponse; + +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.vision.v1p3beta1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1p3beta1.BatchOperationMetadata; +import com.google.cloud.vision.v1p3beta1.CreateProductRequest; +import com.google.cloud.vision.v1p3beta1.CreateProductSetRequest; +import com.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.DeleteProductRequest; +import com.google.cloud.vision.v1p3beta1.DeleteProductSetRequest; +import com.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.GetProductRequest; +import com.google.cloud.vision.v1p3beta1.GetProductSetRequest; +import com.google.cloud.vision.v1p3beta1.GetReferenceImageRequest; +import com.google.cloud.vision.v1p3beta1.ImportProductSetsRequest; +import com.google.cloud.vision.v1p3beta1.ImportProductSetsResponse; +import com.google.cloud.vision.v1p3beta1.ListProductSetsRequest; +import com.google.cloud.vision.v1p3beta1.ListProductSetsResponse; +import com.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1p3beta1.ListProductsRequest; +import com.google.cloud.vision.v1p3beta1.ListProductsResponse; +import com.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1p3beta1.Product; +import com.google.cloud.vision.v1p3beta1.ProductSet; +import com.google.cloud.vision.v1p3beta1.ReferenceImage; +import com.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1p3beta1.UpdateProductRequest; +import com.google.cloud.vision.v1p3beta1.UpdateProductSetRequest; +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 ProductSearchStub}. + * + *

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

    + *
  • The default service address (vision.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 createProductSet to 30 seconds: + * + *

+ * 
+ * ProductSearchStubSettings.Builder productSearchSettingsBuilder =
+ *     ProductSearchStubSettings.newBuilder();
+ * productSearchSettingsBuilder.createProductSetSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ProductSearchStubSettings productSearchSettings = productSearchSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ProductSearchStubSettings 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") + .add("https://www.googleapis.com/auth/cloud-vision") + .build(); + + private final UnaryCallSettings createProductSetSettings; + private final PagedCallSettings< + ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse> + listProductSetsSettings; + private final UnaryCallSettings getProductSetSettings; + private final UnaryCallSettings updateProductSetSettings; + private final UnaryCallSettings deleteProductSetSettings; + private final UnaryCallSettings createProductSettings; + private final PagedCallSettings< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; + private final UnaryCallSettings getProductSettings; + private final UnaryCallSettings updateProductSettings; + private final UnaryCallSettings deleteProductSettings; + private final UnaryCallSettings + createReferenceImageSettings; + private final UnaryCallSettings deleteReferenceImageSettings; + private final PagedCallSettings< + ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse> + listReferenceImagesSettings; + private final UnaryCallSettings + getReferenceImageSettings; + private final UnaryCallSettings + addProductToProductSetSettings; + private final UnaryCallSettings + removeProductFromProductSetSettings; + private final PagedCallSettings< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, + ListProductsInProductSetPagedResponse> + listProductsInProductSetSettings; + private final UnaryCallSettings importProductSetsSettings; + private final OperationCallSettings< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationSettings; + + /** Returns the object with the settings used for calls to createProductSet. */ + public UnaryCallSettings createProductSetSettings() { + return createProductSetSettings; + } + + /** Returns the object with the settings used for calls to listProductSets. */ + public PagedCallSettings< + ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse> + listProductSetsSettings() { + return listProductSetsSettings; + } + + /** Returns the object with the settings used for calls to getProductSet. */ + public UnaryCallSettings getProductSetSettings() { + return getProductSetSettings; + } + + /** Returns the object with the settings used for calls to updateProductSet. */ + public UnaryCallSettings updateProductSetSettings() { + return updateProductSetSettings; + } + + /** Returns the object with the settings used for calls to deleteProductSet. */ + public UnaryCallSettings deleteProductSetSettings() { + return deleteProductSetSettings; + } + + /** Returns the object with the settings used for calls to createProduct. */ + public UnaryCallSettings createProductSettings() { + return createProductSettings; + } + + /** Returns the object with the settings used for calls to listProducts. */ + public PagedCallSettings + listProductsSettings() { + return listProductsSettings; + } + + /** Returns the object with the settings used for calls to getProduct. */ + public UnaryCallSettings getProductSettings() { + return getProductSettings; + } + + /** Returns the object with the settings used for calls to updateProduct. */ + public UnaryCallSettings updateProductSettings() { + return updateProductSettings; + } + + /** Returns the object with the settings used for calls to deleteProduct. */ + public UnaryCallSettings deleteProductSettings() { + return deleteProductSettings; + } + + /** Returns the object with the settings used for calls to createReferenceImage. */ + public UnaryCallSettings + createReferenceImageSettings() { + return createReferenceImageSettings; + } + + /** Returns the object with the settings used for calls to deleteReferenceImage. */ + public UnaryCallSettings deleteReferenceImageSettings() { + return deleteReferenceImageSettings; + } + + /** Returns the object with the settings used for calls to listReferenceImages. */ + public PagedCallSettings< + ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse> + listReferenceImagesSettings() { + return listReferenceImagesSettings; + } + + /** Returns the object with the settings used for calls to getReferenceImage. */ + public UnaryCallSettings getReferenceImageSettings() { + return getReferenceImageSettings; + } + + /** Returns the object with the settings used for calls to addProductToProductSet. */ + public UnaryCallSettings addProductToProductSetSettings() { + return addProductToProductSetSettings; + } + + /** Returns the object with the settings used for calls to removeProductFromProductSet. */ + public UnaryCallSettings + removeProductFromProductSetSettings() { + return removeProductFromProductSetSettings; + } + + /** Returns the object with the settings used for calls to listProductsInProductSet. */ + public PagedCallSettings< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, + ListProductsInProductSetPagedResponse> + listProductsInProductSetSettings() { + return listProductsInProductSetSettings; + } + + /** Returns the object with the settings used for calls to importProductSets. */ + public UnaryCallSettings importProductSetsSettings() { + return importProductSetsSettings; + } + + /** Returns the object with the settings used for calls to importProductSets. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationSettings() { + return importProductSetsOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ProductSearchStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcProductSearchStub.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 "vision.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(); + } + + 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(ProductSearchStubSettings.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 ProductSearchStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createProductSetSettings = settingsBuilder.createProductSetSettings().build(); + listProductSetsSettings = settingsBuilder.listProductSetsSettings().build(); + getProductSetSettings = settingsBuilder.getProductSetSettings().build(); + updateProductSetSettings = settingsBuilder.updateProductSetSettings().build(); + deleteProductSetSettings = settingsBuilder.deleteProductSetSettings().build(); + createProductSettings = settingsBuilder.createProductSettings().build(); + listProductsSettings = settingsBuilder.listProductsSettings().build(); + getProductSettings = settingsBuilder.getProductSettings().build(); + updateProductSettings = settingsBuilder.updateProductSettings().build(); + deleteProductSettings = settingsBuilder.deleteProductSettings().build(); + createReferenceImageSettings = settingsBuilder.createReferenceImageSettings().build(); + deleteReferenceImageSettings = settingsBuilder.deleteReferenceImageSettings().build(); + listReferenceImagesSettings = settingsBuilder.listReferenceImagesSettings().build(); + getReferenceImageSettings = settingsBuilder.getReferenceImageSettings().build(); + addProductToProductSetSettings = settingsBuilder.addProductToProductSetSettings().build(); + removeProductFromProductSetSettings = + settingsBuilder.removeProductFromProductSetSettings().build(); + listProductsInProductSetSettings = settingsBuilder.listProductsInProductSetSettings().build(); + importProductSetsSettings = settingsBuilder.importProductSetsSettings().build(); + importProductSetsOperationSettings = + settingsBuilder.importProductSetsOperationSettings().build(); + } + + private static final PagedListDescriptor< + ListProductSetsRequest, ListProductSetsResponse, ProductSet> + LIST_PRODUCT_SETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductSetsRequest injectToken( + ListProductSetsRequest payload, String token) { + return ListProductSetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProductSetsRequest injectPageSize( + ListProductSetsRequest payload, int pageSize) { + return ListProductSetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProductSetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductSetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductSetsResponse payload) { + return payload.getProductSetsList(); + } + }; + + private static final PagedListDescriptor + LIST_PRODUCTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductsRequest injectToken(ListProductsRequest payload, String token) { + return ListProductsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProductsRequest injectPageSize(ListProductsRequest payload, int pageSize) { + return ListProductsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProductsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductsResponse payload) { + return payload.getProductsList(); + } + }; + + private static final PagedListDescriptor< + ListReferenceImagesRequest, ListReferenceImagesResponse, ReferenceImage> + LIST_REFERENCE_IMAGES_PAGE_STR_DESC = + new PagedListDescriptor< + ListReferenceImagesRequest, ListReferenceImagesResponse, ReferenceImage>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListReferenceImagesRequest injectToken( + ListReferenceImagesRequest payload, String token) { + return ListReferenceImagesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListReferenceImagesRequest injectPageSize( + ListReferenceImagesRequest payload, int pageSize) { + return ListReferenceImagesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListReferenceImagesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListReferenceImagesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListReferenceImagesResponse payload) { + return payload.getReferenceImagesList(); + } + }; + + private static final PagedListDescriptor< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, Product> + LIST_PRODUCTS_IN_PRODUCT_SET_PAGE_STR_DESC = + new PagedListDescriptor< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, Product>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductsInProductSetRequest injectToken( + ListProductsInProductSetRequest payload, String token) { + return ListProductsInProductSetRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListProductsInProductSetRequest injectPageSize( + ListProductsInProductSetRequest payload, int pageSize) { + return ListProductsInProductSetRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListProductsInProductSetRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductsInProductSetResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductsInProductSetResponse payload) { + return payload.getProductsList(); + } + }; + + private static final PagedListResponseFactory< + ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse> + LIST_PRODUCT_SETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProductSetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PRODUCT_SETS_PAGE_STR_DESC, request, context); + return ListProductSetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + LIST_PRODUCTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProductsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PRODUCTS_PAGE_STR_DESC, request, context); + return ListProductsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse> + LIST_REFERENCE_IMAGES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListReferenceImagesRequest, ListReferenceImagesResponse, + ListReferenceImagesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListReferenceImagesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_REFERENCE_IMAGES_PAGE_STR_DESC, request, context); + return ListReferenceImagesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, + ListProductsInProductSetPagedResponse> + LIST_PRODUCTS_IN_PRODUCT_SET_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, + ListProductsInProductSetPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListProductsInProductSetRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, Product> + pageContext = + PageContext.create( + callable, LIST_PRODUCTS_IN_PRODUCT_SET_PAGE_STR_DESC, request, context); + return ListProductsInProductSetPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for ProductSearchStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createProductSetSettings; + private final PagedCallSettings.Builder< + ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse> + listProductSetsSettings; + private final UnaryCallSettings.Builder getProductSetSettings; + private final UnaryCallSettings.Builder + updateProductSetSettings; + private final UnaryCallSettings.Builder + deleteProductSetSettings; + private final UnaryCallSettings.Builder createProductSettings; + private final PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; + private final UnaryCallSettings.Builder getProductSettings; + private final UnaryCallSettings.Builder updateProductSettings; + private final UnaryCallSettings.Builder deleteProductSettings; + private final UnaryCallSettings.Builder + createReferenceImageSettings; + private final UnaryCallSettings.Builder + deleteReferenceImageSettings; + private final PagedCallSettings.Builder< + ListReferenceImagesRequest, ListReferenceImagesResponse, + ListReferenceImagesPagedResponse> + listReferenceImagesSettings; + private final UnaryCallSettings.Builder + getReferenceImageSettings; + private final UnaryCallSettings.Builder + addProductToProductSetSettings; + private final UnaryCallSettings.Builder + removeProductFromProductSetSettings; + private final PagedCallSettings.Builder< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, + ListProductsInProductSetPagedResponse> + listProductsInProductSetSettings; + private final UnaryCallSettings.Builder + importProductSetsSettings; + private final OperationCallSettings.Builder< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationSettings; + + 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); + + createProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listProductSetsSettings = PagedCallSettings.newBuilder(LIST_PRODUCT_SETS_PAGE_STR_FACT); + + getProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listProductsSettings = PagedCallSettings.newBuilder(LIST_PRODUCTS_PAGE_STR_FACT); + + getProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createReferenceImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteReferenceImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listReferenceImagesSettings = + PagedCallSettings.newBuilder(LIST_REFERENCE_IMAGES_PAGE_STR_FACT); + + getReferenceImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + addProductToProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + removeProductFromProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listProductsInProductSetSettings = + PagedCallSettings.newBuilder(LIST_PRODUCTS_IN_PRODUCT_SET_PAGE_STR_FACT); + + importProductSetsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + importProductSetsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createProductSetSettings, + listProductSetsSettings, + getProductSetSettings, + updateProductSetSettings, + deleteProductSetSettings, + createProductSettings, + listProductsSettings, + getProductSettings, + updateProductSettings, + deleteProductSettings, + createReferenceImageSettings, + deleteReferenceImageSettings, + listReferenceImagesSettings, + getReferenceImageSettings, + addProductToProductSetSettings, + removeProductFromProductSetSettings, + listProductsInProductSetSettings, + importProductSetsSettings); + + 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 + .createProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listProductSetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listProductsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createReferenceImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteReferenceImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listReferenceImagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getReferenceImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .addProductToProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .removeProductFromProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listProductsInProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .importProductSetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .importProductSetsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + ImportProductSetsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(BatchOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(20000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); + + return builder; + } + + protected Builder(ProductSearchStubSettings settings) { + super(settings); + + createProductSetSettings = settings.createProductSetSettings.toBuilder(); + listProductSetsSettings = settings.listProductSetsSettings.toBuilder(); + getProductSetSettings = settings.getProductSetSettings.toBuilder(); + updateProductSetSettings = settings.updateProductSetSettings.toBuilder(); + deleteProductSetSettings = settings.deleteProductSetSettings.toBuilder(); + createProductSettings = settings.createProductSettings.toBuilder(); + listProductsSettings = settings.listProductsSettings.toBuilder(); + getProductSettings = settings.getProductSettings.toBuilder(); + updateProductSettings = settings.updateProductSettings.toBuilder(); + deleteProductSettings = settings.deleteProductSettings.toBuilder(); + createReferenceImageSettings = settings.createReferenceImageSettings.toBuilder(); + deleteReferenceImageSettings = settings.deleteReferenceImageSettings.toBuilder(); + listReferenceImagesSettings = settings.listReferenceImagesSettings.toBuilder(); + getReferenceImageSettings = settings.getReferenceImageSettings.toBuilder(); + addProductToProductSetSettings = settings.addProductToProductSetSettings.toBuilder(); + removeProductFromProductSetSettings = + settings.removeProductFromProductSetSettings.toBuilder(); + listProductsInProductSetSettings = settings.listProductsInProductSetSettings.toBuilder(); + importProductSetsSettings = settings.importProductSetsSettings.toBuilder(); + importProductSetsOperationSettings = settings.importProductSetsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createProductSetSettings, + listProductSetsSettings, + getProductSetSettings, + updateProductSetSettings, + deleteProductSetSettings, + createProductSettings, + listProductsSettings, + getProductSettings, + updateProductSettings, + deleteProductSettings, + createReferenceImageSettings, + deleteReferenceImageSettings, + listReferenceImagesSettings, + getReferenceImageSettings, + addProductToProductSetSettings, + removeProductFromProductSetSettings, + listProductsInProductSetSettings, + importProductSetsSettings); + } + + // 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 createProductSet. */ + public UnaryCallSettings.Builder + createProductSetSettings() { + return createProductSetSettings; + } + + /** Returns the builder for the settings used for calls to listProductSets. */ + public PagedCallSettings.Builder< + ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse> + listProductSetsSettings() { + return listProductSetsSettings; + } + + /** Returns the builder for the settings used for calls to getProductSet. */ + public UnaryCallSettings.Builder getProductSetSettings() { + return getProductSetSettings; + } + + /** Returns the builder for the settings used for calls to updateProductSet. */ + public UnaryCallSettings.Builder + updateProductSetSettings() { + return updateProductSetSettings; + } + + /** Returns the builder for the settings used for calls to deleteProductSet. */ + public UnaryCallSettings.Builder deleteProductSetSettings() { + return deleteProductSetSettings; + } + + /** Returns the builder for the settings used for calls to createProduct. */ + public UnaryCallSettings.Builder createProductSettings() { + return createProductSettings; + } + + /** Returns the builder for the settings used for calls to listProducts. */ + public PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings() { + return listProductsSettings; + } + + /** Returns the builder for the settings used for calls to getProduct. */ + public UnaryCallSettings.Builder getProductSettings() { + return getProductSettings; + } + + /** Returns the builder for the settings used for calls to updateProduct. */ + public UnaryCallSettings.Builder updateProductSettings() { + return updateProductSettings; + } + + /** Returns the builder for the settings used for calls to deleteProduct. */ + public UnaryCallSettings.Builder deleteProductSettings() { + return deleteProductSettings; + } + + /** Returns the builder for the settings used for calls to createReferenceImage. */ + public UnaryCallSettings.Builder + createReferenceImageSettings() { + return createReferenceImageSettings; + } + + /** Returns the builder for the settings used for calls to deleteReferenceImage. */ + public UnaryCallSettings.Builder + deleteReferenceImageSettings() { + return deleteReferenceImageSettings; + } + + /** Returns the builder for the settings used for calls to listReferenceImages. */ + public PagedCallSettings.Builder< + ListReferenceImagesRequest, ListReferenceImagesResponse, + ListReferenceImagesPagedResponse> + listReferenceImagesSettings() { + return listReferenceImagesSettings; + } + + /** Returns the builder for the settings used for calls to getReferenceImage. */ + public UnaryCallSettings.Builder + getReferenceImageSettings() { + return getReferenceImageSettings; + } + + /** Returns the builder for the settings used for calls to addProductToProductSet. */ + public UnaryCallSettings.Builder + addProductToProductSetSettings() { + return addProductToProductSetSettings; + } + + /** Returns the builder for the settings used for calls to removeProductFromProductSet. */ + public UnaryCallSettings.Builder + removeProductFromProductSetSettings() { + return removeProductFromProductSetSettings; + } + + /** Returns the builder for the settings used for calls to listProductsInProductSet. */ + public PagedCallSettings.Builder< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, + ListProductsInProductSetPagedResponse> + listProductsInProductSetSettings() { + return listProductsInProductSetSettings; + } + + /** Returns the builder for the settings used for calls to importProductSets. */ + public UnaryCallSettings.Builder + importProductSetsSettings() { + return importProductSetsSettings; + } + + /** Returns the builder for the settings used for calls to importProductSets. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationSettings() { + return importProductSetsOperationSettings; + } + + @Override + public ProductSearchStubSettings build() throws IOException { + return new ProductSearchStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorClientTest.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorClientTest.java new file mode 100644 index 000000000000..77143de82703 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorClientTest.java @@ -0,0 +1,169 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +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.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +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 ImageAnnotatorClientTest { + private static MockProductSearch mockProductSearch; + private static MockImageAnnotator mockImageAnnotator; + private static MockServiceHelper serviceHelper; + private ImageAnnotatorClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockProductSearch = new MockProductSearch(); + mockImageAnnotator = new MockImageAnnotator(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockProductSearch, mockImageAnnotator)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ImageAnnotatorSettings settings = + ImageAnnotatorSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ImageAnnotatorClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void batchAnnotateImagesTest() { + BatchAnnotateImagesResponse expectedResponse = BatchAnnotateImagesResponse.newBuilder().build(); + mockImageAnnotator.addResponse(expectedResponse); + + List requests = new ArrayList<>(); + + BatchAnnotateImagesResponse actualResponse = client.batchAnnotateImages(requests); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockImageAnnotator.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchAnnotateImagesRequest actualRequest = (BatchAnnotateImagesRequest) actualRequests.get(0); + + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void batchAnnotateImagesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockImageAnnotator.addException(exception); + + try { + List requests = new ArrayList<>(); + + client.batchAnnotateImages(requests); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void asyncBatchAnnotateFilesTest() throws Exception { + AsyncBatchAnnotateFilesResponse expectedResponse = + AsyncBatchAnnotateFilesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("asyncBatchAnnotateFilesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockImageAnnotator.addResponse(resultOperation); + + List requests = new ArrayList<>(); + + AsyncBatchAnnotateFilesResponse actualResponse = + client.asyncBatchAnnotateFilesAsync(requests).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockImageAnnotator.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AsyncBatchAnnotateFilesRequest actualRequest = + (AsyncBatchAnnotateFilesRequest) actualRequests.get(0); + + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void asyncBatchAnnotateFilesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockImageAnnotator.addException(exception); + + try { + List requests = new ArrayList<>(); + + client.asyncBatchAnnotateFilesAsync(requests).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorSmokeTest.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorSmokeTest.java new file mode 100644 index 000000000000..0e9415e4dc8f --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ImageAnnotatorSmokeTest.java @@ -0,0 +1,73 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import com.google.cloud.vision.v1p3beta1.Feature.Type; +import com.google.common.base.Preconditions; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ImageAnnotatorSmokeTest { + private static final String PROJECT_ENV_NAME = "GOOGLE_CLOUD_PROJECT"; + private static final String LEGACY_PROJECT_ENV_NAME = "GCLOUD_PROJECT"; + + @Test + public void run() { + main(null); + } + + public static void main(String args[]) { + Logger.getLogger("").setLevel(Level.WARNING); + try { + executeNoCatch(); + System.out.println("OK"); + } catch (Exception e) { + System.err.println("Failed with exception:"); + e.printStackTrace(System.err); + System.exit(1); + } + } + + public static void executeNoCatch() throws Exception { + try (ImageAnnotatorClient client = ImageAnnotatorClient.create()) { + String gcsImageUri = "gs://gapic-toolkit/President_Barack_Obama.jpg"; + ImageSource source = ImageSource.newBuilder().setGcsImageUri(gcsImageUri).build(); + Image image = Image.newBuilder().setSource(source).build(); + Feature.Type type = Feature.Type.FACE_DETECTION; + Feature featuresElement = Feature.newBuilder().setType(type).build(); + List features = Arrays.asList(featuresElement); + AnnotateImageRequest requestsElement = + AnnotateImageRequest.newBuilder().setImage(image).addAllFeatures(features).build(); + List requests = Arrays.asList(requestsElement); + + BatchAnnotateImagesResponse response = client.batchAnnotateImages(requests); + } + } + + private static String getProjectId() { + String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME)); + if (projectId == null) { + projectId = + System.getProperty(LEGACY_PROJECT_ENV_NAME, System.getenv(LEGACY_PROJECT_ENV_NAME)); + } + Preconditions.checkArgument(projectId != null, "A project ID is required."); + return projectId; + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockImageAnnotator.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockImageAnnotator.java new file mode 100644 index 000000000000..37eff0c3b06c --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockImageAnnotator.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockImageAnnotator implements MockGrpcService { + private final MockImageAnnotatorImpl serviceImpl; + + public MockImageAnnotator() { + serviceImpl = new MockImageAnnotatorImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 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-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockImageAnnotatorImpl.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockImageAnnotatorImpl.java new file mode 100644 index 000000000000..3a678fc89052 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockImageAnnotatorImpl.java @@ -0,0 +1,90 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.vision.v1p3beta1.ImageAnnotatorGrpc.ImageAnnotatorImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.GeneratedMessageV3; +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 MockImageAnnotatorImpl extends ImageAnnotatorImplBase { + private ArrayList requests; + private Queue responses; + + public MockImageAnnotatorImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 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 batchAnnotateImages( + BatchAnnotateImagesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof BatchAnnotateImagesResponse) { + requests.add(request); + responseObserver.onNext((BatchAnnotateImagesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void asyncBatchAnnotateFiles( + AsyncBatchAnnotateFilesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockProductSearch.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockProductSearch.java new file mode 100644 index 000000000000..dcc8e9d46518 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockProductSearch.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockProductSearch implements MockGrpcService { + private final MockProductSearchImpl serviceImpl; + + public MockProductSearch() { + serviceImpl = new MockProductSearchImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 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-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockProductSearchImpl.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockProductSearchImpl.java new file mode 100644 index 000000000000..6e08938872ff --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/MockProductSearchImpl.java @@ -0,0 +1,330 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.vision.v1p3beta1.ProductSearchGrpc.ProductSearchImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +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 MockProductSearchImpl extends ProductSearchImplBase { + private ArrayList requests; + private Queue responses; + + public MockProductSearchImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 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 createProductSet( + CreateProductSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ProductSet) { + requests.add(request); + responseObserver.onNext((ProductSet) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listProductSets( + ListProductSetsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListProductSetsResponse) { + requests.add(request); + responseObserver.onNext((ListProductSetsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getProductSet( + GetProductSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ProductSet) { + requests.add(request); + responseObserver.onNext((ProductSet) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateProductSet( + UpdateProductSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ProductSet) { + requests.add(request); + responseObserver.onNext((ProductSet) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteProductSet( + DeleteProductSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createProduct( + CreateProductRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext((Product) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listProducts( + ListProductsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListProductsResponse) { + requests.add(request); + responseObserver.onNext((ListProductsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getProduct(GetProductRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext((Product) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateProduct( + UpdateProductRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext((Product) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteProduct(DeleteProductRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createReferenceImage( + CreateReferenceImageRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ReferenceImage) { + requests.add(request); + responseObserver.onNext((ReferenceImage) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteReferenceImage( + DeleteReferenceImageRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listReferenceImages( + ListReferenceImagesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListReferenceImagesResponse) { + requests.add(request); + responseObserver.onNext((ListReferenceImagesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getReferenceImage( + GetReferenceImageRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ReferenceImage) { + requests.add(request); + responseObserver.onNext((ReferenceImage) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void addProductToProductSet( + AddProductToProductSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void removeProductFromProductSet( + RemoveProductFromProductSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listProductsInProductSet( + ListProductsInProductSetRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListProductsInProductSetResponse) { + requests.add(request); + responseObserver.onNext((ListProductsInProductSetResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void importProductSets( + ImportProductSetsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ProductSearchClientTest.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ProductSearchClientTest.java new file mode 100644 index 000000000000..e85499e681fe --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ProductSearchClientTest.java @@ -0,0 +1,904 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.vision.v1p3beta1; + +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p3beta1.ProductSearchClient.ListReferenceImagesPagedResponse; + +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.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.GeneratedMessageV3; +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 ProductSearchClientTest { + private static MockProductSearch mockProductSearch; + private static MockImageAnnotator mockImageAnnotator; + private static MockServiceHelper serviceHelper; + private ProductSearchClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockProductSearch = new MockProductSearch(); + mockImageAnnotator = new MockImageAnnotator(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockProductSearch, mockImageAnnotator)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ProductSearchSettings settings = + ProductSearchSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ProductSearchClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createProductSetTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + ProductSet expectedResponse = + ProductSet.newBuilder().setName(name).setDisplayName(displayName).build(); + mockProductSearch.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ProductSet productSet = ProductSet.newBuilder().build(); + String productSetId = "productSetId4216680"; + + ProductSet actualResponse = client.createProductSet(parent, productSet, productSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProductSetRequest actualRequest = (CreateProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(productSet, actualRequest.getProductSet()); + Assert.assertEquals(productSetId, actualRequest.getProductSetId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createProductSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ProductSet productSet = ProductSet.newBuilder().build(); + String productSetId = "productSetId4216680"; + + client.createProductSet(parent, productSet, productSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listProductSetsTest() { + String nextPageToken = ""; + ProductSet productSetsElement = ProductSet.newBuilder().build(); + List productSets = Arrays.asList(productSetsElement); + ListProductSetsResponse expectedResponse = + ListProductSetsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllProductSets(productSets) + .build(); + mockProductSearch.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProductSetsPagedResponse pagedListResponse = client.listProductSets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductSetsList().get(0), resources.get(0)); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductSetsRequest actualRequest = (ListProductSetsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listProductSetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listProductSets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getProductSetTest() { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + ProductSet expectedResponse = + ProductSet.newBuilder().setName(name2).setDisplayName(displayName).build(); + mockProductSearch.addResponse(expectedResponse); + + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + ProductSet actualResponse = client.getProductSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProductSetRequest actualRequest = (GetProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getProductSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + client.getProductSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateProductSetTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + ProductSet expectedResponse = + ProductSet.newBuilder().setName(name).setDisplayName(displayName).build(); + mockProductSearch.addResponse(expectedResponse); + + ProductSet productSet = ProductSet.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ProductSet actualResponse = client.updateProductSet(productSet, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateProductSetRequest actualRequest = (UpdateProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(productSet, actualRequest.getProductSet()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateProductSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductSet productSet = ProductSet.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateProductSet(productSet, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteProductSetTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductSearch.addResponse(expectedResponse); + + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + client.deleteProductSet(name); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProductSetRequest actualRequest = (DeleteProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteProductSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + client.deleteProductSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createProductTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + String productCategory = "productCategory-1607451058"; + Product expectedResponse = + Product.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setDescription(description) + .setProductCategory(productCategory) + .build(); + mockProductSearch.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Product product = Product.newBuilder().build(); + String productId = "productId1753008747"; + + Product actualResponse = client.createProduct(parent, product, productId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProductRequest actualRequest = (CreateProductRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertEquals(productId, actualRequest.getProductId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Product product = Product.newBuilder().build(); + String productId = "productId1753008747"; + + client.createProduct(parent, product, productId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listProductsTest() { + String nextPageToken = ""; + Product productsElement = Product.newBuilder().build(); + List products = Arrays.asList(productsElement); + ListProductsResponse expectedResponse = + ListProductsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllProducts(products) + .build(); + mockProductSearch.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProductsPagedResponse pagedListResponse = client.listProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductsRequest actualRequest = (ListProductsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getProductTest() { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + String productCategory = "productCategory-1607451058"; + Product expectedResponse = + Product.newBuilder() + .setName(name2) + .setDisplayName(displayName) + .setDescription(description) + .setProductCategory(productCategory) + .build(); + mockProductSearch.addResponse(expectedResponse); + + ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + Product actualResponse = client.getProduct(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProductRequest actualRequest = (GetProductRequest) actualRequests.get(0); + + Assert.assertEquals(name, ProductName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + client.getProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateProductTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + String productCategory = "productCategory-1607451058"; + Product expectedResponse = + Product.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setDescription(description) + .setProductCategory(productCategory) + .build(); + mockProductSearch.addResponse(expectedResponse); + + Product product = Product.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Product actualResponse = client.updateProduct(product, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateProductRequest actualRequest = (UpdateProductRequest) actualRequests.get(0); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + Product product = Product.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateProduct(product, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteProductTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductSearch.addResponse(expectedResponse); + + ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + client.deleteProduct(name); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProductRequest actualRequest = (DeleteProductRequest) actualRequests.get(0); + + Assert.assertEquals(name, ProductName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + client.deleteProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createReferenceImageTest() { + String name = "name3373707"; + String uri = "uri116076"; + ReferenceImage expectedResponse = ReferenceImage.newBuilder().setName(name).setUri(uri).build(); + mockProductSearch.addResponse(expectedResponse); + + ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + ReferenceImage referenceImage = ReferenceImage.newBuilder().build(); + String referenceImageId = "referenceImageId1946713331"; + + ReferenceImage actualResponse = + client.createReferenceImage(parent, referenceImage, referenceImageId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReferenceImageRequest actualRequest = (CreateReferenceImageRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProductName.parse(actualRequest.getParent())); + Assert.assertEquals(referenceImage, actualRequest.getReferenceImage()); + Assert.assertEquals(referenceImageId, actualRequest.getReferenceImageId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createReferenceImageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + ReferenceImage referenceImage = ReferenceImage.newBuilder().build(); + String referenceImageId = "referenceImageId1946713331"; + + client.createReferenceImage(parent, referenceImage, referenceImageId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteReferenceImageTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductSearch.addResponse(expectedResponse); + + ReferenceImageName name = + ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"); + + client.deleteReferenceImage(name); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReferenceImageRequest actualRequest = (DeleteReferenceImageRequest) actualRequests.get(0); + + Assert.assertEquals(name, ReferenceImageName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteReferenceImageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ReferenceImageName name = + ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"); + + client.deleteReferenceImage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listReferenceImagesTest() { + int pageSize = 883849137; + String nextPageToken = ""; + ReferenceImage referenceImagesElement = ReferenceImage.newBuilder().build(); + List referenceImages = Arrays.asList(referenceImagesElement); + ListReferenceImagesResponse expectedResponse = + ListReferenceImagesResponse.newBuilder() + .setPageSize(pageSize) + .setNextPageToken(nextPageToken) + .addAllReferenceImages(referenceImages) + .build(); + mockProductSearch.addResponse(expectedResponse); + + ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + ListReferenceImagesPagedResponse pagedListResponse = client.listReferenceImages(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReferenceImagesList().get(0), resources.get(0)); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReferenceImagesRequest actualRequest = (ListReferenceImagesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProductName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listReferenceImagesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductName parent = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + client.listReferenceImages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getReferenceImageTest() { + String name2 = "name2-1052831874"; + String uri = "uri116076"; + ReferenceImage expectedResponse = + ReferenceImage.newBuilder().setName(name2).setUri(uri).build(); + mockProductSearch.addResponse(expectedResponse); + + ReferenceImageName name = + ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"); + + ReferenceImage actualResponse = client.getReferenceImage(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReferenceImageRequest actualRequest = (GetReferenceImageRequest) actualRequests.get(0); + + Assert.assertEquals(name, ReferenceImageName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getReferenceImageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ReferenceImageName name = + ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"); + + client.getReferenceImage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void addProductToProductSetTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductSearch.addResponse(expectedResponse); + + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + String product = "product-309474065"; + + client.addProductToProductSet(name, product); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddProductToProductSetRequest actualRequest = + (AddProductToProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName())); + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void addProductToProductSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + String product = "product-309474065"; + + client.addProductToProductSet(name, product); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void removeProductFromProductSetTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductSearch.addResponse(expectedResponse); + + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + String product = "product-309474065"; + + client.removeProductFromProductSet(name, product); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveProductFromProductSetRequest actualRequest = + (RemoveProductFromProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName())); + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void removeProductFromProductSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + String product = "product-309474065"; + + client.removeProductFromProductSet(name, product); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listProductsInProductSetTest() { + String nextPageToken = ""; + Product productsElement = Product.newBuilder().build(); + List products = Arrays.asList(productsElement); + ListProductsInProductSetResponse expectedResponse = + ListProductsInProductSetResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllProducts(products) + .build(); + mockProductSearch.addResponse(expectedResponse); + + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + ListProductsInProductSetPagedResponse pagedListResponse = client.listProductsInProductSet(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductsInProductSetRequest actualRequest = + (ListProductsInProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listProductsInProductSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + client.listProductsInProductSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void importProductSetsTest() throws Exception { + ImportProductSetsResponse expectedResponse = ImportProductSetsResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importProductSetsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductSearch.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build(); + + ImportProductSetsResponse actualResponse = + client.importProductSetsAsync(parent, inputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportProductSetsRequest actualRequest = (ImportProductSetsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(inputConfig, actualRequest.getInputConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void importProductSetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockProductSearch.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build(); + + client.importProductSetsAsync(parent, 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()); + } + } +} diff --git a/versions.txt b/versions.txt index e6b6c349f661..1b0e7d041039 100644 --- a/versions.txt +++ b/versions.txt @@ -8,7 +8,7 @@ google-api-grpc:0.19.0:0.19.1-SNAPSHOT # children #grpc-google-cloud-datastore-v1 -# grpc-google-cloud-automl-v1beta1:0.19.0:0.19.1-SNAPSHOT +grpc-google-cloud-automl-v1beta1:0.19.0:0.19.1-SNAPSHOT grpc-google-cloud-bigquerydatatransfer-v1:0.19.0:0.19.1-SNAPSHOT grpc-google-cloud-bigtable-admin-v2:0.19.0:0.19.1-SNAPSHOT grpc-google-cloud-bigtable-v2:0.19.0:0.19.1-SNAPSHOT @@ -46,10 +46,10 @@ grpc-google-cloud-video-intelligence-v1p1beta1:0.19.0:0.19.1-SNAPSHOT grpc-google-cloud-vision-v1:1.18.0:1.18.1-SNAPSHOT grpc-google-cloud-vision-v1p1beta1:0.19.0:0.19.1-SNAPSHOT grpc-google-cloud-vision-v1p2beta1:1.18.0:1.18.1-SNAPSHOT -# grpc-google-cloud-vision-v1p3beta1:0.19.0:0.19.1-SNAPSHOT +grpc-google-cloud-vision-v1p3beta1:0.19.0:0.19.1-SNAPSHOT grpc-google-cloud-websecurityscanner-v1alpha:0.19.0:0.19.1-SNAPSHOT -# proto-google-cloud-automl-v1beta1:0.19.0:0.19.1-SNAPSHOT +proto-google-cloud-automl-v1beta1:0.19.0:0.19.1-SNAPSHOT proto-google-cloud-bigquerydatatransfer-v1:0.19.0:0.19.1-SNAPSHOT proto-google-cloud-bigtable-admin-v2:0.19.0:0.19.1-SNAPSHOT proto-google-cloud-bigtable-v2:0.19.0:0.19.1-SNAPSHOT @@ -102,7 +102,7 @@ google-cloud-appengineflexcustom:0.54.0-alpha:0.54.1-alpha-SNAPSHOT google-cloud-appengineflexjava:0.54.0-alpha:0.54.1-alpha-SNAPSHOT google-cloud-appenginejava8:0.54.0-alpha:0.54.1-alpha-SNAPSHOT google-cloud:0.54.0-alpha:0.54.1-alpha-SNAPSHOT -# google-cloud-automl:0.54.0-beta:0.54.1-beta-SNAPSHOT +google-cloud-automl:0.54.0-beta:0.54.1-beta-SNAPSHOT google-cloud-bigquery:1.36.0:1.36.1-SNAPSHOT google-cloud-bigquerydatatransfer:0.54.0-beta:0.54.1-beta-SNAPSHOT google-cloud-bigtable:0.54.0-alpha:0.54.1-alpha-SNAPSHOT From 259b42f043982978a4f93d72c4f930658becc54d Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Thu, 19 Jul 2018 17:01:55 -0700 Subject: [PATCH 2/2] pr comment --- README.md | 3 ++- google-cloud-clients/google-cloud-automl/README.md | 8 ++++---- google-cloud-clients/google-cloud-automl/pom.xml | 4 ++-- google-cloud-clients/pom.xml | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index baba8800ba9e..7dca71e0a47b 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ This library supports the following Google Cloud Platform services with clients This library supports the following Google Cloud Platform services with clients at a [Beta](#versioning) quality level: - [BigQuery Data Transfer](google-cloud-clients/google-cloud-bigquerydatatransfer) (Beta) +- [Cloud AutoML](google-cloud-clients/google-cloud-automl) (Beta) - [Cloud Data Loss Prevention](google-cloud-clients/google-cloud-dlp) (Beta) - [Cloud Firestore](google-cloud-clients/google-cloud-firestore) (Beta) - [Cloud IoT Core](google-cloud-clients/google-cloud-iot) (Beta) @@ -74,7 +75,7 @@ libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "1.36.0" ``` [//]: # ({x-version-update-end}) -If you're using IntelliJ or Eclipse, you can add client libraries to your project using these IDE plugins: +If you're using IntelliJ or Eclipse, you can add client libraries to your project using these IDE plugins: * [Cloud Tools for IntelliJ](https://cloud.google.com/tools/intellij/docs/client-libraries?utm_source=github&utm_medium=google-cloud-java&utm_campaign=ToolsforIntelliJ) * [Cloud Tools for Eclipse](https://cloud.google.com/eclipse/docs/libraries?utm_source=github&utm_medium=google-cloud-java&utm_campaign=ToolsforEclipse) diff --git a/google-cloud-clients/google-cloud-automl/README.md b/google-cloud-clients/google-cloud-automl/README.md index 759768ec9522..157a861bed12 100644 --- a/google-cloud-clients/google-cloud-automl/README.md +++ b/google-cloud-clients/google-cloud-automl/README.md @@ -24,16 +24,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-automl - 0.54.0-alpha + 0.54.0-beta ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-automl:0.54.0-alpha' +compile 'com.google.cloud:google-cloud-automl:0.54.0-beta' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-automl" % "0.54.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-automl" % "0.54.0-beta" ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ See the [Authentication](https://github.com/GoogleCloudPlatform/google-cloud-jav About Cloud Auto ML ---------------------------- -[Cloud Auto ML][cloud-automl] is a web security scanner for common vulnerabilities in Google App Engine applications. +[Cloud Auto ML][cloud-automl] is a suite of Machine Learning products. See the [Cloud Auto ML client library docs][automl-client-lib-docs] to learn how to use this Cloud Auto ML Client Library. diff --git a/google-cloud-clients/google-cloud-automl/pom.xml b/google-cloud-clients/google-cloud-automl/pom.xml index e4437cc122bb..be0b75602bb4 100644 --- a/google-cloud-clients/google-cloud-automl/pom.xml +++ b/google-cloud-clients/google-cloud-automl/pom.xml @@ -4,10 +4,10 @@ google-cloud-automl 0.54.1-beta-SNAPSHOT jar - Google Cloud Web Security Scanner + Google Cloud Auto ML https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-automl - Java idiomatic client for Google Cloud Web Security Scanner + Java idiomatic client for Google Cloud Auto ML com.google.cloud diff --git a/google-cloud-clients/pom.xml b/google-cloud-clients/pom.xml index e11b8ad62f92..e950985e0973 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -412,7 +412,7 @@ - + google-cloud-automl google-cloud-bigtable google-cloud-bigquery google-cloud-bigquerydatatransfer @@ -754,7 +754,7 @@ Stub packages - com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub + com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub Deprecated packages