From cde39dc7dcc95013c960e362ffa640cde9591055 Mon Sep 17 00:00:00 2001 From: Solomon Duskis Date: Wed, 27 Feb 2019 17:04:20 -0500 Subject: [PATCH 1/3] Adding vision v1p4beta1 --- .../pom.xml | 31 + .../vision/v1p4beta1/ImageAnnotatorGrpc.java | 822 ++ .../vision/v1p4beta1/ProductSearchGrpc.java | 2947 ++++++ google-api-grpc/pom.xml | 12 + .../vision/v1p3beta1/ProductSearchParams.java | 6 +- .../v1p3beta1/ProductSearchResults.java | 6 +- .../pom.xml | 31 + .../AddProductToProductSetRequest.java | 796 ++ ...ddProductToProductSetRequestOrBuilder.java | 60 + .../vision/v1p4beta1/AnnotateFileRequest.java | 1771 ++++ .../AnnotateFileRequestOrBuilder.java | 182 + .../v1p4beta1/AnnotateFileResponse.java | 1299 +++ .../AnnotateFileResponseOrBuilder.java | 104 + .../v1p4beta1/AnnotateImageRequest.java | 1464 +++ .../AnnotateImageRequestOrBuilder.java | 124 + .../v1p4beta1/AnnotateImageResponse.java | 5775 +++++++++++ .../AnnotateImageResponseOrBuilder.java | 613 ++ .../v1p4beta1/AsyncAnnotateFileRequest.java | 1732 ++++ .../AsyncAnnotateFileRequestOrBuilder.java | 155 + .../v1p4beta1/AsyncAnnotateFileResponse.java | 705 ++ .../AsyncAnnotateFileResponseOrBuilder.java | 41 + .../AsyncBatchAnnotateFilesRequest.java | 960 ++ ...yncBatchAnnotateFilesRequestOrBuilder.java | 63 + .../AsyncBatchAnnotateFilesResponse.java | 984 ++ ...ncBatchAnnotateFilesResponseOrBuilder.java | 68 + .../AsyncBatchAnnotateImagesRequest.java | 1223 +++ ...ncBatchAnnotateImagesRequestOrBuilder.java | 93 + .../AsyncBatchAnnotateImagesResponse.java | 717 ++ ...cBatchAnnotateImagesResponseOrBuilder.java | 41 + .../v1p4beta1/BatchAnnotateFilesRequest.java | 965 ++ .../BatchAnnotateFilesRequestOrBuilder.java | 67 + .../v1p4beta1/BatchAnnotateFilesResponse.java | 969 ++ .../BatchAnnotateFilesResponseOrBuilder.java | 67 + .../v1p4beta1/BatchAnnotateImagesRequest.java | 946 ++ .../BatchAnnotateImagesRequestOrBuilder.java | 62 + .../BatchAnnotateImagesResponse.java | 951 ++ .../BatchAnnotateImagesResponseOrBuilder.java | 62 + .../v1p4beta1/BatchOperationMetadata.java | 1307 +++ .../BatchOperationMetadataOrBuilder.java | 96 + .../google/cloud/vision/v1p4beta1/Block.java | 2064 ++++ .../vision/v1p4beta1/BlockOrBuilder.java | 198 + .../cloud/vision/v1p4beta1/BoundingPoly.java | 1444 +++ .../v1p4beta1/BoundingPolyOrBuilder.java | 115 + .../cloud/vision/v1p4beta1/ColorInfo.java | 858 ++ .../vision/v1p4beta1/ColorInfoOrBuilder.java | 64 + .../v1p4beta1/CreateProductRequest.java | 1062 +++ .../CreateProductRequestOrBuilder.java | 93 + .../v1p4beta1/CreateProductSetRequest.java | 1056 ++ .../CreateProductSetRequestOrBuilder.java | 91 + .../CreateReferenceImageRequest.java | 1079 +++ .../CreateReferenceImageRequestOrBuilder.java | 96 + .../cloud/vision/v1p4beta1/CropHint.java | 885 ++ .../vision/v1p4beta1/CropHintOrBuilder.java | 67 + .../vision/v1p4beta1/CropHintsAnnotation.java | 930 ++ .../CropHintsAnnotationOrBuilder.java | 62 + .../vision/v1p4beta1/CropHintsParams.java | 705 ++ .../v1p4beta1/CropHintsParamsOrBuilder.java | 56 + .../v1p4beta1/DeleteProductRequest.java | 614 ++ .../DeleteProductRequestOrBuilder.java | 35 + .../v1p4beta1/DeleteProductSetRequest.java | 614 ++ .../DeleteProductSetRequestOrBuilder.java | 35 + .../DeleteReferenceImageRequest.java | 618 ++ .../DeleteReferenceImageRequestOrBuilder.java | 35 + .../v1p4beta1/DominantColorsAnnotation.java | 928 ++ .../DominantColorsAnnotationOrBuilder.java | 62 + .../vision/v1p4beta1/EntityAnnotation.java | 2604 +++++ .../v1p4beta1/EntityAnnotationOrBuilder.java | 284 + .../vision/v1p4beta1/FaceAnnotation.java | 4712 +++++++++ .../v1p4beta1/FaceAnnotationOrBuilder.java | 365 + .../cloud/vision/v1p4beta1/Feature.java | 1203 +++ .../vision/v1p4beta1/FeatureOrBuilder.java | 68 + .../vision/v1p4beta1/GcsDestination.java | 675 ++ .../v1p4beta1/GcsDestinationOrBuilder.java | 53 + .../cloud/vision/v1p4beta1/GcsSource.java | 604 ++ .../vision/v1p4beta1/GcsSourceOrBuilder.java | 33 + .../cloud/vision/v1p4beta1/GeometryProto.java | 104 + .../vision/v1p4beta1/GetProductRequest.java | 613 ++ .../v1p4beta1/GetProductRequestOrBuilder.java | 35 + .../v1p4beta1/GetProductSetRequest.java | 614 ++ .../GetProductSetRequestOrBuilder.java | 35 + .../v1p4beta1/GetReferenceImageRequest.java | 614 ++ .../GetReferenceImageRequestOrBuilder.java | 35 + .../google/cloud/vision/v1p4beta1/Image.java | 817 ++ .../v1p4beta1/ImageAnnotationContext.java | 686 ++ .../ImageAnnotationContextOrBuilder.java | 43 + .../vision/v1p4beta1/ImageAnnotatorProto.java | 812 ++ .../cloud/vision/v1p4beta1/ImageContext.java | 1856 ++++ .../v1p4beta1/ImageContextOrBuilder.java | 203 + .../vision/v1p4beta1/ImageOrBuilder.java | 60 + .../vision/v1p4beta1/ImageProperties.java | 710 ++ .../v1p4beta1/ImagePropertiesOrBuilder.java | 41 + .../cloud/vision/v1p4beta1/ImageSource.java | 877 ++ .../v1p4beta1/ImageSourceOrBuilder.java | 86 + .../v1p4beta1/ImportProductSetsGcsSource.java | 927 ++ .../ImportProductSetsGcsSourceOrBuilder.java | 123 + .../ImportProductSetsInputConfig.java | 829 ++ ...ImportProductSetsInputConfigOrBuilder.java | 46 + .../v1p4beta1/ImportProductSetsRequest.java | 882 ++ .../ImportProductSetsRequestOrBuilder.java | 64 + .../v1p4beta1/ImportProductSetsResponse.java | 1509 +++ .../ImportProductSetsResponseOrBuilder.java | 133 + .../cloud/vision/v1p4beta1/InputConfig.java | 970 ++ .../v1p4beta1/InputConfigOrBuilder.java | 79 + .../cloud/vision/v1p4beta1/LatLongRect.java | 937 ++ .../v1p4beta1/LatLongRectOrBuilder.java | 72 + .../cloud/vision/v1p4beta1/Likelihood.java | 218 + .../v1p4beta1/ListProductSetsRequest.java | 848 ++ .../ListProductSetsRequestOrBuilder.java | 65 + .../v1p4beta1/ListProductSetsResponse.java | 1103 +++ .../ListProductSetsResponseOrBuilder.java | 85 + .../ListProductsInProductSetRequest.java | 865 ++ ...tProductsInProductSetRequestOrBuilder.java | 67 + .../ListProductsInProductSetResponse.java | 1111 +++ ...ProductsInProductSetResponseOrBuilder.java | 85 + .../vision/v1p4beta1/ListProductsRequest.java | 855 ++ .../ListProductsRequestOrBuilder.java | 67 + .../v1p4beta1/ListProductsResponse.java | 1099 +++ .../ListProductsResponseOrBuilder.java | 85 + .../v1p4beta1/ListReferenceImagesRequest.java | 872 ++ .../ListReferenceImagesRequestOrBuilder.java | 71 + .../ListReferenceImagesResponse.java | 1188 +++ .../ListReferenceImagesResponseOrBuilder.java | 94 + .../v1p4beta1/LocalizedObjectAnnotation.java | 1286 +++ .../LocalizedObjectAnnotationOrBuilder.java | 119 + .../cloud/vision/v1p4beta1/LocationInfo.java | 685 ++ .../v1p4beta1/LocationInfoOrBuilder.java | 41 + .../cloud/vision/v1p4beta1/LocationName.java | 180 + .../vision/v1p4beta1/NormalizedVertex.java | 608 ++ .../v1p4beta1/NormalizedVertexOrBuilder.java | 32 + .../vision/v1p4beta1/OperationMetadata.java | 1288 +++ .../v1p4beta1/OperationMetadataOrBuilder.java | 93 + .../cloud/vision/v1p4beta1/OutputConfig.java | 815 ++ .../v1p4beta1/OutputConfigOrBuilder.java | 60 + .../google/cloud/vision/v1p4beta1/Page.java | 1451 +++ .../cloud/vision/v1p4beta1/PageOrBuilder.java | 128 + .../cloud/vision/v1p4beta1/Paragraph.java | 1719 ++++ .../vision/v1p4beta1/ParagraphOrBuilder.java | 176 + .../cloud/vision/v1p4beta1/Position.java | 689 ++ .../vision/v1p4beta1/PositionOrBuilder.java | 43 + .../cloud/vision/v1p4beta1/Product.java | 2598 +++++ .../cloud/vision/v1p4beta1/ProductName.java | 208 + .../vision/v1p4beta1/ProductOrBuilder.java | 190 + .../vision/v1p4beta1/ProductSearchParams.java | 1355 +++ .../ProductSearchParamsOrBuilder.java | 147 + .../vision/v1p4beta1/ProductSearchProto.java | 128 + .../v1p4beta1/ProductSearchResults.java | 4244 +++++++++ .../ProductSearchResultsOrBuilder.java | 178 + .../v1p4beta1/ProductSearchServiceProto.java | 596 ++ .../cloud/vision/v1p4beta1/ProductSet.java | 1370 +++ .../vision/v1p4beta1/ProductSetName.java | 209 + .../vision/v1p4beta1/ProductSetOrBuilder.java | 140 + .../cloud/vision/v1p4beta1/Property.java | 838 ++ .../vision/v1p4beta1/PropertyOrBuilder.java | 63 + .../vision/v1p4beta1/ReferenceImage.java | 1435 +++ .../vision/v1p4beta1/ReferenceImageName.java | 249 + .../v1p4beta1/ReferenceImageOrBuilder.java | 144 + .../RemoveProductFromProductSetRequest.java | 801 ++ ...ProductFromProductSetRequestOrBuilder.java | 60 + .../v1p4beta1/SafeSearchAnnotation.java | 1137 +++ .../SafeSearchAnnotationOrBuilder.java | 129 + .../google/cloud/vision/v1p4beta1/Symbol.java | 1388 +++ .../vision/v1p4beta1/SymbolOrBuilder.java | 146 + .../vision/v1p4beta1/TextAnnotation.java | 4181 ++++++++ .../v1p4beta1/TextAnnotationOrBuilder.java | 82 + .../vision/v1p4beta1/TextAnnotationProto.java | 212 + .../v1p4beta1/UpdateProductRequest.java | 1025 ++ .../UpdateProductRequestOrBuilder.java | 87 + .../v1p4beta1/UpdateProductSetRequest.java | 1002 ++ .../UpdateProductSetRequestOrBuilder.java | 81 + .../google/cloud/vision/v1p4beta1/Vertex.java | 597 ++ .../vision/v1p4beta1/VertexOrBuilder.java | 32 + .../cloud/vision/v1p4beta1/WebDetection.java | 8485 +++++++++++++++++ .../v1p4beta1/WebDetectionOrBuilder.java | 392 + .../vision/v1p4beta1/WebDetectionParams.java | 518 + .../WebDetectionParamsOrBuilder.java | 21 + .../vision/v1p4beta1/WebDetectionProto.java | 146 + .../google/cloud/vision/v1p4beta1/Word.java | 1742 ++++ .../cloud/vision/v1p4beta1/WordOrBuilder.java | 182 + .../cloud/vision/v1p4beta1/geometry.proto | 72 + .../vision/v1p4beta1/image_annotator.proto | 902 ++ .../vision/v1p4beta1/product_search.proto | 97 + .../v1p4beta1/product_search_service.proto | 835 ++ .../vision/v1p4beta1/text_annotation.proto | 261 + .../vision/v1p4beta1/web_detection.proto | 108 + .../google-cloud-vision/pom.xml | 9 + .../v1p4beta1/ImageAnnotatorClient.java | 604 ++ .../v1p4beta1/ImageAnnotatorSettings.java | 252 + .../vision/v1p4beta1/ProductSearchClient.java | 3027 ++++++ .../v1p4beta1/ProductSearchSettings.java | 402 + .../cloud/vision/v1p4beta1/package-info.java | 70 + .../GrpcImageAnnotatorCallableFactory.java | 115 + .../stub/GrpcImageAnnotatorStub.java | 279 + .../GrpcProductSearchCallableFactory.java | 115 + .../v1p4beta1/stub/GrpcProductSearchStub.java | 633 ++ .../v1p4beta1/stub/ImageAnnotatorStub.java | 88 + .../stub/ImageAnnotatorStubSettings.java | 472 + .../v1p4beta1/stub/ProductSearchStub.java | 180 + .../stub/ProductSearchStubSettings.java | 1064 +++ .../v1p4beta1/ImageAnnotatorClientTest.java | 259 + .../vision/v1p4beta1/MockImageAnnotator.java | 57 + .../v1p4beta1/MockImageAnnotatorImpl.java | 121 + .../vision/v1p4beta1/MockProductSearch.java | 57 + .../v1p4beta1/MockProductSearchImpl.java | 330 + .../v1p4beta1/ProductSearchClientTest.java | 904 ++ .../google-cloud-vision/synth.py | 2 +- versions.txt | 2 + 206 files changed, 133633 insertions(+), 9 deletions(-) create mode 100644 google-api-grpc/grpc-google-cloud-vision-v1p4beta1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorGrpc.java create mode 100644 google-api-grpc/grpc-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchGrpc.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AddProductToProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AddProductToProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchOperationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchOperationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Block.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BlockOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BoundingPoly.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BoundingPolyOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ColorInfo.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ColorInfoOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHint.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsParams.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsParamsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DominantColorsAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DominantColorsAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/EntityAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/EntityAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FaceAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FaceAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Feature.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FeatureOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsDestination.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsDestinationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsSource.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsSourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GeometryProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Image.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotationContext.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotationContextOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageContext.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageContextOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageProperties.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImagePropertiesOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageSource.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageSourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsGcsSource.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsGcsSourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsInputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsInputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/InputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/InputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LatLongRect.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LatLongRectOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Likelihood.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocalizedObjectAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocalizedObjectAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationInfo.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationInfoOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/NormalizedVertex.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/NormalizedVertexOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OperationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OperationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OutputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OutputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Page.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PageOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Paragraph.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ParagraphOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Position.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PositionOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Product.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchParams.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchParamsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchResults.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchResultsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchServiceProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSet.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSetName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Property.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PropertyOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImage.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImageName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImageOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/RemoveProductFromProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/RemoveProductFromProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SafeSearchAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SafeSearchAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Symbol.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SymbolOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotationProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Vertex.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/VertexOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetection.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionParams.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionParamsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Word.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WordOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/geometry.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/image_annotator.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/product_search.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/product_search_service.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/text_annotation.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/web_detection.proto create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClient.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchClient.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/package-info.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStubSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStubSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClientTest.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockImageAnnotator.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockImageAnnotatorImpl.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockProductSearch.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockProductSearchImpl.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ProductSearchClientTest.java diff --git a/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/pom.xml b/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/pom.xml new file mode 100644 index 000000000000..378472ca8931 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-vision-v1p4beta1 + 0.46.1-SNAPSHOT + grpc-google-cloud-vision-v1p4beta1 + GRPC library for grpc-google-cloud-vision-v1p4beta1 + + com.google.api.grpc + google-api-grpc + 0.46.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-vision-v1p4beta1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorGrpc.java b/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorGrpc.java new file mode 100644 index 000000000000..1b3f637cf9be --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorGrpc.java @@ -0,0 +1,822 @@ +package com.google.cloud.vision.v1p4beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * 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/v1p4beta1/image_annotator.proto") +public final class ImageAnnotatorGrpc { + + private ImageAnnotatorGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse> + METHOD_BATCH_ANNOTATE_IMAGES = getBatchAnnotateImagesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse> + getBatchAnnotateImagesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse> + getBatchAnnotateImagesMethod() { + return getBatchAnnotateImagesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse> + getBatchAnnotateImagesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse> + 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.v1p4beta1.ImageAnnotator", + "BatchAnnotateImages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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 #getBatchAnnotateFilesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse> + METHOD_BATCH_ANNOTATE_FILES = getBatchAnnotateFilesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse> + getBatchAnnotateFilesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse> + getBatchAnnotateFilesMethod() { + return getBatchAnnotateFilesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse> + getBatchAnnotateFilesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse> + getBatchAnnotateFilesMethod; + if ((getBatchAnnotateFilesMethod = ImageAnnotatorGrpc.getBatchAnnotateFilesMethod) == null) { + synchronized (ImageAnnotatorGrpc.class) { + if ((getBatchAnnotateFilesMethod = ImageAnnotatorGrpc.getBatchAnnotateFilesMethod) + == null) { + ImageAnnotatorGrpc.getBatchAnnotateFilesMethod = + getBatchAnnotateFilesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.vision.v1p4beta1.ImageAnnotator", "BatchAnnotateFiles")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ImageAnnotatorMethodDescriptorSupplier("BatchAnnotateFiles")) + .build(); + } + } + } + return getBatchAnnotateFilesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAsyncBatchAnnotateImagesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest, + com.google.longrunning.Operation> + METHOD_ASYNC_BATCH_ANNOTATE_IMAGES = getAsyncBatchAnnotateImagesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest, + com.google.longrunning.Operation> + getAsyncBatchAnnotateImagesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest, + com.google.longrunning.Operation> + getAsyncBatchAnnotateImagesMethod() { + return getAsyncBatchAnnotateImagesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest, + com.google.longrunning.Operation> + getAsyncBatchAnnotateImagesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest, + com.google.longrunning.Operation> + getAsyncBatchAnnotateImagesMethod; + if ((getAsyncBatchAnnotateImagesMethod = ImageAnnotatorGrpc.getAsyncBatchAnnotateImagesMethod) + == null) { + synchronized (ImageAnnotatorGrpc.class) { + if ((getAsyncBatchAnnotateImagesMethod = + ImageAnnotatorGrpc.getAsyncBatchAnnotateImagesMethod) + == null) { + ImageAnnotatorGrpc.getAsyncBatchAnnotateImagesMethod = + getAsyncBatchAnnotateImagesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.vision.v1p4beta1.ImageAnnotator", + "AsyncBatchAnnotateImages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ImageAnnotatorMethodDescriptorSupplier("AsyncBatchAnnotateImages")) + .build(); + } + } + } + return getAsyncBatchAnnotateImagesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAsyncBatchAnnotateFilesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest, + com.google.longrunning.Operation> + METHOD_ASYNC_BATCH_ANNOTATE_FILES = getAsyncBatchAnnotateFilesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest, + com.google.longrunning.Operation> + getAsyncBatchAnnotateFilesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest, + com.google.longrunning.Operation> + getAsyncBatchAnnotateFilesMethod() { + return getAsyncBatchAnnotateFilesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest, + com.google.longrunning.Operation> + getAsyncBatchAnnotateFilesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest, + com.google.longrunning.Operation> + 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.v1p4beta1.ImageAnnotator", + "AsyncBatchAnnotateFiles")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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 abstract static class ImageAnnotatorImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Run image detection and annotation for a batch of images.
+     * 
+ */ + public void batchAnnotateImages( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getBatchAnnotateImagesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Service that performs image detection and annotation for a batch of files.
+     * Now only "application/pdf", "image/tiff" and "image/gif" are supported.
+     * This service will extract at most the first 10 frames (gif) or pages
+     * (pdf or tiff) from each file provided and perform detection and annotation
+     * for each image extracted.
+     * 
+ */ + public void batchAnnotateFiles( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getBatchAnnotateFilesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Run asynchronous image detection and annotation for a list of images.
+     * Progress and results can be retrieved through the
+     * `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `OperationMetadata` (metadata).
+     * `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
+     * This service will write image annotation outputs to json files in customer
+     * GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
+     * 
+ */ + public void asyncBatchAnnotateImages( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getAsyncBatchAnnotateImagesMethodHelper(), 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.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse>( + this, METHODID_BATCH_ANNOTATE_IMAGES))) + .addMethod( + getBatchAnnotateFilesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse>( + this, METHODID_BATCH_ANNOTATE_FILES))) + .addMethod( + getAsyncBatchAnnotateImagesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest, + com.google.longrunning.Operation>( + this, METHODID_ASYNC_BATCH_ANNOTATE_IMAGES))) + .addMethod( + getAsyncBatchAnnotateFilesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBatchAnnotateImagesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Service that performs image detection and annotation for a batch of files.
+     * Now only "application/pdf", "image/tiff" and "image/gif" are supported.
+     * This service will extract at most the first 10 frames (gif) or pages
+     * (pdf or tiff) from each file provided and perform detection and annotation
+     * for each image extracted.
+     * 
+ */ + public void batchAnnotateFiles( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBatchAnnotateFilesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Run asynchronous image detection and annotation for a list of images.
+     * Progress and results can be retrieved through the
+     * `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `OperationMetadata` (metadata).
+     * `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
+     * This service will write image annotation outputs to json files in customer
+     * GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
+     * 
+ */ + public void asyncBatchAnnotateImages( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getAsyncBatchAnnotateImagesMethodHelper(), 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.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesResponse batchAnnotateImages( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest request) { + return blockingUnaryCall( + getChannel(), getBatchAnnotateImagesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Service that performs image detection and annotation for a batch of files.
+     * Now only "application/pdf", "image/tiff" and "image/gif" are supported.
+     * This service will extract at most the first 10 frames (gif) or pages
+     * (pdf or tiff) from each file provided and perform detection and annotation
+     * for each image extracted.
+     * 
+ */ + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse batchAnnotateFiles( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest request) { + return blockingUnaryCall( + getChannel(), getBatchAnnotateFilesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Run asynchronous image detection and annotation for a list of images.
+     * Progress and results can be retrieved through the
+     * `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `OperationMetadata` (metadata).
+     * `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
+     * This service will write image annotation outputs to json files in customer
+     * GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
+     * 
+ */ + public com.google.longrunning.Operation asyncBatchAnnotateImages( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest request) { + return blockingUnaryCall( + getChannel(), getAsyncBatchAnnotateImagesMethodHelper(), 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.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse> + batchAnnotateImages(com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest request) { + return futureUnaryCall( + getChannel().newCall(getBatchAnnotateImagesMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Service that performs image detection and annotation for a batch of files.
+     * Now only "application/pdf", "image/tiff" and "image/gif" are supported.
+     * This service will extract at most the first 10 frames (gif) or pages
+     * (pdf or tiff) from each file provided and perform detection and annotation
+     * for each image extracted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse> + batchAnnotateFiles(com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest request) { + return futureUnaryCall( + getChannel().newCall(getBatchAnnotateFilesMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Run asynchronous image detection and annotation for a list of images.
+     * Progress and results can be retrieved through the
+     * `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `OperationMetadata` (metadata).
+     * `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
+     * This service will write image annotation outputs to json files in customer
+     * GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + asyncBatchAnnotateImages( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest request) { + return futureUnaryCall( + getChannel().newCall(getAsyncBatchAnnotateImagesMethodHelper(), 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.v1p4beta1.AsyncBatchAnnotateFilesRequest request) { + return futureUnaryCall( + getChannel().newCall(getAsyncBatchAnnotateFilesMethodHelper(), getCallOptions()), + request); + } + } + + private static final int METHODID_BATCH_ANNOTATE_IMAGES = 0; + private static final int METHODID_BATCH_ANNOTATE_FILES = 1; + private static final int METHODID_ASYNC_BATCH_ANNOTATE_IMAGES = 2; + private static final int METHODID_ASYNC_BATCH_ANNOTATE_FILES = 3; + + 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.v1p4beta1.BatchAnnotateImagesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse>) + responseObserver); + break; + case METHODID_BATCH_ANNOTATE_FILES: + serviceImpl.batchAnnotateFiles( + (com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse>) + responseObserver); + break; + case METHODID_ASYNC_BATCH_ANNOTATE_IMAGES: + serviceImpl.asyncBatchAnnotateImages( + (com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ASYNC_BATCH_ANNOTATE_FILES: + serviceImpl.asyncBatchAnnotateFiles( + (com.google.cloud.vision.v1p4beta1.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 abstract static 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.v1p4beta1.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(getBatchAnnotateFilesMethodHelper()) + .addMethod(getAsyncBatchAnnotateImagesMethodHelper()) + .addMethod(getAsyncBatchAnnotateFilesMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchGrpc.java b/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchGrpc.java new file mode 100644 index 000000000000..a58f5a9e8419 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchGrpc.java @@ -0,0 +1,2947 @@ +package com.google.cloud.vision.v1p4beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * 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.v1p4beta1.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.v1p4beta1.Product] resources, named
+ *   `projects/*/locations/*/products/*`
+ * - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] resources, named
+ *   `projects/*/locations/*/products/*/referenceImages/*`
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/vision/v1p4beta1/product_search_service.proto") +public final class ProductSearchGrpc { + + private ProductSearchGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + METHOD_CREATE_PRODUCT_SET = getCreateProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getCreateProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getCreateProductSetMethod() { + return getCreateProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getCreateProductSetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + 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.v1p4beta1.ProductSearch", "CreateProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest, + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse> + METHOD_LIST_PRODUCT_SETS = getListProductSetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest, + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse> + getListProductSetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest, + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse> + getListProductSetsMethod() { + return getListProductSetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest, + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse> + getListProductSetsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest, + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse> + 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.v1p4beta1.ProductSearch", "ListProductSets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.GetProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + METHOD_GET_PRODUCT_SET = getGetProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getGetProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getGetProductSetMethod() { + return getGetProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getGetProductSetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + 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.v1p4beta1.ProductSearch", "GetProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.GetProductSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + METHOD_UPDATE_PRODUCT_SET = getUpdateProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getUpdateProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getUpdateProductSetMethod() { + return getUpdateProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + getUpdateProductSetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet> + 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.v1p4beta1.ProductSearch", "UpdateProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest, com.google.protobuf.Empty> + METHOD_DELETE_PRODUCT_SET = getDeleteProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest, com.google.protobuf.Empty> + getDeleteProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest, com.google.protobuf.Empty> + getDeleteProductSetMethod() { + return getDeleteProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest, com.google.protobuf.Empty> + getDeleteProductSetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest, com.google.protobuf.Empty> + 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.v1p4beta1.ProductSearch", "DeleteProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.CreateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + METHOD_CREATE_PRODUCT = getCreateProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getCreateProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getCreateProductMethod() { + return getCreateProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getCreateProductMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + 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.v1p4beta1.ProductSearch", "CreateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.CreateProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ListProductsRequest, + com.google.cloud.vision.v1p4beta1.ListProductsResponse> + METHOD_LIST_PRODUCTS = getListProductsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductsRequest, + com.google.cloud.vision.v1p4beta1.ListProductsResponse> + getListProductsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductsRequest, + com.google.cloud.vision.v1p4beta1.ListProductsResponse> + getListProductsMethod() { + return getListProductsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductsRequest, + com.google.cloud.vision.v1p4beta1.ListProductsResponse> + getListProductsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductsRequest, + com.google.cloud.vision.v1p4beta1.ListProductsResponse> + 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.v1p4beta1.ProductSearch", "ListProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.ListProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.GetProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + METHOD_GET_PRODUCT = getGetProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getGetProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getGetProductMethod() { + return getGetProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getGetProductMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + 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.v1p4beta1.ProductSearch", "GetProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.GetProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.UpdateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + METHOD_UPDATE_PRODUCT = getUpdateProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.UpdateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getUpdateProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.UpdateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getUpdateProductMethod() { + return getUpdateProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.UpdateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + getUpdateProductMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.UpdateProductRequest, + com.google.cloud.vision.v1p4beta1.Product> + 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.v1p4beta1.ProductSearch", "UpdateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.UpdateProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.DeleteProductRequest, com.google.protobuf.Empty> + METHOD_DELETE_PRODUCT = getDeleteProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethod() { + return getDeleteProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteProductRequest, com.google.protobuf.Empty> + 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.v1p4beta1.ProductSearch", "DeleteProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + METHOD_CREATE_REFERENCE_IMAGE = getCreateReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + getCreateReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + getCreateReferenceImageMethod() { + return getCreateReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + getCreateReferenceImageMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + 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.v1p4beta1.ProductSearch", + "CreateReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest, com.google.protobuf.Empty> + METHOD_DELETE_REFERENCE_IMAGE = getDeleteReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest, com.google.protobuf.Empty> + getDeleteReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest, com.google.protobuf.Empty> + getDeleteReferenceImageMethod() { + return getDeleteReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest, com.google.protobuf.Empty> + getDeleteReferenceImageMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest, + com.google.protobuf.Empty> + 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.v1p4beta1.ProductSearch", + "DeleteReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest, + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse> + METHOD_LIST_REFERENCE_IMAGES = getListReferenceImagesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest, + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse> + getListReferenceImagesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest, + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse> + getListReferenceImagesMethod() { + return getListReferenceImagesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest, + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse> + getListReferenceImagesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest, + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse> + 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.v1p4beta1.ProductSearch", "ListReferenceImages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + METHOD_GET_REFERENCE_IMAGE = getGetReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + getGetReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + getGetReferenceImageMethod() { + return getGetReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + getGetReferenceImageMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage> + 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.v1p4beta1.ProductSearch", "GetReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest, + com.google.protobuf.Empty> + METHOD_ADD_PRODUCT_TO_PRODUCT_SET = getAddProductToProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest, + com.google.protobuf.Empty> + getAddProductToProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest, + com.google.protobuf.Empty> + getAddProductToProductSetMethod() { + return getAddProductToProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest, + com.google.protobuf.Empty> + getAddProductToProductSetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest, + com.google.protobuf.Empty> + 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.v1p4beta1.ProductSearch", + "AddProductToProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest, + com.google.protobuf.Empty> + METHOD_REMOVE_PRODUCT_FROM_PRODUCT_SET = getRemoveProductFromProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest, + com.google.protobuf.Empty> + getRemoveProductFromProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest, + com.google.protobuf.Empty> + getRemoveProductFromProductSetMethod() { + return getRemoveProductFromProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest, + com.google.protobuf.Empty> + getRemoveProductFromProductSetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest, + com.google.protobuf.Empty> + 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.v1p4beta1.ProductSearch", + "RemoveProductFromProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest, + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse> + METHOD_LIST_PRODUCTS_IN_PRODUCT_SET = getListProductsInProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest, + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse> + getListProductsInProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest, + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse> + getListProductsInProductSetMethod() { + return getListProductsInProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest, + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse> + getListProductsInProductSetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest, + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse> + 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.v1p4beta1.ProductSearch", + "ListProductsInProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest, + com.google.longrunning.Operation> + METHOD_IMPORT_PRODUCT_SETS = getImportProductSetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest, + com.google.longrunning.Operation> + getImportProductSetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest, + com.google.longrunning.Operation> + getImportProductSetsMethod() { + return getImportProductSetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest, + com.google.longrunning.Operation> + getImportProductSetsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest, + com.google.longrunning.Operation> + 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.v1p4beta1.ProductSearch", "ImportProductSets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] resources, named
+   *   `projects/*/locations/*/products/*/referenceImages/*`
+   * 
+ */ + public abstract static 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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.UpdateProductSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateProductSetMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Permanently deletes a ProductSet. Products and ReferenceImages in the
+     * ProductSet are not 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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.GetProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetProductMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Makes changes to a Product resource.
+     * Only the `display_name`, `description`, and `labels` fields 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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ListProductsInProductSetRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse> + 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.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public void importProductSets( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet>( + this, METHODID_CREATE_PRODUCT_SET))) + .addMethod( + getListProductSetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest, + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse>( + this, METHODID_LIST_PRODUCT_SETS))) + .addMethod( + getGetProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.GetProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet>( + this, METHODID_GET_PRODUCT_SET))) + .addMethod( + getUpdateProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest, + com.google.cloud.vision.v1p4beta1.ProductSet>( + this, METHODID_UPDATE_PRODUCT_SET))) + .addMethod( + getDeleteProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_PRODUCT_SET))) + .addMethod( + getCreateProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.CreateProductRequest, + com.google.cloud.vision.v1p4beta1.Product>(this, METHODID_CREATE_PRODUCT))) + .addMethod( + getListProductsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.ListProductsRequest, + com.google.cloud.vision.v1p4beta1.ListProductsResponse>( + this, METHODID_LIST_PRODUCTS))) + .addMethod( + getGetProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.GetProductRequest, + com.google.cloud.vision.v1p4beta1.Product>(this, METHODID_GET_PRODUCT))) + .addMethod( + getUpdateProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.UpdateProductRequest, + com.google.cloud.vision.v1p4beta1.Product>(this, METHODID_UPDATE_PRODUCT))) + .addMethod( + getDeleteProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.DeleteProductRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_PRODUCT))) + .addMethod( + getCreateReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage>( + this, METHODID_CREATE_REFERENCE_IMAGE))) + .addMethod( + getDeleteReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_REFERENCE_IMAGE))) + .addMethod( + getListReferenceImagesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest, + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse>( + this, METHODID_LIST_REFERENCE_IMAGES))) + .addMethod( + getGetReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest, + com.google.cloud.vision.v1p4beta1.ReferenceImage>( + this, METHODID_GET_REFERENCE_IMAGE))) + .addMethod( + getAddProductToProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest, + com.google.protobuf.Empty>(this, METHODID_ADD_PRODUCT_TO_PRODUCT_SET))) + .addMethod( + getRemoveProductFromProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest, + com.google.protobuf.Empty>(this, METHODID_REMOVE_PRODUCT_FROM_PRODUCT_SET))) + .addMethod( + getListProductsInProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest, + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse>( + this, METHODID_LIST_PRODUCTS_IN_PRODUCT_SET))) + .addMethod( + getImportProductSetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.UpdateProductSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateProductSetMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Permanently deletes a ProductSet. Products and ReferenceImages in the
+     * ProductSet are not 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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.GetProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetProductMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Makes changes to a Product resource.
+     * Only the `display_name`, `description`, and `labels` fields 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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ListProductsInProductSetRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse> + 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.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public void importProductSets( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet createProductSet( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsResponse listProductSets( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet getProductSet( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet updateProductSet( + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateProductSetMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes a ProductSet. Products and ReferenceImages in the
+     * ProductSet are not 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.v1p4beta1.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.v1p4beta1.Product createProduct( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsResponse listProducts( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product getProduct( + com.google.cloud.vision.v1p4beta1.GetProductRequest request) { + return blockingUnaryCall( + getChannel(), getGetProductMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Makes changes to a Product resource.
+     * Only the `display_name`, `description`, and `labels` fields 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.v1p4beta1.Product updateProduct( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ReferenceImage createReferenceImage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ListReferenceImagesResponse listReferenceImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage getReferenceImage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ListProductsInProductSetResponse + listProductsInProductSet( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public com.google.longrunning.Operation importProductSets( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ProductSet> + createProductSet(com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse> + listProductSets(com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ProductSet> + getProductSet(com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ProductSet> + updateProductSet(com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateProductSetMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Permanently deletes a ProductSet. Products and ReferenceImages in the
+     * ProductSet are not 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.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.Product> + createProduct(com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ListProductsResponse> + listProducts(com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.Product> + getProduct(com.google.cloud.vision.v1p4beta1.GetProductRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetProductMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Makes changes to a Product resource.
+     * Only the `display_name`, `description`, and `labels` fields 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< + com.google.cloud.vision.v1p4beta1.Product> + updateProduct(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ReferenceImage> + createReferenceImage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse> + listReferenceImages(com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ReferenceImage> + getReferenceImage(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse> + listProductsInProductSet( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importProductSets(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PRODUCT_SETS: + serviceImpl.listProductSets( + (com.google.cloud.vision.v1p4beta1.ListProductSetsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse>) + responseObserver); + break; + case METHODID_GET_PRODUCT_SET: + serviceImpl.getProductSet( + (com.google.cloud.vision.v1p4beta1.GetProductSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_PRODUCT_SET: + serviceImpl.updateProductSet( + (com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PRODUCT_SET: + serviceImpl.deleteProductSet( + (com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_PRODUCT: + serviceImpl.createProduct( + (com.google.cloud.vision.v1p4beta1.CreateProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PRODUCTS: + serviceImpl.listProducts( + (com.google.cloud.vision.v1p4beta1.ListProductsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PRODUCT: + serviceImpl.getProduct( + (com.google.cloud.vision.v1p4beta1.GetProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_PRODUCT: + serviceImpl.updateProduct( + (com.google.cloud.vision.v1p4beta1.UpdateProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PRODUCT: + serviceImpl.deleteProduct( + (com.google.cloud.vision.v1p4beta1.DeleteProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_REFERENCE_IMAGE: + serviceImpl.createReferenceImage( + (com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_REFERENCE_IMAGE: + serviceImpl.deleteReferenceImage( + (com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_REFERENCE_IMAGES: + serviceImpl.listReferenceImages( + (com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse>) + responseObserver); + break; + case METHODID_GET_REFERENCE_IMAGE: + serviceImpl.getReferenceImage( + (com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ADD_PRODUCT_TO_PRODUCT_SET: + serviceImpl.addProductToProductSet( + (com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_PRODUCT_FROM_PRODUCT_SET: + serviceImpl.removeProductFromProductSet( + (com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRODUCTS_IN_PRODUCT_SET: + serviceImpl.listProductsInProductSet( + (com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse>) + responseObserver); + break; + case METHODID_IMPORT_PRODUCT_SETS: + serviceImpl.importProductSets( + (com.google.cloud.vision.v1p4beta1.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 abstract static 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.v1p4beta1.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 ad2919050be3..751ff5c41b16 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -564,6 +564,16 @@ grpc-google-cloud-vision-v1p3beta1 0.46.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-vision-v1p4beta1 + 0.46.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-vision-v1p4beta1 + 0.46.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-video-intelligence-v1beta1 @@ -708,6 +718,7 @@ grpc-google-cloud-vision-v1p1beta1 grpc-google-cloud-vision-v1p2beta1 grpc-google-cloud-vision-v1p3beta1 + grpc-google-cloud-vision-v1p4beta1 grpc-google-cloud-websecurityscanner-v1alpha proto-google-cloud-asset-v1beta1 @@ -761,6 +772,7 @@ proto-google-cloud-vision-v1p1beta1 proto-google-cloud-vision-v1p2beta1 proto-google-cloud-vision-v1p3beta1 + proto-google-cloud-vision-v1p4beta1 proto-google-cloud-websecurityscanner-v1alpha 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 index 4f93614ad384..c4d43412d32c 100644 --- 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 @@ -614,8 +614,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory - .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED - .getNumber()) { + .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { output.writeEnum(2, category_); } if (normalizedBoundingPoly_ != null) { @@ -653,8 +652,7 @@ public int getSerializedSize() { } if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory - .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED - .getNumber()) { + .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, category_); } if (normalizedBoundingPoly_ != null) { 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 index 93f6100f88dc..c8288d07be73 100644 --- 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 @@ -2426,8 +2426,7 @@ public final boolean isInitialized() { 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()) { + .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { output.writeEnum(1, category_); } if (indexTime_ != null) { @@ -2453,8 +2452,7 @@ public int getSerializedSize() { size = 0; if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory - .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED - .getNumber()) { + .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, category_); } if (indexTime_ != null) { diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/pom.xml b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/pom.xml new file mode 100644 index 000000000000..97d1d50504fc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + proto-google-cloud-vision-v1p4beta1 + 0.46.1-SNAPSHOT + proto-google-cloud-vision-v1p4beta1 + PROTO library for proto-google-cloud-vision-v1p4beta1 + + com.google.api.grpc + google-api-grpc + 0.46.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AddProductToProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AddProductToProductSetRequest.java new file mode 100644 index 000000000000..750b50a78e56 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AddProductToProductSetRequest.java @@ -0,0 +1,796 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `AddProductToProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AddProductToProductSetRequest} + */ +public final class AddProductToProductSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + product_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getProductBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, product_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!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.v1p4beta1.AddProductToProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AddProductToProductSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AddProductToProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AddProductToProductSetRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AddProductToProductSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AddProductToProductSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `AddProductToProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AddProductToProductSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AddProductToProductSetRequest) + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + product_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest build() { + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest result = + new com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest(this); + result.name_ = name_; + result.product_ = product_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AddProductToProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AddProductToProductSetRequest) + private static final com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AddProductToProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AddProductToProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..75761e2a48a6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AddProductToProductSetRequestOrBuilder.java @@ -0,0 +1,60 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AddProductToProductSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileRequest.java new file mode 100644 index 000000000000..0b50c97d8e32 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileRequest.java @@ -0,0 +1,1771 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A request to annotate one single file, e.g. a PDF, TIFF or GIF file.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AnnotateFileRequest} + */ +public final class AnnotateFileRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.AnnotateFileRequest) + AnnotateFileRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AnnotateFileRequest.newBuilder() to construct. + private AnnotateFileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AnnotateFileRequest() { + features_ = java.util.Collections.emptyList(); + pages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AnnotateFileRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vision.v1p4beta1.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature.parser(), extensionRegistry)); + break; + } + case 26: + { + com.google.cloud.vision.v1p4beta1.ImageContext.Builder subBuilder = null; + if (imageContext_ != null) { + subBuilder = imageContext_.toBuilder(); + } + imageContext_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ImageContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(imageContext_); + imageContext_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + pages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + pages_.add(input.readInt32()); + break; + } + case 34: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) + && input.getBytesUntilLimit() > 0) { + pages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + while (input.getBytesUntilLimit() > 0) { + pages_.add(input.readInt32()); + } + input.popLimit(limit); + 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 { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + features_ = java.util.Collections.unmodifiableList(features_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.class, + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder.class); + } + + private int bitField0_; + public static final int INPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.InputConfig inputConfig_; + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int FEATURES_FIELD_NUMBER = 2; + private java.util.List features_; + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + return features_; + } + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List + getFeaturesOrBuilderList() { + return features_; + } + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public int getFeaturesCount() { + return features_.size(); + } + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index) { + return features_.get(index); + } + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index) { + return features_.get(index); + } + + public static final int IMAGE_CONTEXT_FIELD_NUMBER = 3; + private com.google.cloud.vision.v1p4beta1.ImageContext imageContext_; + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public boolean hasImageContext() { + return imageContext_ != null; + } + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext getImageContext() { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder() { + return getImageContext(); + } + + public static final int PAGES_FIELD_NUMBER = 4; + private java.util.List pages_; + /** + * + * + *
+   * Pages of the file to perform image annotation.
+   * Pages starts from 1, we assume the first page of the file is page 1.
+   * At most 5 pages are supported per request. Pages can be negative.
+   * Page 1 means the first page.
+   * Page 2 means the second page.
+   * Page -1 means the last page.
+   * Page -2 means the second to the last page.
+   * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+   * If this field is empty, by default the service performs image annotation
+   * for the first 5 pages of the file.
+   * 
+ * + * repeated int32 pages = 4; + */ + public java.util.List getPagesList() { + return pages_; + } + /** + * + * + *
+   * Pages of the file to perform image annotation.
+   * Pages starts from 1, we assume the first page of the file is page 1.
+   * At most 5 pages are supported per request. Pages can be negative.
+   * Page 1 means the first page.
+   * Page 2 means the second page.
+   * Page -1 means the last page.
+   * Page -2 means the second to the last page.
+   * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+   * If this field is empty, by default the service performs image annotation
+   * for the first 5 pages of the file.
+   * 
+ * + * repeated int32 pages = 4; + */ + public int getPagesCount() { + return pages_.size(); + } + /** + * + * + *
+   * Pages of the file to perform image annotation.
+   * Pages starts from 1, we assume the first page of the file is page 1.
+   * At most 5 pages are supported per request. Pages can be negative.
+   * Page 1 means the first page.
+   * Page 2 means the second page.
+   * Page -1 means the last page.
+   * Page -2 means the second to the last page.
+   * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+   * If this field is empty, by default the service performs image annotation
+   * for the first 5 pages of the file.
+   * 
+ * + * repeated int32 pages = 4; + */ + public int getPages(int index) { + return pages_.get(index); + } + + private int pagesMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (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 (getPagesList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(pagesMemoizedSerializedSize); + } + for (int i = 0; i < pages_.size(); i++) { + output.writeInt32NoTag(pages_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputConfig()); + } + 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()); + } + { + int dataSize = 0; + for (int i = 0; i < pages_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(pages_.get(i)); + } + size += dataSize; + if (!getPagesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + pagesMemoizedSerializedSize = 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.v1p4beta1.AnnotateFileRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest other = + (com.google.cloud.vision.v1p4beta1.AnnotateFileRequest) 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 && getPagesList().equals(other.getPagesList()); + 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 (getPagesCount() > 0) { + hash = (37 * hash) + PAGES_FIELD_NUMBER; + hash = (53 * hash) + getPagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parseFrom( + 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.v1p4beta1.AnnotateFileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parseFrom( + com.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.v1p4beta1.AnnotateFileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parseFrom( + java.io.InputStream 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.v1p4beta1.AnnotateFileRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parseDelimitedFrom( + java.io.InputStream 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.v1p4beta1.AnnotateFileRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A request to annotate one single file, e.g. a PDF, TIFF or GIF file.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AnnotateFileRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AnnotateFileRequest) + com.google.cloud.vision.v1p4beta1.AnnotateFileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.class, + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.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(); + } + } + + @java.lang.Override + 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; + } + pages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest build() { + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest result = + new com.google.cloud.vision.v1p4beta1.AnnotateFileRequest(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 (((bitField0_ & 0x00000008) == 0x00000008)) { + pages_ = java.util.Collections.unmodifiableList(pages_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.pages_ = pages_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AnnotateFileRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AnnotateFileRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.AnnotateFileRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.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.pages_.isEmpty()) { + if (pages_.isEmpty()) { + pages_ = other.pages_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePagesIsMutable(); + pages_.addAll(other.pages_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.AnnotateFileRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.InputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public Builder mergeInputConfig(com.google.cloud.vision.v1p4beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder> + featuresBuilder_; + + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public int getFeaturesCount() { + if (featuresBuilder_ == null) { + return features_.size(); + } else { + return featuresBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index) { + if (featuresBuilder_ == null) { + return features_.get(index); + } else { + return featuresBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public Builder setFeatures(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder setFeatures( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder getFeaturesBuilder(int index) { + return getFeaturesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index) { + if (featuresBuilder_ == null) { + return features_.get(index); + } else { + return featuresBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder addFeaturesBuilder() { + return getFeaturesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Feature.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder addFeaturesBuilder(int index) { + return getFeaturesFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Feature.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List + getFeaturesBuilderList() { + return getFeaturesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder> + getFeaturesFieldBuilder() { + if (featuresBuilder_ == null) { + featuresBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder>( + features_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + features_ = null; + } + return featuresBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.ImageContext imageContext_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder> + imageContextBuilder_; + /** + * + * + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext getImageContext() { + if (imageContextBuilder_ == null) { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } else { + return imageContextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public Builder setImageContext(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public Builder setImageContext( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public Builder mergeImageContext(com.google.cloud.vision.v1p4beta1.ImageContext value) { + if (imageContextBuilder_ == null) { + if (imageContext_ != null) { + imageContext_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext.Builder getImageContextBuilder() { + + onChanged(); + return getImageContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder() { + if (imageContextBuilder_ != null) { + return imageContextBuilder_.getMessageOrBuilder(); + } else { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } + } + /** + * + * + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder> + getImageContextFieldBuilder() { + if (imageContextBuilder_ == null) { + imageContextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder>( + getImageContext(), getParentForChildren(), isClean()); + imageContext_ = null; + } + return imageContextBuilder_; + } + + private java.util.List pages_ = java.util.Collections.emptyList(); + + private void ensurePagesIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + pages_ = new java.util.ArrayList(pages_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * Pages of the file to perform image annotation.
+     * Pages starts from 1, we assume the first page of the file is page 1.
+     * At most 5 pages are supported per request. Pages can be negative.
+     * Page 1 means the first page.
+     * Page 2 means the second page.
+     * Page -1 means the last page.
+     * Page -2 means the second to the last page.
+     * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+     * If this field is empty, by default the service performs image annotation
+     * for the first 5 pages of the file.
+     * 
+ * + * repeated int32 pages = 4; + */ + public java.util.List getPagesList() { + return java.util.Collections.unmodifiableList(pages_); + } + /** + * + * + *
+     * Pages of the file to perform image annotation.
+     * Pages starts from 1, we assume the first page of the file is page 1.
+     * At most 5 pages are supported per request. Pages can be negative.
+     * Page 1 means the first page.
+     * Page 2 means the second page.
+     * Page -1 means the last page.
+     * Page -2 means the second to the last page.
+     * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+     * If this field is empty, by default the service performs image annotation
+     * for the first 5 pages of the file.
+     * 
+ * + * repeated int32 pages = 4; + */ + public int getPagesCount() { + return pages_.size(); + } + /** + * + * + *
+     * Pages of the file to perform image annotation.
+     * Pages starts from 1, we assume the first page of the file is page 1.
+     * At most 5 pages are supported per request. Pages can be negative.
+     * Page 1 means the first page.
+     * Page 2 means the second page.
+     * Page -1 means the last page.
+     * Page -2 means the second to the last page.
+     * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+     * If this field is empty, by default the service performs image annotation
+     * for the first 5 pages of the file.
+     * 
+ * + * repeated int32 pages = 4; + */ + public int getPages(int index) { + return pages_.get(index); + } + /** + * + * + *
+     * Pages of the file to perform image annotation.
+     * Pages starts from 1, we assume the first page of the file is page 1.
+     * At most 5 pages are supported per request. Pages can be negative.
+     * Page 1 means the first page.
+     * Page 2 means the second page.
+     * Page -1 means the last page.
+     * Page -2 means the second to the last page.
+     * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+     * If this field is empty, by default the service performs image annotation
+     * for the first 5 pages of the file.
+     * 
+ * + * repeated int32 pages = 4; + */ + public Builder setPages(int index, int value) { + ensurePagesIsMutable(); + pages_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Pages of the file to perform image annotation.
+     * Pages starts from 1, we assume the first page of the file is page 1.
+     * At most 5 pages are supported per request. Pages can be negative.
+     * Page 1 means the first page.
+     * Page 2 means the second page.
+     * Page -1 means the last page.
+     * Page -2 means the second to the last page.
+     * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+     * If this field is empty, by default the service performs image annotation
+     * for the first 5 pages of the file.
+     * 
+ * + * repeated int32 pages = 4; + */ + public Builder addPages(int value) { + ensurePagesIsMutable(); + pages_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Pages of the file to perform image annotation.
+     * Pages starts from 1, we assume the first page of the file is page 1.
+     * At most 5 pages are supported per request. Pages can be negative.
+     * Page 1 means the first page.
+     * Page 2 means the second page.
+     * Page -1 means the last page.
+     * Page -2 means the second to the last page.
+     * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+     * If this field is empty, by default the service performs image annotation
+     * for the first 5 pages of the file.
+     * 
+ * + * repeated int32 pages = 4; + */ + public Builder addAllPages(java.lang.Iterable values) { + ensurePagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pages_); + onChanged(); + return this; + } + /** + * + * + *
+     * Pages of the file to perform image annotation.
+     * Pages starts from 1, we assume the first page of the file is page 1.
+     * At most 5 pages are supported per request. Pages can be negative.
+     * Page 1 means the first page.
+     * Page 2 means the second page.
+     * Page -1 means the last page.
+     * Page -2 means the second to the last page.
+     * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+     * If this field is empty, by default the service performs image annotation
+     * for the first 5 pages of the file.
+     * 
+ * + * repeated int32 pages = 4; + */ + public Builder clearPages() { + pages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AnnotateFileRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AnnotateFileRequest) + private static final com.google.cloud.vision.v1p4beta1.AnnotateFileRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AnnotateFileRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnnotateFileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateFileRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileRequestOrBuilder.java new file mode 100644 index 000000000000..35139f9db0ed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileRequestOrBuilder.java @@ -0,0 +1,182 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AnnotateFileRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AnnotateFileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig(); + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + java.util.List getFeaturesList(); + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index); + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + int getFeaturesCount(); + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + java.util.List + getFeaturesOrBuilderList(); + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index); + + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + boolean hasImageContext(); + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p4beta1.ImageContext getImageContext(); + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder(); + + /** + * + * + *
+   * Pages of the file to perform image annotation.
+   * Pages starts from 1, we assume the first page of the file is page 1.
+   * At most 5 pages are supported per request. Pages can be negative.
+   * Page 1 means the first page.
+   * Page 2 means the second page.
+   * Page -1 means the last page.
+   * Page -2 means the second to the last page.
+   * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+   * If this field is empty, by default the service performs image annotation
+   * for the first 5 pages of the file.
+   * 
+ * + * repeated int32 pages = 4; + */ + java.util.List getPagesList(); + /** + * + * + *
+   * Pages of the file to perform image annotation.
+   * Pages starts from 1, we assume the first page of the file is page 1.
+   * At most 5 pages are supported per request. Pages can be negative.
+   * Page 1 means the first page.
+   * Page 2 means the second page.
+   * Page -1 means the last page.
+   * Page -2 means the second to the last page.
+   * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+   * If this field is empty, by default the service performs image annotation
+   * for the first 5 pages of the file.
+   * 
+ * + * repeated int32 pages = 4; + */ + int getPagesCount(); + /** + * + * + *
+   * Pages of the file to perform image annotation.
+   * Pages starts from 1, we assume the first page of the file is page 1.
+   * At most 5 pages are supported per request. Pages can be negative.
+   * Page 1 means the first page.
+   * Page 2 means the second page.
+   * Page -1 means the last page.
+   * Page -2 means the second to the last page.
+   * If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
+   * If this field is empty, by default the service performs image annotation
+   * for the first 5 pages of the file.
+   * 
+ * + * repeated int32 pages = 4; + */ + int getPages(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileResponse.java new file mode 100644 index 000000000000..461962b0f86a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileResponse.java @@ -0,0 +1,1299 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.AnnotateFileResponse} + */ +public final class AnnotateFileResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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(); + totalPages_ = 0; + } + + @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; + case 10: + { + com.google.cloud.vision.v1p4beta1.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse>(); + mutable_bitField0_ |= 0x00000002; + } + responses_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.parser(), + extensionRegistry)); + break; + } + case 24: + { + totalPages_ = input.readInt32(); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.class, + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder.class); + } + + private int bitField0_; + public static final int INPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.InputConfig inputConfig_; + /** + * + * + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List + getResponsesList() { + return responses_; + } + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public int getResponsesCount() { + return responses_.size(); + } + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse getResponses(int index) { + return responses_.get(index); + } + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + public static final int TOTAL_PAGES_FIELD_NUMBER = 3; + private int totalPages_; + /** + * + * + *
+   * This field gives the total number of pages in the file.
+   * 
+ * + * int32 total_pages = 3; + */ + public int getTotalPages() { + return totalPages_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (inputConfig_ != null) { + output.writeMessage(1, getInputConfig()); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(2, responses_.get(i)); + } + if (totalPages_ != 0) { + output.writeInt32(3, totalPages_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputConfig()); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, responses_.get(i)); + } + if (totalPages_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalPages_); + } + 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.v1p4beta1.AnnotateFileResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse other = + (com.google.cloud.vision.v1p4beta1.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 && (getTotalPages() == other.getTotalPages()); + 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 = (37 * hash) + TOTAL_PAGES_FIELD_NUMBER; + hash = (53 * hash) + getTotalPages(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateFileResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateFileResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateFileResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateFileResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response 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.v1p4beta1.AnnotateFileResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AnnotateFileResponse) + com.google.cloud.vision.v1p4beta1.AnnotateFileResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.class, + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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(); + } + totalPages_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse build() { + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse result = + new com.google.cloud.vision.v1p4beta1.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.totalPages_ = totalPages_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AnnotateFileResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AnnotateFileResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.AnnotateFileResponse other) { + if (other == com.google.cloud.vision.v1p4beta1.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_); + } + } + } + if (other.getTotalPages() != 0) { + setTotalPages(other.getTotalPages()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.AnnotateFileResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.InputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public Builder mergeInputConfig(com.google.cloud.vision.v1p4beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Information about the file for which this response is generated.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public Builder setResponses( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public Builder addResponses(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public Builder addResponses( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public Builder addResponses( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder> + 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.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.getDefaultInstance()); + } + /** + * + * + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.getDefaultInstance()); + } + /** + * + * + *
+     * Individual responses to images found within the file.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + private int totalPages_; + /** + * + * + *
+     * This field gives the total number of pages in the file.
+     * 
+ * + * int32 total_pages = 3; + */ + public int getTotalPages() { + return totalPages_; + } + /** + * + * + *
+     * This field gives the total number of pages in the file.
+     * 
+ * + * int32 total_pages = 3; + */ + public Builder setTotalPages(int value) { + + totalPages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field gives the total number of pages in the file.
+     * 
+ * + * int32 total_pages = 3; + */ + public Builder clearTotalPages() { + + totalPages_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AnnotateFileResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AnnotateFileResponse) + private static final com.google.cloud.vision.v1p4beta1.AnnotateFileResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AnnotateFileResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateFileResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileResponseOrBuilder.java new file mode 100644 index 000000000000..78c2eb3143e6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateFileResponseOrBuilder.java @@ -0,0 +1,104 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AnnotateFileResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AnnotateFileResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig(); + /** + * + * + *
+   * Information about the file for which this response is generated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + java.util.List getResponsesList(); + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse getResponses(int index); + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + int getResponsesCount(); + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + java.util.List + getResponsesOrBuilderList(); + /** + * + * + *
+   * Individual responses to images found within the file.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 2; + */ + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder(int index); + + /** + * + * + *
+   * This field gives the total number of pages in the file.
+   * 
+ * + * int32 total_pages = 3; + */ + int getTotalPages(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageRequest.java new file mode 100644 index 000000000000..c08533736809 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageRequest.java @@ -0,0 +1,1464 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request for performing Google Cloud Vision API tasks over a user-provided
+ * image, with user-requested features, and with context information.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AnnotateImageRequest} + */ +public final class AnnotateImageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.Image.Builder subBuilder = null; + if (image_ != null) { + subBuilder = image_.toBuilder(); + } + image_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature.parser(), extensionRegistry)); + break; + } + case 26: + { + com.google.cloud.vision.v1p4beta1.ImageContext.Builder subBuilder = null; + if (imageContext_ != null) { + subBuilder = imageContext_.toBuilder(); + } + imageContext_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ImageContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(imageContext_); + imageContext_ = subBuilder.buildPartial(); + } + + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.class, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder.class); + } + + private int bitField0_; + public static final int IMAGE_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.Image image_; + /** + * + * + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + public boolean hasImage() { + return image_ != null; + } + /** + * + * + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p4beta1.Image getImage() { + return image_ == null ? com.google.cloud.vision.v1p4beta1.Image.getDefaultInstance() : image_; + } + /** + * + * + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p4beta1.ImageOrBuilder getImageOrBuilder() { + return getImage(); + } + + public static final int FEATURES_FIELD_NUMBER = 2; + private java.util.List features_; + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + return features_; + } + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List + getFeaturesOrBuilderList() { + return features_; + } + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public int getFeaturesCount() { + return features_.size(); + } + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index) { + return features_.get(index); + } + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index) { + return features_.get(index); + } + + public static final int IMAGE_CONTEXT_FIELD_NUMBER = 3; + private com.google.cloud.vision.v1p4beta1.ImageContext imageContext_; + /** + * + * + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public boolean hasImageContext() { + return imageContext_ != null; + } + /** + * + * + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext getImageContext() { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } + /** + * + * + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder() { + return getImageContext(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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); + } + + @java.lang.Override + 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.v1p4beta1.AnnotateImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for performing Google Cloud Vision API tasks over a user-provided
+   * image, with user-requested features, and with context information.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AnnotateImageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AnnotateImageRequest) + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.class, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest build() { + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AnnotateImageRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AnnotateImageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.AnnotateImageRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.AnnotateImageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.Image image_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Image, + com.google.cloud.vision.v1p4beta1.Image.Builder, + com.google.cloud.vision.v1p4beta1.ImageOrBuilder> + imageBuilder_; + /** + * + * + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + public boolean hasImage() { + return imageBuilder_ != null || image_ != null; + } + /** + * + * + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p4beta1.Image getImage() { + if (imageBuilder_ == null) { + return image_ == null + ? com.google.cloud.vision.v1p4beta1.Image.getDefaultInstance() + : image_; + } else { + return imageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + public Builder setImage(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Image image = 1; + */ + public Builder setImage(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Image image = 1; + */ + public Builder mergeImage(com.google.cloud.vision.v1p4beta1.Image value) { + if (imageBuilder_ == null) { + if (image_ != null) { + image_ = + com.google.cloud.vision.v1p4beta1.Image.newBuilder(image_) + .mergeFrom(value) + .buildPartial(); + } else { + image_ = value; + } + onChanged(); + } else { + imageBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p4beta1.Image.Builder getImageBuilder() { + + onChanged(); + return getImageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + public com.google.cloud.vision.v1p4beta1.ImageOrBuilder getImageOrBuilder() { + if (imageBuilder_ != null) { + return imageBuilder_.getMessageOrBuilder(); + } else { + return image_ == null + ? com.google.cloud.vision.v1p4beta1.Image.getDefaultInstance() + : image_; + } + } + /** + * + * + *
+     * The image to be processed.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Image, + com.google.cloud.vision.v1p4beta1.Image.Builder, + com.google.cloud.vision.v1p4beta1.ImageOrBuilder> + getImageFieldBuilder() { + if (imageBuilder_ == null) { + imageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Image, + com.google.cloud.vision.v1p4beta1.Image.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder> + featuresBuilder_; + + /** + * + * + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public int getFeaturesCount() { + if (featuresBuilder_ == null) { + return features_.size(); + } else { + return featuresBuilder_.getCount(); + } + } + /** + * + * + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index) { + if (featuresBuilder_ == null) { + return features_.get(index); + } else { + return featuresBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public Builder setFeatures(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder setFeatures( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder getFeaturesBuilder(int index) { + return getFeaturesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index) { + if (featuresBuilder_ == null) { + return features_.get(index); + } else { + return featuresBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder addFeaturesBuilder() { + return getFeaturesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Feature.getDefaultInstance()); + } + /** + * + * + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder addFeaturesBuilder(int index) { + return getFeaturesFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Feature.getDefaultInstance()); + } + /** + * + * + *
+     * Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List + getFeaturesBuilderList() { + return getFeaturesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder> + getFeaturesFieldBuilder() { + if (featuresBuilder_ == null) { + featuresBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder>( + features_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + features_ = null; + } + return featuresBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.ImageContext imageContext_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder> + imageContextBuilder_; + /** + * + * + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public boolean hasImageContext() { + return imageContextBuilder_ != null || imageContext_ != null; + } + /** + * + * + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext getImageContext() { + if (imageContextBuilder_ == null) { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } else { + return imageContextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public Builder setImageContext(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public Builder setImageContext( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public Builder mergeImageContext(com.google.cloud.vision.v1p4beta1.ImageContext value) { + if (imageContextBuilder_ == null) { + if (imageContext_ != null) { + imageContext_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext.Builder getImageContextBuilder() { + + onChanged(); + return getImageContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder() { + if (imageContextBuilder_ != null) { + return imageContextBuilder_.getMessageOrBuilder(); + } else { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } + } + /** + * + * + *
+     * Additional context that may accompany the image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder> + getImageContextFieldBuilder() { + if (imageContextBuilder_ == null) { + imageContextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder>( + getImageContext(), getParentForChildren(), isClean()); + imageContext_ = null; + } + return imageContextBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AnnotateImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AnnotateImageRequest) + private static final com.google.cloud.vision.v1p4beta1.AnnotateImageRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AnnotateImageRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateImageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageRequestOrBuilder.java new file mode 100644 index 000000000000..23ef5dc97710 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageRequestOrBuilder.java @@ -0,0 +1,124 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AnnotateImageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AnnotateImageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + boolean hasImage(); + /** + * + * + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + com.google.cloud.vision.v1p4beta1.Image getImage(); + /** + * + * + *
+   * The image to be processed.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Image image = 1; + */ + com.google.cloud.vision.v1p4beta1.ImageOrBuilder getImageOrBuilder(); + + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + java.util.List getFeaturesList(); + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index); + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + int getFeaturesCount(); + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + java.util.List + getFeaturesOrBuilderList(); + /** + * + * + *
+   * Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index); + + /** + * + * + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + boolean hasImageContext(); + /** + * + * + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p4beta1.ImageContext getImageContext(); + /** + * + * + *
+   * Additional context that may accompany the image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageResponse.java new file mode 100644 index 000000000000..364ff420f825 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageResponse.java @@ -0,0 +1,5775 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Response to an image annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AnnotateImageResponse} + */ +public final class AnnotateImageResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + faceAnnotations_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + faceAnnotations_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation.parser(), + extensionRegistry)); + break; + } + case 50: + { + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.Builder subBuilder = null; + if (safeSearchAnnotation_ != null) { + subBuilder = safeSearchAnnotation_.toBuilder(); + } + safeSearchAnnotation_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(safeSearchAnnotation_); + safeSearchAnnotation_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.cloud.vision.v1p4beta1.ImageProperties.Builder subBuilder = null; + if (imagePropertiesAnnotation_ != null) { + subBuilder = imagePropertiesAnnotation_.toBuilder(); + } + imagePropertiesAnnotation_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsAnnotation.Builder subBuilder = null; + if (cropHintsAnnotation_ != null) { + subBuilder = cropHintsAnnotation_.toBuilder(); + } + cropHintsAnnotation_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cropHintsAnnotation_); + cropHintsAnnotation_ = subBuilder.buildPartial(); + } + + break; + } + case 98: + { + com.google.cloud.vision.v1p4beta1.TextAnnotation.Builder subBuilder = null; + if (fullTextAnnotation_ != null) { + subBuilder = fullTextAnnotation_.toBuilder(); + } + fullTextAnnotation_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.TextAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fullTextAnnotation_); + fullTextAnnotation_ = subBuilder.buildPartial(); + } + + break; + } + case 106: + { + com.google.cloud.vision.v1p4beta1.WebDetection.Builder subBuilder = null; + if (webDetection_ != null) { + subBuilder = webDetection_.toBuilder(); + } + webDetection_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(webDetection_); + webDetection_ = subBuilder.buildPartial(); + } + + break; + } + case 114: + { + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Builder subBuilder = null; + if (productSearchResults_ != null) { + subBuilder = productSearchResults_.toBuilder(); + } + productSearchResults_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productSearchResults_); + productSearchResults_ = subBuilder.buildPartial(); + } + + break; + } + case 170: + { + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.Builder subBuilder = null; + if (context_ != null) { + subBuilder = context_.toBuilder(); + } + context_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation>(); + mutable_bitField0_ |= 0x00000010; + } + localizedObjectAnnotations_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public java.util.List getFaceAnnotationsList() { + return faceAnnotations_; + } + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public java.util.List + getFaceAnnotationsOrBuilderList() { + return faceAnnotations_; + } + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public int getFaceAnnotationsCount() { + return faceAnnotations_.size(); + } + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation getFaceAnnotations(int index) { + return faceAnnotations_.get(index); + } + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + public java.util.List + getLandmarkAnnotationsList() { + return landmarkAnnotations_; + } + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + public java.util.List + getLandmarkAnnotationsOrBuilderList() { + return landmarkAnnotations_; + } + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + public int getLandmarkAnnotationsCount() { + return landmarkAnnotations_.size(); + } + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation getLandmarkAnnotations(int index) { + return landmarkAnnotations_.get(index); + } + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public java.util.List + getLogoAnnotationsList() { + return logoAnnotations_; + } + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public java.util.List + getLogoAnnotationsOrBuilderList() { + return logoAnnotations_; + } + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public int getLogoAnnotationsCount() { + return logoAnnotations_.size(); + } + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation getLogoAnnotations(int index) { + return logoAnnotations_.get(index); + } + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public java.util.List + getLabelAnnotationsList() { + return labelAnnotations_; + } + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public java.util.List + getLabelAnnotationsOrBuilderList() { + return labelAnnotations_; + } + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public int getLabelAnnotationsCount() { + return labelAnnotations_.size(); + } + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation getLabelAnnotations(int index) { + return labelAnnotations_.get(index); + } + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotationOrBuilder> + getLocalizedObjectAnnotationsOrBuilderList() { + return localizedObjectAnnotations_; + } + /** + * + * + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public java.util.List + getTextAnnotationsList() { + return textAnnotations_; + } + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public java.util.List + getTextAnnotationsOrBuilderList() { + return textAnnotations_; + } + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public int getTextAnnotationsCount() { + return textAnnotations_.size(); + } + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation getTextAnnotations(int index) { + return textAnnotations_.get(index); + } + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder getTextAnnotationsOrBuilder( + int index) { + return textAnnotations_.get(index); + } + + public static final int FULL_TEXT_ANNOTATION_FIELD_NUMBER = 12; + private com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation getFullTextAnnotation() { + return fullTextAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotationOrBuilder + getFullTextAnnotationOrBuilder() { + return getFullTextAnnotation(); + } + + public static final int SAFE_SEARCH_ANNOTATION_FIELD_NUMBER = 6; + private com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation safeSearchAnnotation_; + /** + * + * + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public boolean hasSafeSearchAnnotation() { + return safeSearchAnnotation_ != null; + } + /** + * + * + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation getSafeSearchAnnotation() { + return safeSearchAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.getDefaultInstance() + : safeSearchAnnotation_; + } + /** + * + * + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotationOrBuilder + getSafeSearchAnnotationOrBuilder() { + return getSafeSearchAnnotation(); + } + + public static final int IMAGE_PROPERTIES_ANNOTATION_FIELD_NUMBER = 8; + private com.google.cloud.vision.v1p4beta1.ImageProperties imagePropertiesAnnotation_; + /** + * + * + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public boolean hasImagePropertiesAnnotation() { + return imagePropertiesAnnotation_ != null; + } + /** + * + * + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p4beta1.ImageProperties getImagePropertiesAnnotation() { + return imagePropertiesAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.ImageProperties.getDefaultInstance() + : imagePropertiesAnnotation_; + } + /** + * + * + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p4beta1.ImagePropertiesOrBuilder + getImagePropertiesAnnotationOrBuilder() { + return getImagePropertiesAnnotation(); + } + + public static final int CROP_HINTS_ANNOTATION_FIELD_NUMBER = 11; + private com.google.cloud.vision.v1p4beta1.CropHintsAnnotation cropHintsAnnotation_; + /** + * + * + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public boolean hasCropHintsAnnotation() { + return cropHintsAnnotation_ != null; + } + /** + * + * + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotation getCropHintsAnnotation() { + return cropHintsAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.getDefaultInstance() + : cropHintsAnnotation_; + } + /** + * + * + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotationOrBuilder + getCropHintsAnnotationOrBuilder() { + return getCropHintsAnnotation(); + } + + public static final int WEB_DETECTION_FIELD_NUMBER = 13; + private com.google.cloud.vision.v1p4beta1.WebDetection webDetection_; + /** + * + * + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + public boolean hasWebDetection() { + return webDetection_ != null; + } + /** + * + * + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p4beta1.WebDetection getWebDetection() { + return webDetection_ == null + ? com.google.cloud.vision.v1p4beta1.WebDetection.getDefaultInstance() + : webDetection_; + } + /** + * + * + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p4beta1.WebDetectionOrBuilder getWebDetectionOrBuilder() { + return getWebDetection(); + } + + public static final int PRODUCT_SEARCH_RESULTS_FIELD_NUMBER = 14; + private com.google.cloud.vision.v1p4beta1.ProductSearchResults productSearchResults_; + /** + * + * + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public boolean hasProductSearchResults() { + return productSearchResults_ != null; + } + /** + * + * + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults getProductSearchResults() { + return productSearchResults_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSearchResults.getDefaultInstance() + : productSearchResults_; + } + /** + * + * + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext context_; + /** + * + * + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContext getContext() { + return context_ == null + ? com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.getDefaultInstance() + : context_; + } + /** + * + * + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContextOrBuilder getContextOrBuilder() { + return getContext(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < 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); + } + + @java.lang.Override + 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.v1p4beta1.AnnotateImageResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response to an image annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AnnotateImageResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AnnotateImageResponse) + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.class, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse build() { + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AnnotateImageResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AnnotateImageResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.AnnotateImageResponse other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.FaceAnnotationOrBuilder> + faceAnnotationsBuilder_; + + /** + * + * + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public Builder setFaceAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public Builder setFaceAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addFaceAnnotations(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addFaceAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addFaceAnnotations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public Builder addFaceAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Builder getFaceAnnotationsBuilder( + int index) { + return getFaceAnnotationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Builder addFaceAnnotationsBuilder() { + return getFaceAnnotationsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.FaceAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Builder addFaceAnnotationsBuilder( + int index) { + return getFaceAnnotationsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.FaceAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, face detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + public java.util.List + getFaceAnnotationsBuilderList() { + return getFaceAnnotationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.FaceAnnotation, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.FaceAnnotationOrBuilder> + getFaceAnnotationsFieldBuilder() { + if (faceAnnotationsBuilder_ == null) { + faceAnnotationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.FaceAnnotation, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder> + landmarkAnnotationsBuilder_; + + /** + * + * + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public Builder setLandmarkAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public Builder setLandmarkAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public Builder addLandmarkAnnotations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public Builder addLandmarkAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public Builder addLandmarkAnnotations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public Builder addLandmarkAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder getLandmarkAnnotationsBuilder( + int index) { + return getLandmarkAnnotationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder + addLandmarkAnnotationsBuilder() { + return getLandmarkAnnotationsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder addLandmarkAnnotationsBuilder( + int index) { + return getLandmarkAnnotationsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, landmark detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + * + */ + public java.util.List + getLandmarkAnnotationsBuilderList() { + return getLandmarkAnnotationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder> + getLandmarkAnnotationsFieldBuilder() { + if (landmarkAnnotationsBuilder_ == null) { + landmarkAnnotationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder> + logoAnnotationsBuilder_; + + /** + * + * + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder setLogoAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder setLogoAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addLogoAnnotations(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addLogoAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addLogoAnnotations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public Builder addLogoAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder getLogoAnnotationsBuilder( + int index) { + return getLogoAnnotationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder addLogoAnnotationsBuilder() { + return getLogoAnnotationsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder addLogoAnnotationsBuilder( + int index) { + return getLogoAnnotationsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, logo detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + public java.util.List + getLogoAnnotationsBuilderList() { + return getLogoAnnotationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder> + getLogoAnnotationsFieldBuilder() { + if (logoAnnotationsBuilder_ == null) { + logoAnnotationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder> + labelAnnotationsBuilder_; + + /** + * + * + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public Builder setLabelAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public Builder setLabelAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addLabelAnnotations(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addLabelAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addLabelAnnotations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public Builder addLabelAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder getLabelAnnotationsBuilder( + int index) { + return getLabelAnnotationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder addLabelAnnotationsBuilder() { + return getLabelAnnotationsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder addLabelAnnotationsBuilder( + int index) { + return getLabelAnnotationsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, label detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + public java.util.List + getLabelAnnotationsBuilderList() { + return getLabelAnnotationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder> + getLabelAnnotationsFieldBuilder() { + if (labelAnnotationsBuilder_ == null) { + labelAnnotationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation, + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotationOrBuilder> + localizedObjectAnnotationsBuilder_; + + /** + * + * + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public Builder setLocalizedObjectAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public Builder setLocalizedObjectAnnotations( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public Builder addLocalizedObjectAnnotations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public Builder addLocalizedObjectAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public Builder addLocalizedObjectAnnotations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public Builder addLocalizedObjectAnnotations( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotationOrBuilder> + 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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.Builder + addLocalizedObjectAnnotationsBuilder() { + return getLocalizedObjectAnnotationsFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.Builder + addLocalizedObjectAnnotationsBuilder(int index) { + return getLocalizedObjectAnnotationsFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, localized object detection has completed successfully.
+     * This will be sorted descending by confidence score.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + public java.util.List + getLocalizedObjectAnnotationsBuilderList() { + return getLocalizedObjectAnnotationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation, + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotationOrBuilder> + getLocalizedObjectAnnotationsFieldBuilder() { + if (localizedObjectAnnotationsBuilder_ == null) { + localizedObjectAnnotationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation, + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder> + textAnnotationsBuilder_; + + /** + * + * + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public Builder setTextAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public Builder setTextAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addTextAnnotations(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addTextAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addTextAnnotations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public Builder addTextAnnotations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder getTextAnnotationsBuilder( + int index) { + return getTextAnnotationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder addTextAnnotationsBuilder() { + return getTextAnnotationsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder addTextAnnotationsBuilder( + int index) { + return getTextAnnotationsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance()); + } + /** + * + * + *
+     * If present, text (OCR) detection has completed successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + public java.util.List + getTextAnnotationsBuilderList() { + return getTextAnnotationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder> + getTextAnnotationsFieldBuilder() { + if (textAnnotationsBuilder_ == null) { + textAnnotationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.EntityAnnotation, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder>( + textAnnotations_, + ((bitField0_ & 0x00000020) == 0x00000020), + getParentForChildren(), + isClean()); + textAnnotations_ = null; + } + return textAnnotationsBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.TextAnnotation fullTextAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation, + com.google.cloud.vision.v1p4beta1.TextAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation getFullTextAnnotation() { + if (fullTextAnnotationBuilder_ == null) { + return fullTextAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + public Builder setFullTextAnnotation(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + public Builder setFullTextAnnotation( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + public Builder mergeFullTextAnnotation(com.google.cloud.vision.v1p4beta1.TextAnnotation value) { + if (fullTextAnnotationBuilder_ == null) { + if (fullTextAnnotation_ != null) { + fullTextAnnotation_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotationOrBuilder + getFullTextAnnotationOrBuilder() { + if (fullTextAnnotationBuilder_ != null) { + return fullTextAnnotationBuilder_.getMessageOrBuilder(); + } else { + return fullTextAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation, + com.google.cloud.vision.v1p4beta1.TextAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotationOrBuilder> + getFullTextAnnotationFieldBuilder() { + if (fullTextAnnotationBuilder_ == null) { + fullTextAnnotationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation, + com.google.cloud.vision.v1p4beta1.TextAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotationOrBuilder>( + getFullTextAnnotation(), getParentForChildren(), isClean()); + fullTextAnnotation_ = null; + } + return fullTextAnnotationBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation safeSearchAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation, + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotationOrBuilder> + safeSearchAnnotationBuilder_; + /** + * + * + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public boolean hasSafeSearchAnnotation() { + return safeSearchAnnotationBuilder_ != null || safeSearchAnnotation_ != null; + } + /** + * + * + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation getSafeSearchAnnotation() { + if (safeSearchAnnotationBuilder_ == null) { + return safeSearchAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.getDefaultInstance() + : safeSearchAnnotation_; + } else { + return safeSearchAnnotationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public Builder setSafeSearchAnnotation( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public Builder setSafeSearchAnnotation( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public Builder mergeSafeSearchAnnotation( + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation value) { + if (safeSearchAnnotationBuilder_ == null) { + if (safeSearchAnnotation_ != null) { + safeSearchAnnotation_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.Builder + getSafeSearchAnnotationBuilder() { + + onChanged(); + return getSafeSearchAnnotationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotationOrBuilder + getSafeSearchAnnotationOrBuilder() { + if (safeSearchAnnotationBuilder_ != null) { + return safeSearchAnnotationBuilder_.getMessageOrBuilder(); + } else { + return safeSearchAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.getDefaultInstance() + : safeSearchAnnotation_; + } + } + /** + * + * + *
+     * If present, safe-search annotation has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation, + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotationOrBuilder> + getSafeSearchAnnotationFieldBuilder() { + if (safeSearchAnnotationBuilder_ == null) { + safeSearchAnnotationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation, + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotationOrBuilder>( + getSafeSearchAnnotation(), getParentForChildren(), isClean()); + safeSearchAnnotation_ = null; + } + return safeSearchAnnotationBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.ImageProperties imagePropertiesAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageProperties, + com.google.cloud.vision.v1p4beta1.ImageProperties.Builder, + com.google.cloud.vision.v1p4beta1.ImagePropertiesOrBuilder> + imagePropertiesAnnotationBuilder_; + /** + * + * + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public boolean hasImagePropertiesAnnotation() { + return imagePropertiesAnnotationBuilder_ != null || imagePropertiesAnnotation_ != null; + } + /** + * + * + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p4beta1.ImageProperties getImagePropertiesAnnotation() { + if (imagePropertiesAnnotationBuilder_ == null) { + return imagePropertiesAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.ImageProperties.getDefaultInstance() + : imagePropertiesAnnotation_; + } else { + return imagePropertiesAnnotationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public Builder setImagePropertiesAnnotation( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public Builder setImagePropertiesAnnotation( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public Builder mergeImagePropertiesAnnotation( + com.google.cloud.vision.v1p4beta1.ImageProperties value) { + if (imagePropertiesAnnotationBuilder_ == null) { + if (imagePropertiesAnnotation_ != null) { + imagePropertiesAnnotation_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p4beta1.ImageProperties.Builder + getImagePropertiesAnnotationBuilder() { + + onChanged(); + return getImagePropertiesAnnotationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + public com.google.cloud.vision.v1p4beta1.ImagePropertiesOrBuilder + getImagePropertiesAnnotationOrBuilder() { + if (imagePropertiesAnnotationBuilder_ != null) { + return imagePropertiesAnnotationBuilder_.getMessageOrBuilder(); + } else { + return imagePropertiesAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.ImageProperties.getDefaultInstance() + : imagePropertiesAnnotation_; + } + } + /** + * + * + *
+     * If present, image properties were extracted successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageProperties, + com.google.cloud.vision.v1p4beta1.ImageProperties.Builder, + com.google.cloud.vision.v1p4beta1.ImagePropertiesOrBuilder> + getImagePropertiesAnnotationFieldBuilder() { + if (imagePropertiesAnnotationBuilder_ == null) { + imagePropertiesAnnotationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageProperties, + com.google.cloud.vision.v1p4beta1.ImageProperties.Builder, + com.google.cloud.vision.v1p4beta1.ImagePropertiesOrBuilder>( + getImagePropertiesAnnotation(), getParentForChildren(), isClean()); + imagePropertiesAnnotation_ = null; + } + return imagePropertiesAnnotationBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.CropHintsAnnotation cropHintsAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation, + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.CropHintsAnnotationOrBuilder> + cropHintsAnnotationBuilder_; + /** + * + * + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public boolean hasCropHintsAnnotation() { + return cropHintsAnnotationBuilder_ != null || cropHintsAnnotation_ != null; + } + /** + * + * + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotation getCropHintsAnnotation() { + if (cropHintsAnnotationBuilder_ == null) { + return cropHintsAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.getDefaultInstance() + : cropHintsAnnotation_; + } else { + return cropHintsAnnotationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public Builder setCropHintsAnnotation( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public Builder setCropHintsAnnotation( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public Builder mergeCropHintsAnnotation( + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation value) { + if (cropHintsAnnotationBuilder_ == null) { + if (cropHintsAnnotation_ != null) { + cropHintsAnnotation_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.Builder + getCropHintsAnnotationBuilder() { + + onChanged(); + return getCropHintsAnnotationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotationOrBuilder + getCropHintsAnnotationOrBuilder() { + if (cropHintsAnnotationBuilder_ != null) { + return cropHintsAnnotationBuilder_.getMessageOrBuilder(); + } else { + return cropHintsAnnotation_ == null + ? com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.getDefaultInstance() + : cropHintsAnnotation_; + } + } + /** + * + * + *
+     * If present, crop hints have completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation, + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.CropHintsAnnotationOrBuilder> + getCropHintsAnnotationFieldBuilder() { + if (cropHintsAnnotationBuilder_ == null) { + cropHintsAnnotationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation, + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.CropHintsAnnotationOrBuilder>( + getCropHintsAnnotation(), getParentForChildren(), isClean()); + cropHintsAnnotation_ = null; + } + return cropHintsAnnotationBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.WebDetection webDetection_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection, + com.google.cloud.vision.v1p4beta1.WebDetection.Builder, + com.google.cloud.vision.v1p4beta1.WebDetectionOrBuilder> + webDetectionBuilder_; + /** + * + * + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + public boolean hasWebDetection() { + return webDetectionBuilder_ != null || webDetection_ != null; + } + /** + * + * + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p4beta1.WebDetection getWebDetection() { + if (webDetectionBuilder_ == null) { + return webDetection_ == null + ? com.google.cloud.vision.v1p4beta1.WebDetection.getDefaultInstance() + : webDetection_; + } else { + return webDetectionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + public Builder setWebDetection(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection web_detection = 13; + */ + public Builder setWebDetection( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection web_detection = 13; + */ + public Builder mergeWebDetection(com.google.cloud.vision.v1p4beta1.WebDetection value) { + if (webDetectionBuilder_ == null) { + if (webDetection_ != null) { + webDetection_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.Builder getWebDetectionBuilder() { + + onChanged(); + return getWebDetectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + public com.google.cloud.vision.v1p4beta1.WebDetectionOrBuilder getWebDetectionOrBuilder() { + if (webDetectionBuilder_ != null) { + return webDetectionBuilder_.getMessageOrBuilder(); + } else { + return webDetection_ == null + ? com.google.cloud.vision.v1p4beta1.WebDetection.getDefaultInstance() + : webDetection_; + } + } + /** + * + * + *
+     * If present, web detection has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection, + com.google.cloud.vision.v1p4beta1.WebDetection.Builder, + com.google.cloud.vision.v1p4beta1.WebDetectionOrBuilder> + getWebDetectionFieldBuilder() { + if (webDetectionBuilder_ == null) { + webDetectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection, + com.google.cloud.vision.v1p4beta1.WebDetection.Builder, + com.google.cloud.vision.v1p4beta1.WebDetectionOrBuilder>( + getWebDetection(), getParentForChildren(), isClean()); + webDetection_ = null; + } + return webDetectionBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.ProductSearchResults productSearchResults_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResultsOrBuilder> + productSearchResultsBuilder_; + /** + * + * + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public boolean hasProductSearchResults() { + return productSearchResultsBuilder_ != null || productSearchResults_ != null; + } + /** + * + * + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults getProductSearchResults() { + if (productSearchResultsBuilder_ == null) { + return productSearchResults_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSearchResults.getDefaultInstance() + : productSearchResults_; + } else { + return productSearchResultsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public Builder setProductSearchResults( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public Builder setProductSearchResults( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public Builder mergeProductSearchResults( + com.google.cloud.vision.v1p4beta1.ProductSearchResults value) { + if (productSearchResultsBuilder_ == null) { + if (productSearchResults_ != null) { + productSearchResults_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Builder + getProductSearchResultsBuilder() { + + onChanged(); + return getProductSearchResultsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResultsOrBuilder + getProductSearchResultsOrBuilder() { + if (productSearchResultsBuilder_ != null) { + return productSearchResultsBuilder_.getMessageOrBuilder(); + } else { + return productSearchResults_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSearchResults.getDefaultInstance() + : productSearchResults_; + } + } + /** + * + * + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResultsOrBuilder> + getProductSearchResultsFieldBuilder() { + if (productSearchResultsBuilder_ == null) { + productSearchResultsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext context_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext, + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageAnnotationContextOrBuilder> + contextBuilder_; + /** + * + * + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContext getContext() { + if (contextBuilder_ == null) { + return context_ == null + ? com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.getDefaultInstance() + : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageAnnotationContext context = 21; + */ + public Builder setContext(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext context = 21; + */ + public Builder setContext( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext context = 21; + */ + public Builder mergeContext(com.google.cloud.vision.v1p4beta1.ImageAnnotationContext value) { + if (contextBuilder_ == null) { + if (context_ != null) { + context_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.Builder getContextBuilder() { + + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageAnnotationContext context = 21; + */ + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContextOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null + ? com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.getDefaultInstance() + : context_; + } + } + /** + * + * + *
+     * If present, contextual information is needed to understand where this image
+     * comes from.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageAnnotationContext context = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext, + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageAnnotationContextOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext, + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageAnnotationContextOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AnnotateImageResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AnnotateImageResponse) + private static final com.google.cloud.vision.v1p4beta1.AnnotateImageResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AnnotateImageResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.AnnotateImageResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageResponseOrBuilder.java new file mode 100644 index 000000000000..bd8d1978626e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AnnotateImageResponseOrBuilder.java @@ -0,0 +1,613 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AnnotateImageResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AnnotateImageResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + java.util.List getFaceAnnotationsList(); + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + com.google.cloud.vision.v1p4beta1.FaceAnnotation getFaceAnnotations(int index); + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + int getFaceAnnotationsCount(); + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + java.util.List + getFaceAnnotationsOrBuilderList(); + /** + * + * + *
+   * If present, face detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation face_annotations = 1; + */ + com.google.cloud.vision.v1p4beta1.FaceAnnotationOrBuilder getFaceAnnotationsOrBuilder(int index); + + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + java.util.List getLandmarkAnnotationsList(); + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + com.google.cloud.vision.v1p4beta1.EntityAnnotation getLandmarkAnnotations(int index); + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + int getLandmarkAnnotationsCount(); + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + java.util.List + getLandmarkAnnotationsOrBuilderList(); + /** + * + * + *
+   * If present, landmark detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation landmark_annotations = 2; + */ + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder getLandmarkAnnotationsOrBuilder( + int index); + + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + java.util.List getLogoAnnotationsList(); + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + com.google.cloud.vision.v1p4beta1.EntityAnnotation getLogoAnnotations(int index); + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + int getLogoAnnotationsCount(); + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + java.util.List + getLogoAnnotationsOrBuilderList(); + /** + * + * + *
+   * If present, logo detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation logo_annotations = 3; + */ + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder getLogoAnnotationsOrBuilder( + int index); + + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + java.util.List getLabelAnnotationsList(); + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + com.google.cloud.vision.v1p4beta1.EntityAnnotation getLabelAnnotations(int index); + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + int getLabelAnnotationsCount(); + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + java.util.List + getLabelAnnotationsOrBuilderList(); + /** + * + * + *
+   * If present, label detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation label_annotations = 4; + */ + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder getLabelAnnotationsOrBuilder( + int index); + + /** + * + * + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation getLocalizedObjectAnnotations( + int index); + /** + * + * + *
+   * If present, localized object detection has completed successfully.
+   * This will be sorted descending by confidence score.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation localized_object_annotations = 22; + * + */ + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotationOrBuilder + getLocalizedObjectAnnotationsOrBuilder(int index); + + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + java.util.List getTextAnnotationsList(); + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + com.google.cloud.vision.v1p4beta1.EntityAnnotation getTextAnnotations(int index); + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + int getTextAnnotationsCount(); + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + java.util.List + getTextAnnotationsOrBuilderList(); + /** + * + * + *
+   * If present, text (OCR) detection has completed successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.EntityAnnotation text_annotations = 5; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation full_text_annotation = 12; + */ + com.google.cloud.vision.v1p4beta1.TextAnnotationOrBuilder getFullTextAnnotationOrBuilder(); + + /** + * + * + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + boolean hasSafeSearchAnnotation(); + /** + * + * + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation getSafeSearchAnnotation(); + /** + * + * + *
+   * If present, safe-search annotation has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.SafeSearchAnnotation safe_search_annotation = 6; + */ + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotationOrBuilder + getSafeSearchAnnotationOrBuilder(); + + /** + * + * + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + boolean hasImagePropertiesAnnotation(); + /** + * + * + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + com.google.cloud.vision.v1p4beta1.ImageProperties getImagePropertiesAnnotation(); + /** + * + * + *
+   * If present, image properties were extracted successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageProperties image_properties_annotation = 8; + */ + com.google.cloud.vision.v1p4beta1.ImagePropertiesOrBuilder + getImagePropertiesAnnotationOrBuilder(); + + /** + * + * + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + boolean hasCropHintsAnnotation(); + /** + * + * + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation getCropHintsAnnotation(); + /** + * + * + *
+   * If present, crop hints have completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsAnnotation crop_hints_annotation = 11; + */ + com.google.cloud.vision.v1p4beta1.CropHintsAnnotationOrBuilder getCropHintsAnnotationOrBuilder(); + + /** + * + * + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + boolean hasWebDetection(); + /** + * + * + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + com.google.cloud.vision.v1p4beta1.WebDetection getWebDetection(); + /** + * + * + *
+   * If present, web detection has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetection web_detection = 13; + */ + com.google.cloud.vision.v1p4beta1.WebDetectionOrBuilder getWebDetectionOrBuilder(); + + /** + * + * + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + boolean hasProductSearchResults(); + /** + * + * + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + com.google.cloud.vision.v1p4beta1.ProductSearchResults getProductSearchResults(); + /** + * + * + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchResults product_search_results = 14; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext context = 21; + */ + boolean hasContext(); + /** + * + * + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageAnnotationContext context = 21; + */ + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext getContext(); + /** + * + * + *
+   * If present, contextual information is needed to understand where this image
+   * comes from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageAnnotationContext context = 21; + */ + com.google.cloud.vision.v1p4beta1.ImageAnnotationContextOrBuilder getContextOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileRequest.java new file mode 100644 index 000000000000..51e52d97d2cc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileRequest.java @@ -0,0 +1,1732 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * An offline file annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest} + */ +public final class AsyncAnnotateFileRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature.parser(), extensionRegistry)); + break; + } + case 26: + { + com.google.cloud.vision.v1p4beta1.ImageContext.Builder subBuilder = null; + if (imageContext_ != null) { + subBuilder = imageContext_.toBuilder(); + } + imageContext_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ImageContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(imageContext_); + imageContext_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.class, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.Builder.class); + } + + private int bitField0_; + public static final int INPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.InputConfig inputConfig_; + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int FEATURES_FIELD_NUMBER = 2; + private java.util.List features_; + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + return features_; + } + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List + getFeaturesOrBuilderList() { + return features_; + } + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public int getFeaturesCount() { + return features_.size(); + } + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index) { + return features_.get(index); + } + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index) { + return features_.get(index); + } + + public static final int IMAGE_CONTEXT_FIELD_NUMBER = 3; + private com.google.cloud.vision.v1p4beta1.ImageContext imageContext_; + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public boolean hasImageContext() { + return imageContext_ != null; + } + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext getImageContext() { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder() { + return getImageContext(); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.vision.v1p4beta1.OutputConfig outputConfig_; + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputConfig()); + } + 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.v1p4beta1.AsyncAnnotateFileRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An offline file annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.class, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest build() { + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.InputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public Builder mergeInputConfig(com.google.cloud.vision.v1p4beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. Information about the input file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.InputConfig, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder> + featuresBuilder_; + + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public int getFeaturesCount() { + if (featuresBuilder_ == null) { + return features_.size(); + } else { + return featuresBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index) { + if (featuresBuilder_ == null) { + return features_.get(index); + } else { + return featuresBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public Builder setFeatures(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder setFeatures( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public Builder addFeatures( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder getFeaturesBuilder(int index) { + return getFeaturesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index) { + if (featuresBuilder_ == null) { + return features_.get(index); + } else { + return featuresBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder addFeaturesBuilder() { + return getFeaturesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Feature.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Builder addFeaturesBuilder(int index) { + return getFeaturesFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Feature.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Requested features.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + public java.util.List + getFeaturesBuilderList() { + return getFeaturesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder> + getFeaturesFieldBuilder() { + if (featuresBuilder_ == null) { + featuresBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Feature, + com.google.cloud.vision.v1p4beta1.Feature.Builder, + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder>( + features_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + features_ = null; + } + return featuresBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.ImageContext imageContext_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder> + imageContextBuilder_; + /** + * + * + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext getImageContext() { + if (imageContextBuilder_ == null) { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } else { + return imageContextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public Builder setImageContext(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public Builder setImageContext( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public Builder mergeImageContext(com.google.cloud.vision.v1p4beta1.ImageContext value) { + if (imageContextBuilder_ == null) { + if (imageContext_ != null) { + imageContext_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContext.Builder getImageContextBuilder() { + + onChanged(); + return getImageContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + public com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder() { + if (imageContextBuilder_ != null) { + return imageContextBuilder_.getMessageOrBuilder(); + } else { + return imageContext_ == null + ? com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance() + : imageContext_; + } + } + /** + * + * + *
+     * Additional context that may accompany the image(s) in the file.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder> + getImageContextFieldBuilder() { + if (imageContextBuilder_ == null) { + imageContextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageContext, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder, + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder>( + getImageContext(), getParentForChildren(), isClean()); + imageContext_ = null; + } + return imageContextBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.OutputConfig outputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + public Builder setOutputConfig(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 4; + */ + public Builder setOutputConfig( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 4; + */ + public Builder mergeOutputConfig(com.google.cloud.vision.v1p4beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) + private static final com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileRequestOrBuilder.java new file mode 100644 index 000000000000..61e609cdd48b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileRequestOrBuilder.java @@ -0,0 +1,155 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AsyncAnnotateFileRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p4beta1.InputConfig getInputConfig(); + /** + * + * + *
+   * Required. Information about the input file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.InputConfig input_config = 1; + */ + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + java.util.List getFeaturesList(); + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p4beta1.Feature getFeatures(int index); + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + int getFeaturesCount(); + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + java.util.List + getFeaturesOrBuilderList(); + /** + * + * + *
+   * Required. Requested features.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Feature features = 2; + */ + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder getFeaturesOrBuilder(int index); + + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + boolean hasImageContext(); + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p4beta1.ImageContext getImageContext(); + /** + * + * + *
+   * Additional context that may accompany the image(s) in the file.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImageContext image_context = 3; + */ + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder getImageContextOrBuilder(); + + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig(); + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 4; + */ + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileResponse.java new file mode 100644 index 000000000000..2952a8a573e0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileResponse.java @@ -0,0 +1,705 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * The response for a single offline file annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse} + */ +public final class AsyncAnnotateFileResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.class, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.Builder.class); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.OutputConfig outputConfig_; + /** + * + * + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (outputConfig_ != null) { + output.writeMessage(1, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.AsyncAnnotateFileResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for a single offline file annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.class, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse build() { + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse result = + new com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse(this); + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse other) { + if (other == com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.getDefaultInstance()) + return this; + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.OutputConfig outputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public Builder setOutputConfig(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 1; + */ + public Builder setOutputConfig( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 1; + */ + public Builder mergeOutputConfig(com.google.cloud.vision.v1p4beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * The output location and metadata from AsyncAnnotateFileRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) + private static final com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileResponseOrBuilder.java new file mode 100644 index 000000000000..c464df432ec0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncAnnotateFileResponseOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AsyncAnnotateFileResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig(); + /** + * + * + *
+   * The output location and metadata from AsyncAnnotateFileRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesRequest.java new file mode 100644 index 000000000000..ec7e1435b289 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesRequest.java @@ -0,0 +1,960 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Multiple async file annotation requests are batched into a single service
+ * call.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest} + */ +public final class AsyncBatchAnnotateFilesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest>(); + mutable_bitField0_ |= 0x00000001; + } + requests_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List + getRequestsList() { + return requests_; + } + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestOrBuilder> + getRequestsOrBuilderList() { + return requests_; + } + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public int getRequestsCount() { + return requests_.size(); + } + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest getRequests(int index) { + return requests_.get(index); + } + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(1, requests_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.AsyncBatchAnnotateFilesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Multiple async file annotation requests are batched into a single service
+   * call.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest) + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.class, + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + requestsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest build() { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.Builder, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestOrBuilder> + requestsBuilder_; + + /** + * + * + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder setRequests( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addRequests(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addRequests( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public Builder addRequests( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestOrBuilder> + 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.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Individual async file annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.Builder, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.Builder, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestOrBuilder>( + requests_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest) + private static final com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesRequestOrBuilder.java new file mode 100644 index 000000000000..d23d76085a16 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesRequestOrBuilder.java @@ -0,0 +1,63 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AsyncBatchAnnotateFilesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + java.util.List getRequestsList(); + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest getRequests(int index); + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + int getRequestsCount(); + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + java.util.List + getRequestsOrBuilderList(); + /** + * + * + *
+   * Individual async file annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest requests = 1; + */ + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestOrBuilder getRequestsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesResponse.java new file mode 100644 index 000000000000..9562b72ad22c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesResponse.java @@ -0,0 +1,984 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Response to an async batch file annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse} + */ +public final class AsyncBatchAnnotateFilesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse>(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponseOrBuilder> + getResponsesOrBuilderList() { + return responses_; + } + /** + * + * + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse getResponses(int index) { + return responses_.get(index); + } + /** + * + * + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.AsyncBatchAnnotateFilesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response to an async batch file annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse) + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.class, + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse build() { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.Builder, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder setResponses( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addResponses(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addResponses( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public Builder addResponses( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponseOrBuilder> + 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.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.Builder + addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.getDefaultInstance()); + } + /** + * + * + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.getDefaultInstance()); + } + /** + * + * + *
+     * The list of file annotation responses, one for each request in
+     * AsyncBatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.Builder, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.Builder, + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse) + private static final com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesResponseOrBuilder.java new file mode 100644 index 000000000000..c07c0b26a0c6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateFilesResponseOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AsyncBatchAnnotateFilesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + java.util.List getResponsesList(); + /** + * + * + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse getResponses(int index); + /** + * + * + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + int getResponsesCount(); + /** + * + * + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + /** + * + * + *
+   * The list of file annotation responses, one for each request in
+   * AsyncBatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse responses = 1; + */ + com.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponseOrBuilder getResponsesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesRequest.java new file mode 100644 index 000000000000..72c14fff7beb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesRequest.java @@ -0,0 +1,1223 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request for async image annotation for a list of images.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest} + */ +public final class AsyncBatchAnnotateImagesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) + AsyncBatchAnnotateImagesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AsyncBatchAnnotateImagesRequest.newBuilder() to construct. + private AsyncBatchAnnotateImagesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AsyncBatchAnnotateImagesRequest() { + requests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AsyncBatchAnnotateImagesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest>(); + mutable_bitField0_ |= 0x00000001; + } + requests_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.parser(), + extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.class, + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.Builder.class); + } + + private int bitField0_; + public static final int REQUESTS_FIELD_NUMBER = 1; + private java.util.List requests_; + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List getRequestsList() { + return requests_; + } + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public int getRequestsCount() { + return requests_.size(); + } + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest getRequests(int index) { + return requests_.get(index); + } + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p4beta1.OutputConfig outputConfig_; + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(1, requests_.get(i)); + } + if (outputConfig_ != null) { + output.writeMessage(2, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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)); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.v1p4beta1.AsyncBatchAnnotateImagesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest other = + (com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) obj; + + boolean result = true; + result = result && getRequestsList().equals(other.getRequestsList()); + 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 (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().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.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + 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.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + com.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.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + java.io.InputStream 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.v1p4beta1.AsyncBatchAnnotateImagesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + parseDelimitedFrom( + java.io.InputStream 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.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for async image annotation for a list of images.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.class, + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + requestsBuilder_.clear(); + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest build() { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest result = + new com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.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_); + } + } + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) + 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.v1p4beta1.AnnotateImageRequest, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder> + requestsBuilder_; + + /** + * + * + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder>( + requests_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.OutputConfig outputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + public Builder setOutputConfig(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 2; + */ + public Builder setOutputConfig( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 2; + */ + public Builder mergeOutputConfig(com.google.cloud.vision.v1p4beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig output_config = 2; + */ + 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.v1p4beta1.OutputConfig output_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. The desired output location and metadata (e.g. format).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) + private static final com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AsyncBatchAnnotateImagesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsyncBatchAnnotateImagesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesRequestOrBuilder.java new file mode 100644 index 000000000000..4ad04a259689 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesRequestOrBuilder.java @@ -0,0 +1,93 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AsyncBatchAnnotateImagesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + java.util.List getRequestsList(); + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest getRequests(int index); + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + int getRequestsCount(); + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + java.util.List + getRequestsOrBuilderList(); + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder getRequestsOrBuilder(int index); + + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig(); + /** + * + * + *
+   * Required. The desired output location and metadata (e.g. format).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 2; + */ + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesResponse.java new file mode 100644 index 000000000000..5e39d836715a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesResponse.java @@ -0,0 +1,717 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Response to an async batch image annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse} + */ +public final class AsyncBatchAnnotateImagesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) + AsyncBatchAnnotateImagesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AsyncBatchAnnotateImagesResponse.newBuilder() to construct. + private AsyncBatchAnnotateImagesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AsyncBatchAnnotateImagesResponse() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AsyncBatchAnnotateImagesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.class, + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.Builder.class); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.OutputConfig outputConfig_; + /** + * + * + *
+   * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (outputConfig_ != null) { + output.writeMessage(1, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.AsyncBatchAnnotateImagesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse other = + (com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) 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.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + 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.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + com.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.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + java.io.InputStream 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.v1p4beta1.AsyncBatchAnnotateImagesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + parseDelimitedFrom( + java.io.InputStream 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.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response to an async batch image annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.class, + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse build() { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse result = + new com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse(this); + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) { + return mergeFrom( + (com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse other) { + if (other + == com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + .getDefaultInstance()) return this; + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.OutputConfig outputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public Builder setOutputConfig(com.google.cloud.vision.v1p4beta1.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 AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public Builder setOutputConfig( + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public Builder mergeOutputConfig(com.google.cloud.vision.v1p4beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.vision.v1p4beta1.OutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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 AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + public com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.OutputConfig, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder, + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) + private static final com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AsyncBatchAnnotateImagesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsyncBatchAnnotateImagesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesResponseOrBuilder.java new file mode 100644 index 000000000000..1f5ee9e8b4cc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/AsyncBatchAnnotateImagesResponseOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface AsyncBatchAnnotateImagesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + com.google.cloud.vision.v1p4beta1.OutputConfig getOutputConfig(); + /** + * + * + *
+   * The output location and metadata from AsyncBatchAnnotateImagesRequest.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OutputConfig output_config = 1; + */ + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesRequest.java new file mode 100644 index 000000000000..ce8fbd1655d1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesRequest.java @@ -0,0 +1,965 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A list of requests to annotate files using the BatchAnnotateFiles API.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest} + */ +public final class BatchAnnotateFilesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) + BatchAnnotateFilesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchAnnotateFilesRequest.newBuilder() to construct. + private BatchAnnotateFilesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchAnnotateFilesRequest() { + requests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchAnnotateFilesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest>(); + mutable_bitField0_ |= 0x00000001; + } + requests_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.class, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.Builder.class); + } + + public static final int REQUESTS_FIELD_NUMBER = 1; + private java.util.List requests_; + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public java.util.List getRequestsList() { + return requests_; + } + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public int getRequestsCount() { + return requests_.size(); + } + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest getRequests(int index) { + return requests_.get(index); + } + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(1, requests_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.BatchAnnotateFilesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest other = + (com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) 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.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + 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.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + com.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.v1p4beta1.BatchAnnotateFilesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + java.io.InputStream 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.v1p4beta1.BatchAnnotateFilesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest parseDelimitedFrom( + java.io.InputStream 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.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A list of requests to annotate files using the BatchAnnotateFiles API.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.class, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + requestsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest build() { + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest result = + new com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest(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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) 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.v1p4beta1.AnnotateFileRequest, + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateFileRequestOrBuilder> + requestsBuilder_; + + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public java.util.List getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p4beta1.AnnotateFileRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public Builder addRequests(com.google.cloud.vision.v1p4beta1.AnnotateFileRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p4beta1.AnnotateFileRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public Builder addRequests( + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest 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; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequestOrBuilder getRequestsOrBuilder( + int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public java.util.List + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.getDefaultInstance()); + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.getDefaultInstance()); + } + /** + * + * + *
+     * The list of file annotation requests. Right now we support only one
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest, + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateFileRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest, + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateFileRequestOrBuilder>( + requests_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) + private static final com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchAnnotateFilesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchAnnotateFilesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesRequestOrBuilder.java new file mode 100644 index 000000000000..fc18ce66d76d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesRequestOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface BatchAnnotateFilesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + java.util.List getRequestsList(); + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateFileRequest getRequests(int index); + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + int getRequestsCount(); + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + java.util.List + getRequestsOrBuilderList(); + /** + * + * + *
+   * The list of file annotation requests. Right now we support only one
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileRequest requests = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateFileRequestOrBuilder getRequestsOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesResponse.java new file mode 100644 index 000000000000..cecc8b9a4ad6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesResponse.java @@ -0,0 +1,969 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A list of file annotation responses.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse} + */ +public final class BatchAnnotateFilesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) + BatchAnnotateFilesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchAnnotateFilesResponse.newBuilder() to construct. + private BatchAnnotateFilesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchAnnotateFilesResponse() { + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchAnnotateFilesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse>(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.class, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.Builder.class); + } + + public static final int RESPONSES_FIELD_NUMBER = 1; + private java.util.List responses_; + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public java.util.List getResponsesList() { + return responses_; + } + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public int getResponsesCount() { + return responses_.size(); + } + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse getResponses(int index) { + return responses_.get(index); + } + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.BatchAnnotateFilesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse other = + (com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) 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.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + 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.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + com.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.v1p4beta1.BatchAnnotateFilesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + java.io.InputStream 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.v1p4beta1.BatchAnnotateFilesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse parseDelimitedFrom( + java.io.InputStream 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.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A list of file annotation responses.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.class, + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse build() { + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse result = + new com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse(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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse other) { + if (other + == com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) 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.v1p4beta1.AnnotateFileResponse, + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateFileResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
+     * The list of file annotation responses, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse 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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of file annotation responses, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of file annotation responses, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p4beta1.AnnotateFileResponse 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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public Builder addResponses(com.google.cloud.vision.v1p4beta1.AnnotateFileResponse 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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p4beta1.AnnotateFileResponse 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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public Builder addResponses( + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of file annotation responses, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse 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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse 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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse 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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of file annotation responses, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of file annotation responses, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse 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, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.getDefaultInstance()); + } + /** + * + * + *
+     * The list of file annotation responses, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.getDefaultInstance()); + } + /** + * + * + *
+     * The list of file annotation responses, each response corresponding to each
+     * AnnotateFileRequest in BatchAnnotateFilesRequest.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse, + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateFileResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse, + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateFileResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) + private static final com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchAnnotateFilesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchAnnotateFilesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesResponseOrBuilder.java new file mode 100644 index 000000000000..1050bf24aa92 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateFilesResponseOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface BatchAnnotateFilesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + java.util.List getResponsesList(); + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateFileResponse getResponses(int index); + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + int getResponsesCount(); + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + /** + * + * + *
+   * The list of file annotation responses, each response corresponding to each
+   * AnnotateFileRequest in BatchAnnotateFilesRequest.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateFileResponse responses = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateFileResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesRequest.java new file mode 100644 index 000000000000..d63c16ad3d6d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesRequest.java @@ -0,0 +1,946 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Multiple image annotation requests are batched into a single service call.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest} + */ +public final class BatchAnnotateImagesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requests_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest>(); + mutable_bitField0_ |= 0x00000001; + } + requests_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List getRequestsList() { + return requests_; + } + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public int getRequestsCount() { + return requests_.size(); + } + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest getRequests(int index) { + return requests_.get(index); + } + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(1, requests_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.BatchAnnotateImagesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Multiple image annotation requests are batched into a single service call.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest) + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.class, + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + requestsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest build() { + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder> + requestsBuilder_; + + /** + * + * + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder setRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public Builder addRequests( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Individual image annotation requests for this batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder>( + requests_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest) + private static final com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesRequestOrBuilder.java new file mode 100644 index 000000000000..090f627bfeb6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesRequestOrBuilder.java @@ -0,0 +1,62 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface BatchAnnotateImagesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + java.util.List getRequestsList(); + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateImageRequest getRequests(int index); + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + int getRequestsCount(); + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + java.util.List + getRequestsOrBuilderList(); + /** + * + * + *
+   * Individual image annotation requests for this batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageRequest requests = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateImageRequestOrBuilder getRequestsOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesResponse.java new file mode 100644 index 000000000000..abf1f3a9e9a2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesResponse.java @@ -0,0 +1,951 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Response to a batch image annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse} + */ +public final class BatchAnnotateImagesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse>(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List + getResponsesList() { + return responses_; + } + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public int getResponsesCount() { + return responses_.size(); + } + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse getResponses(int index) { + return responses_.get(index); + } + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.BatchAnnotateImagesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchAnnotateImagesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response to a batch image annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.class, + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse build() { + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public Builder setResponses( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public Builder addResponses(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public Builder addResponses( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public Builder addResponses( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder> + 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.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.getDefaultInstance()); + } + /** + * + * + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.getDefaultInstance()); + } + /** + * + * + *
+     * Individual responses to image annotation requests within the batch.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse.Builder, + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) + private static final com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesResponseOrBuilder.java new file mode 100644 index 000000000000..1ccba9587c5e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchAnnotateImagesResponseOrBuilder.java @@ -0,0 +1,62 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface BatchAnnotateImagesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + java.util.List getResponsesList(); + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateImageResponse getResponses(int index); + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + int getResponsesCount(); + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + /** + * + * + *
+   * Individual responses to image annotation requests within the batch.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.AnnotateImageResponse responses = 1; + */ + com.google.cloud.vision.v1p4beta1.AnnotateImageResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchOperationMetadata.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchOperationMetadata.java new file mode 100644 index 000000000000..7a816fe55400 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchOperationMetadata.java @@ -0,0 +1,1307 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.BatchOperationMetadata} + */ +public final class BatchOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_BatchOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_BatchOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.class, + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.Builder.class); + } + + /** + * + * + *
+   * Enumerates the possible states that the batch request can be in.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p4beta1.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 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.v1p4beta1.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.v1p4beta1.BatchOperationMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BatchOperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BatchOperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State result = + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (state_ + != com.google.cloud.vision.v1p4beta1.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); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata 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.v1p4beta1.BatchOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.BatchOperationMetadata) + com.google.cloud.vision.v1p4beta1.BatchOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_BatchOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_BatchOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.class, + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_BatchOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchOperationMetadata build() { + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchOperationMetadata buildPartial() { + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.BatchOperationMetadata) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.BatchOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.BatchOperationMetadata other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BatchOperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BatchOperationMetadata.State state = 1; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BatchOperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State result = + com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BatchOperationMetadata.State state = 1; + */ + public Builder setState(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.BatchOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchOperationMetadata) + private static final com.google.cloud.vision.v1p4beta1.BatchOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.BatchOperationMetadata(); + } + + public static com.google.cloud.vision.v1p4beta1.BatchOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BatchOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchOperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..bb84a1c62dfb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BatchOperationMetadataOrBuilder.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface BatchOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.BatchOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BatchOperationMetadata.State state = 1; + */ + int getStateValue(); + /** + * + * + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BatchOperationMetadata.State state = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Block.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Block.java new file mode 100644 index 000000000000..f708176aac6d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Block.java @@ -0,0 +1,2064 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Logical element on the page.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Block} + */ +public final class Block extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder subBuilder = + null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph.parser(), extensionRegistry)); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + blockType_ = rawValue; + break; + } + case 45: + { + confidence_ = input.readFloat(); + 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 { + 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.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Block_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Block_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Block.class, + com.google.cloud.vision.v1p4beta1.Block.Builder.class); + } + + /** + * + * + *
+   * Type of a block (text, image etc) as identified by OCR.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p4beta1.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 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.v1p4beta1.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.v1p4beta1.Block.BlockType) + } + + private int bitField0_; + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_; + /** + * + * + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + * + * + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + /** + * + * + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + return getProperty(); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingBox() { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block.BlockType block_type = 4; + */ + public int getBlockTypeValue() { + return blockType_; + } + /** + * + * + *
+   * Detected block type (text, image etc) for this block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Block.BlockType block_type = 4; + */ + public com.google.cloud.vision.v1p4beta1.Block.BlockType getBlockType() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Block.BlockType result = + com.google.cloud.vision.v1p4beta1.Block.BlockType.valueOf(blockType_); + return result == null ? com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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.v1p4beta1.Block.BlockType.UNKNOWN.getNumber()) { + output.writeEnum(4, blockType_); + } + if (confidence_ != 0F) { + output.writeFloat(5, confidence_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.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.v1p4beta1.Block)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Block other = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Block prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Logical element on the page.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Block} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Block) + com.google.cloud.vision.v1p4beta1.BlockOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Block_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Block_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Block.class, + com.google.cloud.vision.v1p4beta1.Block.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Block_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Block getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Block.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Block build() { + com.google.cloud.vision.v1p4beta1.Block result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Block buildPartial() { + com.google.cloud.vision.v1p4beta1.Block result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Block) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Block) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Block other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Block parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.Block) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + propertyBuilder_; + /** + * + * + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + * + * + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder + getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + } + /** + * + * + *
+     * Additional information detected for the block.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), getParentForChildren(), isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox(com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox( + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder mergeBoundingBox(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph, + com.google.cloud.vision.v1p4beta1.Paragraph.Builder, + com.google.cloud.vision.v1p4beta1.ParagraphOrBuilder> + paragraphsBuilder_; + + /** + * + * + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public Builder setParagraphs(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public Builder setParagraphs( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public Builder addParagraphs(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public Builder addParagraphs(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public Builder addParagraphs( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public Builder addParagraphs( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p4beta1.Paragraph.Builder addParagraphsBuilder() { + return getParagraphsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Paragraph.getDefaultInstance()); + } + /** + * + * + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Paragraph paragraphs = 3; + */ + public com.google.cloud.vision.v1p4beta1.Paragraph.Builder addParagraphsBuilder(int index) { + return getParagraphsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Paragraph.getDefaultInstance()); + } + /** + * + * + *
+     * List of paragraphs in this block (if this blocks is of type text).
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Paragraph paragraphs = 3; + */ + public java.util.List + getParagraphsBuilderList() { + return getParagraphsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Paragraph, + com.google.cloud.vision.v1p4beta1.Paragraph.Builder, + com.google.cloud.vision.v1p4beta1.ParagraphOrBuilder> + getParagraphsFieldBuilder() { + if (paragraphsBuilder_ == null) { + paragraphsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Paragraph, + com.google.cloud.vision.v1p4beta1.Paragraph.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block.BlockType block_type = 4; + */ + public int getBlockTypeValue() { + return blockType_; + } + /** + * + * + *
+     * Detected block type (text, image etc) for this block.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.Block.BlockType block_type = 4; + */ + public com.google.cloud.vision.v1p4beta1.Block.BlockType getBlockType() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Block.BlockType result = + com.google.cloud.vision.v1p4beta1.Block.BlockType.valueOf(blockType_); + return result == null + ? com.google.cloud.vision.v1p4beta1.Block.BlockType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Detected block type (text, image etc) for this block.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Block.BlockType block_type = 4; + */ + public Builder setBlockType(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Block) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Block) + private static final com.google.cloud.vision.v1p4beta1.Block DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Block(); + } + + public static com.google.cloud.vision.v1p4beta1.Block getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Block getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BlockOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BlockOrBuilder.java new file mode 100644 index 000000000000..6811a02bf2b9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BlockOrBuilder.java @@ -0,0 +1,198 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface BlockOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.Block) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + * + * + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty(); + /** + * + * + *
+   * Additional information detected for the block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder(); + + /** + * + * + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Paragraph paragraphs = 3; + */ + java.util.List getParagraphsList(); + /** + * + * + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Paragraph paragraphs = 3; + */ + com.google.cloud.vision.v1p4beta1.Paragraph getParagraphs(int index); + /** + * + * + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Paragraph paragraphs = 3; + */ + int getParagraphsCount(); + /** + * + * + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Paragraph paragraphs = 3; + */ + java.util.List + getParagraphsOrBuilderList(); + /** + * + * + *
+   * List of paragraphs in this block (if this blocks is of type text).
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Paragraph paragraphs = 3; + */ + com.google.cloud.vision.v1p4beta1.ParagraphOrBuilder getParagraphsOrBuilder(int index); + + /** + * + * + *
+   * Detected block type (text, image etc) for this block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Block.BlockType block_type = 4; + */ + int getBlockTypeValue(); + /** + * + * + *
+   * Detected block type (text, image etc) for this block.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Block.BlockType block_type = 4; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BoundingPoly.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BoundingPoly.java new file mode 100644 index 000000000000..c97813c77749 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BoundingPoly.java @@ -0,0 +1,1444 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A bounding polygon for the detected image annotation.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BoundingPoly} + */ +public final class BoundingPoly extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + vertices_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BoundingPoly.class, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder.class); + } + + public static final int VERTICES_FIELD_NUMBER = 1; + private java.util.List vertices_; + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public java.util.List getVerticesList() { + return vertices_; + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + return vertices_; + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public int getVerticesCount() { + return vertices_.size(); + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p4beta1.Vertex getVertices(int index) { + return vertices_.get(index); + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesList() { + return normalizedVertices_; + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesOrBuilderList() { + return normalizedVertices_; + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + public int getNormalizedVerticesCount() { + return normalizedVertices_.size(); + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p4beta1.NormalizedVertex getNormalizedVertices(int index) { + return normalizedVertices_.get(index); + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.vision.v1p4beta1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index) { + return normalizedVertices_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < vertices_.size(); i++) { + output.writeMessage(1, vertices_.get(i)); + } + for (int i = 0; i < normalizedVertices_.size(); i++) { + output.writeMessage(2, normalizedVertices_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < vertices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, vertices_.get(i)); + } + for (int i = 0; i < normalizedVertices_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, normalizedVertices_.get(i)); + } + size += 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.v1p4beta1.BoundingPoly)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.BoundingPoly other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.BoundingPoly prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A bounding polygon for the detected image annotation.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.BoundingPoly} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.BoundingPoly) + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.BoundingPoly.class, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BoundingPoly getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BoundingPoly build() { + com.google.cloud.vision.v1p4beta1.BoundingPoly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BoundingPoly buildPartial() { + com.google.cloud.vision.v1p4beta1.BoundingPoly result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.BoundingPoly) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.BoundingPoly) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.BoundingPoly other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.BoundingPoly parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex, + com.google.cloud.vision.v1p4beta1.Vertex.Builder, + com.google.cloud.vision.v1p4beta1.VertexOrBuilder> + verticesBuilder_; + + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex vertices = 1; + */ + public int getVerticesCount() { + if (verticesBuilder_ == null) { + return vertices_.size(); + } else { + return verticesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p4beta1.Vertex getVertices(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public Builder setVertices(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex vertices = 1; + */ + public Builder addVertices(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p4beta1.Vertex.Builder getVerticesBuilder(int index) { + return getVerticesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p4beta1.VertexOrBuilder getVerticesOrBuilder(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p4beta1.Vertex.Builder addVerticesBuilder() { + return getVerticesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Vertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public com.google.cloud.vision.v1p4beta1.Vertex.Builder addVerticesBuilder(int index) { + return getVerticesFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Vertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + public java.util.List + getVerticesBuilderList() { + return getVerticesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Vertex, + com.google.cloud.vision.v1p4beta1.Vertex.Builder, + com.google.cloud.vision.v1p4beta1.VertexOrBuilder> + getVerticesFieldBuilder() { + if (verticesBuilder_ == null) { + verticesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Vertex, + com.google.cloud.vision.v1p4beta1.Vertex.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex, + com.google.cloud.vision.v1p4beta1.NormalizedVertex.Builder, + com.google.cloud.vision.v1p4beta1.NormalizedVertexOrBuilder> + normalizedVerticesBuilder_; + + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addNormalizedVertices(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addNormalizedVertices( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.NormalizedVertex.Builder getNormalizedVerticesBuilder( + int index) { + return getNormalizedVerticesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.NormalizedVertex.Builder + addNormalizedVerticesBuilder() { + return getNormalizedVerticesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.NormalizedVertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.NormalizedVertex.Builder addNormalizedVerticesBuilder( + int index) { + return getNormalizedVerticesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.NormalizedVertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + * + */ + public java.util.List + getNormalizedVerticesBuilderList() { + return getNormalizedVerticesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.NormalizedVertex, + com.google.cloud.vision.v1p4beta1.NormalizedVertex.Builder, + com.google.cloud.vision.v1p4beta1.NormalizedVertexOrBuilder> + getNormalizedVerticesFieldBuilder() { + if (normalizedVerticesBuilder_ == null) { + normalizedVerticesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.NormalizedVertex, + com.google.cloud.vision.v1p4beta1.NormalizedVertex.Builder, + com.google.cloud.vision.v1p4beta1.NormalizedVertexOrBuilder>( + normalizedVertices_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + normalizedVertices_ = null; + } + return normalizedVerticesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.BoundingPoly) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BoundingPoly) + private static final com.google.cloud.vision.v1p4beta1.BoundingPoly DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.BoundingPoly(); + } + + public static com.google.cloud.vision.v1p4beta1.BoundingPoly getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoundingPoly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoundingPoly(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.BoundingPoly getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BoundingPolyOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BoundingPolyOrBuilder.java new file mode 100644 index 000000000000..f4c33eec2aa3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/BoundingPolyOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface BoundingPolyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.BoundingPoly) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + java.util.List getVerticesList(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + com.google.cloud.vision.v1p4beta1.Vertex getVertices(int index); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + int getVerticesCount(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + java.util.List + getVerticesOrBuilderList(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Vertex vertices = 1; + */ + com.google.cloud.vision.v1p4beta1.VertexOrBuilder getVerticesOrBuilder(int index); + + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + java.util.List getNormalizedVerticesList(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + com.google.cloud.vision.v1p4beta1.NormalizedVertex getNormalizedVertices(int index); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + int getNormalizedVerticesCount(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + java.util.List + getNormalizedVerticesOrBuilderList(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.NormalizedVertex normalized_vertices = 2; + */ + com.google.cloud.vision.v1p4beta1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ColorInfo.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ColorInfo.java new file mode 100644 index 000000000000..260619aafb8e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ColorInfo.java @@ -0,0 +1,858 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.ColorInfo} + */ +public final class ColorInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ColorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ColorInfo.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (color_ != null) { + output.writeMessage(1, getColor()); + } + if (score_ != 0F) { + output.writeFloat(2, score_); + } + if (pixelFraction_ != 0F) { + output.writeFloat(3, pixelFraction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.ColorInfo)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ColorInfo other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.ColorInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * 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.v1p4beta1.ColorInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ColorInfo) + com.google.cloud.vision.v1p4beta1.ColorInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ColorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ColorInfo.class, + com.google.cloud.vision.v1p4beta1.ColorInfo.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (colorBuilder_ == null) { + color_ = null; + } else { + color_ = null; + colorBuilder_ = null; + } + score_ = 0F; + + pixelFraction_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ColorInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ColorInfo getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ColorInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ColorInfo build() { + com.google.cloud.vision.v1p4beta1.ColorInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ColorInfo buildPartial() { + com.google.cloud.vision.v1p4beta1.ColorInfo result = + new com.google.cloud.vision.v1p4beta1.ColorInfo(this); + if (colorBuilder_ == null) { + result.color_ = color_; + } else { + result.color_ = colorBuilder_.build(); + } + result.score_ = score_; + result.pixelFraction_ = pixelFraction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ColorInfo) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ColorInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ColorInfo other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ColorInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ColorInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ColorInfo) + private static final com.google.cloud.vision.v1p4beta1.ColorInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ColorInfo(); + } + + public static com.google.cloud.vision.v1p4beta1.ColorInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ColorInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ColorInfoOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ColorInfoOrBuilder.java new file mode 100644 index 000000000000..473bf810caf7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ColorInfoOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ColorInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductRequest.java new file mode 100644 index 000000000000..8aae90edaee0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductRequest.java @@ -0,0 +1,1062 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `CreateProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CreateProductRequest} + */ +public final class CreateProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + productId_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CreateProductRequest.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product_; + /** + * + * + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p4beta1.Product getProduct() { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (product_ != null) { + output.writeMessage(2, getProduct()); + } + if (!getProductIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (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.v1p4beta1.CreateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.CreateProductRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.CreateProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `CreateProduct` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CreateProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.CreateProductRequest) + com.google.cloud.vision.v1p4beta1.CreateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CreateProductRequest.class, + com.google.cloud.vision.v1p4beta1.CreateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + productId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.CreateProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateProductRequest build() { + com.google.cloud.vision.v1p4beta1.CreateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateProductRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.CreateProductRequest result = + new com.google.cloud.vision.v1p4beta1.CreateProductRequest(this); + result.parent_ = parent_; + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.productId_ = productId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.CreateProductRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.CreateProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.CreateProductRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.CreateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p4beta1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + public Builder setProduct(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product = 2; + */ + public Builder setProduct(com.google.cloud.vision.v1p4beta1.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + public Builder mergeProduct(com.google.cloud.vision.v1p4beta1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1p4beta1.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + public com.google.cloud.vision.v1p4beta1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.CreateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CreateProductRequest) + private static final com.google.cloud.vision.v1p4beta1.CreateProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.CreateProductRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.CreateProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductRequestOrBuilder.java new file mode 100644 index 000000000000..bbba3998771b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductRequestOrBuilder.java @@ -0,0 +1,93 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface CreateProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product = 2; + */ + boolean hasProduct(); + /** + * + * + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + com.google.cloud.vision.v1p4beta1.Product getProduct(); + /** + * + * + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 2; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductSetRequest.java new file mode 100644 index 000000000000..a7390df81aea --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductSetRequest.java @@ -0,0 +1,1056 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `CreateProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CreateProductSetRequest} + */ +public final class CreateProductSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.ProductSet.Builder subBuilder = null; + if (productSet_ != null) { + subBuilder = productSet_.toBuilder(); + } + productSet_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ProductSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productSet_); + productSet_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + productSetId_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet productSet_; + /** + * + * + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + public boolean hasProductSet() { + return productSet_ != null; + } + /** + * + * + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet getProductSet() { + return productSet_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance() + : productSet_; + } + /** + * + * + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (productSet_ != null) { + output.writeMessage(2, getProductSet()); + } + if (!getProductSetIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productSetId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (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.v1p4beta1.CreateProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateProductSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `CreateProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CreateProductSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.CreateProductSetRequest) + com.google.cloud.vision.v1p4beta1.CreateProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (productSetBuilder_ == null) { + productSet_ = null; + } else { + productSet_ = null; + productSetBuilder_ = null; + } + productSetId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.CreateProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateProductSetRequest build() { + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateProductSetRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest result = + new com.google.cloud.vision.v1p4beta1.CreateProductSetRequest(this); + result.parent_ = parent_; + if (productSetBuilder_ == null) { + result.productSet_ = productSet_; + } else { + result.productSet_ = productSetBuilder_.build(); + } + result.productSetId_ = productSetId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.CreateProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.CreateProductSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.CreateProductSetRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.CreateProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet productSet_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder> + productSetBuilder_; + /** + * + * + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + public boolean hasProductSet() { + return productSetBuilder_ != null || productSet_ != null; + } + /** + * + * + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet getProductSet() { + if (productSetBuilder_ == null) { + return productSet_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance() + : productSet_; + } else { + return productSetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + public Builder setProductSet(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_set = 2; + */ + public Builder setProductSet( + com.google.cloud.vision.v1p4beta1.ProductSet.Builder builderForValue) { + if (productSetBuilder_ == null) { + productSet_ = builderForValue.build(); + onChanged(); + } else { + productSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + public Builder mergeProductSet(com.google.cloud.vision.v1p4beta1.ProductSet value) { + if (productSetBuilder_ == null) { + if (productSet_ != null) { + productSet_ = + com.google.cloud.vision.v1p4beta1.ProductSet.newBuilder(productSet_) + .mergeFrom(value) + .buildPartial(); + } else { + productSet_ = value; + } + onChanged(); + } else { + productSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet.Builder getProductSetBuilder() { + + onChanged(); + return getProductSetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder getProductSetOrBuilder() { + if (productSetBuilder_ != null) { + return productSetBuilder_.getMessageOrBuilder(); + } else { + return productSet_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance() + : productSet_; + } + } + /** + * + * + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder> + getProductSetFieldBuilder() { + if (productSetBuilder_ == null) { + productSetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.CreateProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CreateProductSetRequest) + private static final com.google.cloud.vision.v1p4beta1.CreateProductSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.CreateProductSetRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.CreateProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..36b939db3718 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateProductSetRequestOrBuilder.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface CreateProductSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_set = 2; + */ + boolean hasProductSet(); + /** + * + * + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + com.google.cloud.vision.v1p4beta1.ProductSet getProductSet(); + /** + * + * + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 2; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateReferenceImageRequest.java new file mode 100644 index 000000000000..47412104c01c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateReferenceImageRequest.java @@ -0,0 +1,1079 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `CreateReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CreateReferenceImageRequest} + */ +public final class CreateReferenceImageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder subBuilder = null; + if (referenceImage_ != null) { + subBuilder = referenceImage_.toBuilder(); + } + referenceImage_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ReferenceImage.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(referenceImage_); + referenceImage_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + referenceImageId_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage referenceImage_; + /** + * + * + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage getReferenceImage() { + return referenceImage_ == null + ? com.google.cloud.vision.v1p4beta1.ReferenceImage.getDefaultInstance() + : referenceImage_; + } + /** + * + * + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (referenceImage_ != null) { + output.writeMessage(2, getReferenceImage()); + } + if (!getReferenceImageIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, referenceImageId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (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.v1p4beta1.CreateReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateReferenceImageRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CreateReferenceImageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `CreateReferenceImage` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CreateReferenceImageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.CreateReferenceImageRequest) + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.class, + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (referenceImageBuilder_ == null) { + referenceImage_ = null; + } else { + referenceImage_ = null; + referenceImageBuilder_ = null; + } + referenceImageId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest build() { + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest result = + new com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest(this); + result.parent_ = parent_; + if (referenceImageBuilder_ == null) { + result.referenceImage_ = referenceImage_; + } else { + result.referenceImage_ = referenceImageBuilder_.build(); + } + result.referenceImageId_ = referenceImageId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage referenceImage_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.ReferenceImageOrBuilder> + referenceImageBuilder_; + /** + * + * + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage getReferenceImage() { + if (referenceImageBuilder_ == null) { + return referenceImage_ == null + ? com.google.cloud.vision.v1p4beta1.ReferenceImage.getDefaultInstance() + : referenceImage_; + } else { + return referenceImageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ReferenceImage reference_image = 2; + */ + public Builder setReferenceImage(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_image = 2; + */ + public Builder setReferenceImage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_image = 2; + */ + public Builder mergeReferenceImage(com.google.cloud.vision.v1p4beta1.ReferenceImage value) { + if (referenceImageBuilder_ == null) { + if (referenceImage_ != null) { + referenceImage_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder getReferenceImageBuilder() { + + onChanged(); + return getReferenceImageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImageOrBuilder getReferenceImageOrBuilder() { + if (referenceImageBuilder_ != null) { + return referenceImageBuilder_.getMessageOrBuilder(); + } else { + return referenceImage_ == null + ? com.google.cloud.vision.v1p4beta1.ReferenceImage.getDefaultInstance() + : referenceImage_; + } + } + /** + * + * + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ReferenceImage reference_image = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.ReferenceImageOrBuilder> + getReferenceImageFieldBuilder() { + if (referenceImageBuilder_ == null) { + referenceImageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.CreateReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CreateReferenceImageRequest) + private static final com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..a64da8ccb1ab --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CreateReferenceImageRequestOrBuilder.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface CreateReferenceImageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_image = 2; + */ + boolean hasReferenceImage(); + /** + * + * + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ReferenceImage reference_image = 2; + */ + com.google.cloud.vision.v1p4beta1.ReferenceImage getReferenceImage(); + /** + * + * + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ReferenceImage reference_image = 2; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHint.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHint.java new file mode 100644 index 000000000000..170f71cb8b88 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHint.java @@ -0,0 +1,885 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Single crop hint that is used to generate a new crop when serving an image.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CropHint} + */ +public final class CropHint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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; + } + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CropHint.class, + com.google.cloud.vision.v1p4beta1.CropHint.Builder.class); + } + + public static final int BOUNDING_POLY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingPoly_; + /** + * + * + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + /** + * + * + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (boundingPoly_ != null) { + output.writeMessage(1, getBoundingPoly()); + } + if (confidence_ != 0F) { + output.writeFloat(2, confidence_); + } + if (importanceFraction_ != 0F) { + output.writeFloat(3, importanceFraction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.CropHint)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.CropHint other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.CropHint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Single crop hint that is used to generate a new crop when serving an image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CropHint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.CropHint) + com.google.cloud.vision.v1p4beta1.CropHintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CropHint.class, + com.google.cloud.vision.v1p4beta1.CropHint.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + confidence_ = 0F; + + importanceFraction_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHint_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHint getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.CropHint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHint build() { + com.google.cloud.vision.v1p4beta1.CropHint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHint buildPartial() { + com.google.cloud.vision.v1p4beta1.CropHint result = + new com.google.cloud.vision.v1p4beta1.CropHint(this); + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + result.confidence_ = confidence_; + result.importanceFraction_ = importanceFraction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.CropHint) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.CropHint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.CropHint other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.CropHint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.CropHint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + boundingPolyBuilder_; + /** + * + * + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.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.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p4beta1.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.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p4beta1.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.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p4beta1.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.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + } + /** + * + * + *
+     * The bounding polygon for the crop region. The coordinates of the bounding
+     * box are in the original image's scale.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.CropHint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CropHint) + private static final com.google.cloud.vision.v1p4beta1.CropHint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.CropHint(); + } + + public static com.google.cloud.vision.v1p4beta1.CropHint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintOrBuilder.java new file mode 100644 index 000000000000..c8aeee8b143c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface CropHintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly(); + /** + * + * + *
+   * The bounding polygon for the crop region. The coordinates of the bounding
+   * box are in the original image's scale.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsAnnotation.java new file mode 100644 index 000000000000..1383a886a4ed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsAnnotation.java @@ -0,0 +1,930 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Set of crop hints that are used to generate new crops when serving images.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CropHintsAnnotation} + */ +public final class CropHintsAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + cropHints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + cropHints_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.CropHint.parser(), extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.class, + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.Builder.class); + } + + public static final int CROP_HINTS_FIELD_NUMBER = 1; + private java.util.List cropHints_; + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public java.util.List getCropHintsList() { + return cropHints_; + } + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public java.util.List + getCropHintsOrBuilderList() { + return cropHints_; + } + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public int getCropHintsCount() { + return cropHints_.size(); + } + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p4beta1.CropHint getCropHints(int index) { + return cropHints_.get(index); + } + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p4beta1.CropHintOrBuilder getCropHintsOrBuilder(int index) { + return cropHints_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < cropHints_.size(); i++) { + output.writeMessage(1, cropHints_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.CropHintsAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Set of crop hints that are used to generate new crops when serving images.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CropHintsAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.CropHintsAnnotation) + com.google.cloud.vision.v1p4beta1.CropHintsAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.class, + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (cropHintsBuilder_ == null) { + cropHints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + cropHintsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.CropHintsAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotation build() { + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotation buildPartial() { + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.CropHintsAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.CropHintsAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.CropHintsAnnotation other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.CropHintsAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint, + com.google.cloud.vision.v1p4beta1.CropHint.Builder, + com.google.cloud.vision.v1p4beta1.CropHintOrBuilder> + cropHintsBuilder_; + + /** + * + * + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint crop_hints = 1; + */ + public int getCropHintsCount() { + if (cropHintsBuilder_ == null) { + return cropHints_.size(); + } else { + return cropHintsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p4beta1.CropHint getCropHints(int index) { + if (cropHintsBuilder_ == null) { + return cropHints_.get(index); + } else { + return cropHintsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public Builder setCropHints(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint crop_hints = 1; + */ + public Builder setCropHints( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint crop_hints = 1; + */ + public Builder addCropHints(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint crop_hints = 1; + */ + public Builder addCropHints(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint crop_hints = 1; + */ + public Builder addCropHints( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint crop_hints = 1; + */ + public Builder addCropHints( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p4beta1.CropHint.Builder getCropHintsBuilder(int index) { + return getCropHintsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p4beta1.CropHintOrBuilder getCropHintsOrBuilder(int index) { + if (cropHintsBuilder_ == null) { + return cropHints_.get(index); + } else { + return cropHintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p4beta1.CropHint.Builder addCropHintsBuilder() { + return getCropHintsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.CropHint.getDefaultInstance()); + } + /** + * + * + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public com.google.cloud.vision.v1p4beta1.CropHint.Builder addCropHintsBuilder(int index) { + return getCropHintsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.CropHint.getDefaultInstance()); + } + /** + * + * + *
+     * Crop hint results.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + public java.util.List + getCropHintsBuilderList() { + return getCropHintsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.CropHint, + com.google.cloud.vision.v1p4beta1.CropHint.Builder, + com.google.cloud.vision.v1p4beta1.CropHintOrBuilder> + getCropHintsFieldBuilder() { + if (cropHintsBuilder_ == null) { + cropHintsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.CropHint, + com.google.cloud.vision.v1p4beta1.CropHint.Builder, + com.google.cloud.vision.v1p4beta1.CropHintOrBuilder>( + cropHints_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + cropHints_ = null; + } + return cropHintsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.CropHintsAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CropHintsAnnotation) + private static final com.google.cloud.vision.v1p4beta1.CropHintsAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.CropHintsAnnotation(); + } + + public static com.google.cloud.vision.v1p4beta1.CropHintsAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHintsAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsAnnotationOrBuilder.java new file mode 100644 index 000000000000..f71dab99e228 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsAnnotationOrBuilder.java @@ -0,0 +1,62 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface CropHintsAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.CropHintsAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + java.util.List getCropHintsList(); + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + com.google.cloud.vision.v1p4beta1.CropHint getCropHints(int index); + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + int getCropHintsCount(); + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + java.util.List + getCropHintsOrBuilderList(); + /** + * + * + *
+   * Crop hint results.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.CropHint crop_hints = 1; + */ + com.google.cloud.vision.v1p4beta1.CropHintOrBuilder getCropHintsOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsParams.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsParams.java new file mode 100644 index 000000000000..2685cb74d5ed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsParams.java @@ -0,0 +1,705 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Parameters for crop hints annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CropHintsParams} + */ +public final class CropHintsParams extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CropHintsParams.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (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); + } + + @java.lang.Override + 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.v1p4beta1.CropHintsParams)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.CropHintsParams other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.CropHintsParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.CropHintsParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.CropHintsParams) + com.google.cloud.vision.v1p4beta1.CropHintsParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.CropHintsParams.class, + com.google.cloud.vision.v1p4beta1.CropHintsParams.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + aspectRatios_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHintsParams getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.CropHintsParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHintsParams build() { + com.google.cloud.vision.v1p4beta1.CropHintsParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHintsParams buildPartial() { + com.google.cloud.vision.v1p4beta1.CropHintsParams result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.CropHintsParams) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.CropHintsParams) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.CropHintsParams other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.CropHintsParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.CropHintsParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CropHintsParams) + private static final com.google.cloud.vision.v1p4beta1.CropHintsParams DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.CropHintsParams(); + } + + public static com.google.cloud.vision.v1p4beta1.CropHintsParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.CropHintsParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsParamsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsParamsOrBuilder.java new file mode 100644 index 000000000000..430790e8e66c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/CropHintsParamsOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface CropHintsParamsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductRequest.java new file mode 100644 index 000000000000..834625cb9e22 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductRequest.java @@ -0,0 +1,614 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `DeleteProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.DeleteProductRequest} + */ +public final class DeleteProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.DeleteProductRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p4beta1.DeleteProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.DeleteProductRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.DeleteProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `DeleteProduct` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.DeleteProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.DeleteProductRequest) + com.google.cloud.vision.v1p4beta1.DeleteProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.DeleteProductRequest.class, + com.google.cloud.vision.v1p4beta1.DeleteProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.DeleteProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteProductRequest build() { + com.google.cloud.vision.v1p4beta1.DeleteProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteProductRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.DeleteProductRequest result = + new com.google.cloud.vision.v1p4beta1.DeleteProductRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.DeleteProductRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.DeleteProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.DeleteProductRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.DeleteProductRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.DeleteProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.DeleteProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.DeleteProductRequest) + private static final com.google.cloud.vision.v1p4beta1.DeleteProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.DeleteProductRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.DeleteProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductRequestOrBuilder.java new file mode 100644 index 000000000000..5dabd4960fa3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface DeleteProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductSetRequest.java new file mode 100644 index 000000000000..403e565b8edd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductSetRequest.java @@ -0,0 +1,614 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `DeleteProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.DeleteProductSetRequest} + */ +public final class DeleteProductSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteProductSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `DeleteProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.DeleteProductSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.DeleteProductSetRequest) + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest build() { + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest result = + new com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.DeleteProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.DeleteProductSetRequest) + private static final com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..267602509fe5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteProductSetRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface DeleteProductSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteReferenceImageRequest.java new file mode 100644 index 000000000000..0e44666aa4bc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteReferenceImageRequest.java @@ -0,0 +1,618 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `DeleteReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest} + */ +public final class DeleteReferenceImageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteReferenceImageRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DeleteReferenceImageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `DeleteReferenceImage` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest) + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.class, + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest build() { + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest result = + new com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest) + private static final com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..c3356fc40bf4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DeleteReferenceImageRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface DeleteReferenceImageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DominantColorsAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DominantColorsAnnotation.java new file mode 100644 index 000000000000..40927054160b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DominantColorsAnnotation.java @@ -0,0 +1,928 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Set of dominant colors and their corresponding scores.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.DominantColorsAnnotation} + */ +public final class DominantColorsAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + colors_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + colors_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.ColorInfo.parser(), extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public java.util.List getColorsList() { + return colors_; + } + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + public java.util.List + getColorsOrBuilderList() { + return colors_; + } + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + public int getColorsCount() { + return colors_.size(); + } + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.ColorInfo getColors(int index) { + return colors_.get(index); + } + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.ColorInfoOrBuilder getColorsOrBuilder(int index) { + return colors_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < colors_.size(); i++) { + output.writeMessage(1, colors_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.DominantColorsAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DominantColorsAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DominantColorsAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DominantColorsAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DominantColorsAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DominantColorsAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Set of dominant colors and their corresponding scores.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.DominantColorsAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.DominantColorsAnnotation) + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.class, + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (colorsBuilder_ == null) { + colors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + colorsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation build() { + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation buildPartial() { + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo, + com.google.cloud.vision.v1p4beta1.ColorInfo.Builder, + com.google.cloud.vision.v1p4beta1.ColorInfoOrBuilder> + colorsBuilder_; + + /** + * + * + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public Builder setColors(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public Builder setColors( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public Builder addColors(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public Builder addColors(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public Builder addColors(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public Builder addColors( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.ColorInfo.Builder getColorsBuilder(int index) { + return getColorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.ColorInfo.Builder addColorsBuilder() { + return getColorsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.ColorInfo.getDefaultInstance()); + } + /** + * + * + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.ColorInfo.Builder addColorsBuilder(int index) { + return getColorsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.ColorInfo.getDefaultInstance()); + } + /** + * + * + *
+     * RGB color values with their score and pixel fraction.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + public java.util.List + getColorsBuilderList() { + return getColorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ColorInfo, + com.google.cloud.vision.v1p4beta1.ColorInfo.Builder, + com.google.cloud.vision.v1p4beta1.ColorInfoOrBuilder> + getColorsFieldBuilder() { + if (colorsBuilder_ == null) { + colorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ColorInfo, + com.google.cloud.vision.v1p4beta1.ColorInfo.Builder, + com.google.cloud.vision.v1p4beta1.ColorInfoOrBuilder>( + colors_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + colors_ = null; + } + return colorsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.DominantColorsAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.DominantColorsAnnotation) + private static final com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation(); + } + + public static com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DominantColorsAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DominantColorsAnnotationOrBuilder.java new file mode 100644 index 000000000000..a56adac139bc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/DominantColorsAnnotationOrBuilder.java @@ -0,0 +1,62 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface DominantColorsAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.DominantColorsAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + java.util.List getColorsList(); + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + com.google.cloud.vision.v1p4beta1.ColorInfo getColors(int index); + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + int getColorsCount(); + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + java.util.List + getColorsOrBuilderList(); + /** + * + * + *
+   * RGB color values with their score and pixel fraction.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ColorInfo colors = 1; + */ + com.google.cloud.vision.v1p4beta1.ColorInfoOrBuilder getColorsOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/EntityAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/EntityAnnotation.java new file mode 100644 index 000000000000..87cf8bc3683c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/EntityAnnotation.java @@ -0,0 +1,2604 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Set of detected entity features.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.EntityAnnotation} + */ +public final class EntityAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Property.parser(), extensionRegistry)); + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.EntityAnnotation.class, + com.google.cloud.vision.v1p4beta1.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 [deprecated = true]; + */ + @java.lang.Deprecated + 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.v1p4beta1.BoundingPoly boundingPoly_; + /** + * + * + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + /** + * + * + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p4beta1.PropertyOrBuilder getPropertiesOrBuilder(int index) { + return properties_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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); + } + + @java.lang.Override + 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.v1p4beta1.EntityAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.EntityAnnotation other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.EntityAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.EntityAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Set of detected entity features.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.EntityAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.EntityAnnotation) + com.google.cloud.vision.v1p4beta1.EntityAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.EntityAnnotation.class, + com.google.cloud.vision.v1p4beta1.EntityAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.EntityAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.EntityAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.EntityAnnotation build() { + com.google.cloud.vision.v1p4beta1.EntityAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.EntityAnnotation buildPartial() { + com.google.cloud.vision.v1p4beta1.EntityAnnotation result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.EntityAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.EntityAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.EntityAnnotation other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.EntityAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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 [deprecated = true]; + */ + @java.lang.Deprecated + 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 [deprecated = true]; + */ + @java.lang.Deprecated + 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 [deprecated = true]; + */ + @java.lang.Deprecated + 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.v1p4beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + boundingPolyBuilder_; + /** + * + * + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + } + /** + * + * + *
+     * Image region to which this entity belongs. Not produced
+     * for `LABEL_DETECTION` features.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo, + com.google.cloud.vision.v1p4beta1.LocationInfo.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public Builder setLocations(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public Builder setLocations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public Builder addLocations(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public Builder addLocations(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public Builder addLocations( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public Builder addLocations( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p4beta1.LocationInfo.Builder addLocationsBuilder() { + return getLocationsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public com.google.cloud.vision.v1p4beta1.LocationInfo.Builder addLocationsBuilder(int index) { + return getLocationsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + public java.util.List + getLocationsBuilderList() { + return getLocationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.LocationInfo, + com.google.cloud.vision.v1p4beta1.LocationInfo.Builder, + com.google.cloud.vision.v1p4beta1.LocationInfoOrBuilder> + getLocationsFieldBuilder() { + if (locationsBuilder_ == null) { + locationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.LocationInfo, + com.google.cloud.vision.v1p4beta1.LocationInfo.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property, + com.google.cloud.vision.v1p4beta1.Property.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public Builder setProperties(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public Builder setProperties( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public Builder addProperties(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public Builder addProperties(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public Builder addProperties( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public Builder addProperties( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p4beta1.Property.Builder addPropertiesBuilder() { + return getPropertiesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public com.google.cloud.vision.v1p4beta1.Property.Builder addPropertiesBuilder(int index) { + return getPropertiesFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + public java.util.List + getPropertiesBuilderList() { + return getPropertiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Property, + com.google.cloud.vision.v1p4beta1.Property.Builder, + com.google.cloud.vision.v1p4beta1.PropertyOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Property, + com.google.cloud.vision.v1p4beta1.Property.Builder, + com.google.cloud.vision.v1p4beta1.PropertyOrBuilder>( + properties_, + ((bitField0_ & 0x00000100) == 0x00000100), + getParentForChildren(), + isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.EntityAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.EntityAnnotation) + private static final com.google.cloud.vision.v1p4beta1.EntityAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.EntityAnnotation(); + } + + public static com.google.cloud.vision.v1p4beta1.EntityAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.EntityAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/EntityAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/EntityAnnotationOrBuilder.java new file mode 100644 index 000000000000..ccab76104db4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/EntityAnnotationOrBuilder.java @@ -0,0 +1,284 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface EntityAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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 [deprecated = true]; + */ + @java.lang.Deprecated + 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.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + boolean hasBoundingPoly(); + /** + * + * + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly(); + /** + * + * + *
+   * Image region to which this entity belongs. Not produced
+   * for `LABEL_DETECTION` features.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 7; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.LocationInfo locations = 8; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Property properties = 9; + */ + com.google.cloud.vision.v1p4beta1.PropertyOrBuilder getPropertiesOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FaceAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FaceAnnotation.java new file mode 100644 index 000000000000..5d689680aa27 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FaceAnnotation.java @@ -0,0 +1,4712 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A face annotation object contains the results of face detection.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.FaceAnnotation} + */ +public final class FaceAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (fdBoundingPoly_ != null) { + subBuilder = fdBoundingPoly_.toBuilder(); + } + fdBoundingPoly_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark>(); + mutable_bitField0_ |= 0x00000004; + } + landmarks_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.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; + } + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.FaceAnnotation.class, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Builder.class); + } + + public interface LandmarkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Face landmark type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + int getTypeValue(); + /** + * + * + *
+     * Face landmark type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type getType(); + + /** + * + * + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + boolean hasPosition(); + /** + * + * + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + com.google.cloud.vision.v1p4beta1.Position getPosition(); + /** + * + * + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + com.google.cloud.vision.v1p4beta1.PositionOrBuilder getPositionOrBuilder(); + } + /** + * + * + *
+   * A face-specific landmark (for example, a face feature).
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark} + */ + public static final class Landmark extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 24: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 34: + { + com.google.cloud.vision.v1p4beta1.Position.Builder subBuilder = null; + if (position_ != null) { + subBuilder = position_.toBuilder(); + } + position_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.Position.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(position_); + position_ = subBuilder.buildPartial(); + } + + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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 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.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark.Type) + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_; + /** + * + * + *
+     * Face landmark type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Face landmark type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type result = + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type.valueOf(type_); + return result == null + ? com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type.UNRECOGNIZED + : result; + } + + public static final int POSITION_FIELD_NUMBER = 4; + private com.google.cloud.vision.v1p4beta1.Position position_; + /** + * + * + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + public boolean hasPosition() { + return position_ != null; + } + /** + * + * + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p4beta1.Position getPosition() { + return position_ == null + ? com.google.cloud.vision.v1p4beta1.Position.getDefaultInstance() + : position_; + } + /** + * + * + *
+     * Face landmark position.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p4beta1.PositionOrBuilder getPositionOrBuilder() { + return getPosition(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ + != com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type.UNKNOWN_LANDMARK + .getNumber()) { + output.writeEnum(3, type_); + } + if (position_ != null) { + output.writeMessage(4, getPosition()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A face-specific landmark (for example, a face feature).
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark) + com.google.cloud.vision.v1p4beta1.FaceAnnotation.LandmarkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.class, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + + if (positionBuilder_ == null) { + position_ = null; + } else { + position_ = null; + positionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark build() { + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark buildPartial() { + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark result = + new com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark(this); + result.type_ = type_; + if (positionBuilder_ == null) { + result.position_ = position_; + } else { + result.position_ = positionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type result = + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type.valueOf(type_); + return result == null + ? com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public Builder setType(com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Face landmark type.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type type = 3; + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.vision.v1p4beta1.Position position_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Position, + com.google.cloud.vision.v1p4beta1.Position.Builder, + com.google.cloud.vision.v1p4beta1.PositionOrBuilder> + positionBuilder_; + /** + * + * + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + public boolean hasPosition() { + return positionBuilder_ != null || position_ != null; + } + /** + * + * + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p4beta1.Position getPosition() { + if (positionBuilder_ == null) { + return position_ == null + ? com.google.cloud.vision.v1p4beta1.Position.getDefaultInstance() + : position_; + } else { + return positionBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + public Builder setPosition(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Position position = 4; + */ + public Builder setPosition( + com.google.cloud.vision.v1p4beta1.Position.Builder builderForValue) { + if (positionBuilder_ == null) { + position_ = builderForValue.build(); + onChanged(); + } else { + positionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + public Builder mergePosition(com.google.cloud.vision.v1p4beta1.Position value) { + if (positionBuilder_ == null) { + if (position_ != null) { + position_ = + com.google.cloud.vision.v1p4beta1.Position.newBuilder(position_) + .mergeFrom(value) + .buildPartial(); + } else { + position_ = value; + } + onChanged(); + } else { + positionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p4beta1.Position.Builder getPositionBuilder() { + + onChanged(); + return getPositionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + public com.google.cloud.vision.v1p4beta1.PositionOrBuilder getPositionOrBuilder() { + if (positionBuilder_ != null) { + return positionBuilder_.getMessageOrBuilder(); + } else { + return position_ == null + ? com.google.cloud.vision.v1p4beta1.Position.getDefaultInstance() + : position_; + } + } + /** + * + * + *
+       * Face landmark position.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Position position = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Position, + com.google.cloud.vision.v1p4beta1.Position.Builder, + com.google.cloud.vision.v1p4beta1.PositionOrBuilder> + getPositionFieldBuilder() { + if (positionBuilder_ == null) { + positionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Position, + com.google.cloud.vision.v1p4beta1.Position.Builder, + com.google.cloud.vision.v1p4beta1.PositionOrBuilder>( + getPosition(), getParentForChildren(), isClean()); + position_ = null; + } + return positionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark) + private static final com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark(); + } + + public static com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int BOUNDING_POLY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingPoly_; + /** + * + * + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale.
+   * 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.v1p4beta1.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.
+   * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + /** + * + * + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale.
+   * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + public static final int FD_BOUNDING_POLY_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getFdBoundingPoly() { + return fdBoundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getFdBoundingPolyOrBuilder() { + return getFdBoundingPoly(); + } + + public static final int LANDMARKS_FIELD_NUMBER = 3; + private java.util.List landmarks_; + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List + getLandmarksList() { + return landmarks_; + } + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.FaceAnnotation.LandmarkOrBuilder> + getLandmarksOrBuilderList() { + return landmarks_; + } + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public int getLandmarksCount() { + return landmarks_.size(); + } + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark getLandmarks(int index) { + return landmarks_.get(index); + } + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Likelihood joy_likelihood = 9; + */ + public int getJoyLikelihoodValue() { + return joyLikelihood_; + } + /** + * + * + *
+   * Joy likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood joy_likelihood = 9; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getJoyLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(joyLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int SORROW_LIKELIHOOD_FIELD_NUMBER = 10; + private int sorrowLikelihood_; + /** + * + * + *
+   * Sorrow likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + public int getSorrowLikelihoodValue() { + return sorrowLikelihood_; + } + /** + * + * + *
+   * Sorrow likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getSorrowLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(sorrowLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int ANGER_LIKELIHOOD_FIELD_NUMBER = 11; + private int angerLikelihood_; + /** + * + * + *
+   * Anger likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + public int getAngerLikelihoodValue() { + return angerLikelihood_; + } + /** + * + * + *
+   * Anger likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getAngerLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(angerLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int SURPRISE_LIKELIHOOD_FIELD_NUMBER = 12; + private int surpriseLikelihood_; + /** + * + * + *
+   * Surprise likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + public int getSurpriseLikelihoodValue() { + return surpriseLikelihood_; + } + /** + * + * + *
+   * Surprise likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getSurpriseLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(surpriseLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int UNDER_EXPOSED_LIKELIHOOD_FIELD_NUMBER = 13; + private int underExposedLikelihood_; + /** + * + * + *
+   * Under-exposed likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + public int getUnderExposedLikelihoodValue() { + return underExposedLikelihood_; + } + /** + * + * + *
+   * Under-exposed likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getUnderExposedLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(underExposedLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int BLURRED_LIKELIHOOD_FIELD_NUMBER = 14; + private int blurredLikelihood_; + /** + * + * + *
+   * Blurred likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + public int getBlurredLikelihoodValue() { + return blurredLikelihood_; + } + /** + * + * + *
+   * Blurred likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getBlurredLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(blurredLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int HEADWEAR_LIKELIHOOD_FIELD_NUMBER = 15; + private int headwearLikelihood_; + /** + * + * + *
+   * Headwear likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + public int getHeadwearLikelihoodValue() { + return headwearLikelihood_; + } + /** + * + * + *
+   * Headwear likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getHeadwearLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(headwearLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(9, joyLikelihood_); + } + if (sorrowLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(10, sorrowLikelihood_); + } + if (angerLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(11, angerLikelihood_); + } + if (surpriseLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(12, surpriseLikelihood_); + } + if (underExposedLikelihood_ + != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(13, underExposedLikelihood_); + } + if (blurredLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(14, blurredLikelihood_); + } + if (headwearLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(15, headwearLikelihood_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, joyLikelihood_); + } + if (sorrowLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, sorrowLikelihood_); + } + if (angerLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, angerLikelihood_); + } + if (surpriseLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, surpriseLikelihood_); + } + if (underExposedLikelihood_ + != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, underExposedLikelihood_); + } + if (blurredLikelihood_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(14, blurredLikelihood_); + } + if (headwearLikelihood_ != com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.FaceAnnotation other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.FaceAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A face annotation object contains the results of face detection.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.FaceAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.FaceAnnotation) + com.google.cloud.vision.v1p4beta1.FaceAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.FaceAnnotation.class, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.FaceAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.FaceAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.FaceAnnotation build() { + com.google.cloud.vision.v1p4beta1.FaceAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.FaceAnnotation buildPartial() { + com.google.cloud.vision.v1p4beta1.FaceAnnotation result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.FaceAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.FaceAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.FaceAnnotation other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.FaceAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.FaceAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + boundingPolyBuilder_; + /** + * + * + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale.
+     * 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.v1p4beta1.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.
+     * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.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.
+     * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p4beta1.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.
+     * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p4beta1.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.
+     * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p4beta1.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.
+     * 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.v1p4beta1.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.
+     * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.
+     * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + } + /** + * + * + *
+     * The bounding polygon around the face. The coordinates of the bounding box
+     * are in the original image's scale.
+     * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), getParentForChildren(), isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.BoundingPoly fdBoundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getFdBoundingPoly() { + if (fdBoundingPolyBuilder_ == null) { + return fdBoundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + public Builder setFdBoundingPoly(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + public Builder setFdBoundingPoly( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + public Builder mergeFdBoundingPoly(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (fdBoundingPolyBuilder_ == null) { + if (fdBoundingPoly_ != null) { + fdBoundingPoly_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getFdBoundingPolyOrBuilder() { + if (fdBoundingPolyBuilder_ != null) { + return fdBoundingPolyBuilder_.getMessageOrBuilder(); + } else { + return fdBoundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getFdBoundingPolyFieldBuilder() { + if (fdBoundingPolyBuilder_ == null) { + fdBoundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Builder, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.LandmarkOrBuilder> + landmarksBuilder_; + + /** + * + * + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public int getLandmarksCount() { + if (landmarksBuilder_ == null) { + return landmarks_.size(); + } else { + return landmarksBuilder_.getCount(); + } + } + /** + * + * + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark getLandmarks(int index) { + if (landmarksBuilder_ == null) { + return landmarks_.get(index); + } else { + return landmarksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder setLandmarks( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder setLandmarks( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addLandmarks(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addLandmarks( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addLandmarks( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public Builder addLandmarks( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Builder getLandmarksBuilder( + int index) { + return getLandmarksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.LandmarkOrBuilder getLandmarksOrBuilder( + int index) { + if (landmarksBuilder_ == null) { + return landmarks_.get(index); + } else { + return landmarksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.FaceAnnotation.LandmarkOrBuilder> + getLandmarksOrBuilderList() { + if (landmarksBuilder_ != null) { + return landmarksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(landmarks_); + } + } + /** + * + * + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Builder addLandmarksBuilder() { + return getLandmarksFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.getDefaultInstance()); + } + /** + * + * + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Builder addLandmarksBuilder( + int index) { + return getLandmarksFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.getDefaultInstance()); + } + /** + * + * + *
+     * Detected face landmarks.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + public java.util.List + getLandmarksBuilderList() { + return getLandmarksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Builder, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.LandmarkOrBuilder> + getLandmarksFieldBuilder() { + if (landmarksBuilder_ == null) { + landmarksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark, + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Likelihood joy_likelihood = 9; + */ + public int getJoyLikelihoodValue() { + return joyLikelihood_; + } + /** + * + * + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood joy_likelihood = 9; + */ + public Builder setJoyLikelihoodValue(int value) { + joyLikelihood_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood joy_likelihood = 9; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getJoyLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(joyLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood joy_likelihood = 9; + */ + public Builder setJoyLikelihood(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + joyLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Joy likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood joy_likelihood = 9; + */ + public Builder clearJoyLikelihood() { + + joyLikelihood_ = 0; + onChanged(); + return this; + } + + private int sorrowLikelihood_ = 0; + /** + * + * + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + public int getSorrowLikelihoodValue() { + return sorrowLikelihood_; + } + /** + * + * + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + public Builder setSorrowLikelihoodValue(int value) { + sorrowLikelihood_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getSorrowLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(sorrowLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + public Builder setSorrowLikelihood(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + sorrowLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Sorrow likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + public Builder clearSorrowLikelihood() { + + sorrowLikelihood_ = 0; + onChanged(); + return this; + } + + private int angerLikelihood_ = 0; + /** + * + * + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + public int getAngerLikelihoodValue() { + return angerLikelihood_; + } + /** + * + * + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + public Builder setAngerLikelihoodValue(int value) { + angerLikelihood_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getAngerLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(angerLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + public Builder setAngerLikelihood(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + angerLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Anger likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + public Builder clearAngerLikelihood() { + + angerLikelihood_ = 0; + onChanged(); + return this; + } + + private int surpriseLikelihood_ = 0; + /** + * + * + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + public int getSurpriseLikelihoodValue() { + return surpriseLikelihood_; + } + /** + * + * + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + public Builder setSurpriseLikelihoodValue(int value) { + surpriseLikelihood_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getSurpriseLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(surpriseLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + public Builder setSurpriseLikelihood(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + surpriseLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Surprise likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + public Builder clearSurpriseLikelihood() { + + surpriseLikelihood_ = 0; + onChanged(); + return this; + } + + private int underExposedLikelihood_ = 0; + /** + * + * + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + public int getUnderExposedLikelihoodValue() { + return underExposedLikelihood_; + } + /** + * + * + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + public Builder setUnderExposedLikelihoodValue(int value) { + underExposedLikelihood_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getUnderExposedLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(underExposedLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + public Builder setUnderExposedLikelihood(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + underExposedLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Under-exposed likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + public Builder clearUnderExposedLikelihood() { + + underExposedLikelihood_ = 0; + onChanged(); + return this; + } + + private int blurredLikelihood_ = 0; + /** + * + * + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + public int getBlurredLikelihoodValue() { + return blurredLikelihood_; + } + /** + * + * + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + public Builder setBlurredLikelihoodValue(int value) { + blurredLikelihood_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getBlurredLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(blurredLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + public Builder setBlurredLikelihood(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + blurredLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Blurred likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + public Builder clearBlurredLikelihood() { + + blurredLikelihood_ = 0; + onChanged(); + return this; + } + + private int headwearLikelihood_ = 0; + /** + * + * + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + public int getHeadwearLikelihoodValue() { + return headwearLikelihood_; + } + /** + * + * + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + public Builder setHeadwearLikelihoodValue(int value) { + headwearLikelihood_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getHeadwearLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(headwearLikelihood_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + public Builder setHeadwearLikelihood(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + headwearLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Headwear likelihood.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + public Builder clearHeadwearLikelihood() { + + headwearLikelihood_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.FaceAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.FaceAnnotation) + private static final com.google.cloud.vision.v1p4beta1.FaceAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.FaceAnnotation(); + } + + public static com.google.cloud.vision.v1p4beta1.FaceAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.FaceAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FaceAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FaceAnnotationOrBuilder.java new file mode 100644 index 000000000000..c9571051a28f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FaceAnnotationOrBuilder.java @@ -0,0 +1,365 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface FaceAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.FaceAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale.
+   * 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.v1p4beta1.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.
+   * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly(); + /** + * + * + *
+   * The bounding polygon around the face. The coordinates of the bounding box
+   * are in the original image's scale.
+   * 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.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly fd_bounding_poly = 2; + */ + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getFdBoundingPolyOrBuilder(); + + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + java.util.List getLandmarksList(); + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + com.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark getLandmarks(int index); + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + int getLandmarksCount(); + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + java.util.List + getLandmarksOrBuilderList(); + /** + * + * + *
+   * Detected face landmarks.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark landmarks = 3; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Likelihood joy_likelihood = 9; + */ + int getJoyLikelihoodValue(); + /** + * + * + *
+   * Joy likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood joy_likelihood = 9; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getJoyLikelihood(); + + /** + * + * + *
+   * Sorrow likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + int getSorrowLikelihoodValue(); + /** + * + * + *
+   * Sorrow likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood sorrow_likelihood = 10; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getSorrowLikelihood(); + + /** + * + * + *
+   * Anger likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + int getAngerLikelihoodValue(); + /** + * + * + *
+   * Anger likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood anger_likelihood = 11; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getAngerLikelihood(); + + /** + * + * + *
+   * Surprise likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + int getSurpriseLikelihoodValue(); + /** + * + * + *
+   * Surprise likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood surprise_likelihood = 12; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getSurpriseLikelihood(); + + /** + * + * + *
+   * Under-exposed likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + int getUnderExposedLikelihoodValue(); + /** + * + * + *
+   * Under-exposed likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood under_exposed_likelihood = 13; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getUnderExposedLikelihood(); + + /** + * + * + *
+   * Blurred likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + int getBlurredLikelihoodValue(); + /** + * + * + *
+   * Blurred likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood blurred_likelihood = 14; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getBlurredLikelihood(); + + /** + * + * + *
+   * Headwear likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + int getHeadwearLikelihoodValue(); + /** + * + * + *
+   * Headwear likelihood.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood headwear_likelihood = 15; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getHeadwearLikelihood(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Feature.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Feature.java new file mode 100644 index 000000000000..01b2dea5878b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Feature.java @@ -0,0 +1,1203 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.Feature} + */ +public final class Feature extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Feature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Feature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Feature.class, + com.google.cloud.vision.v1p4beta1.Feature.Builder.class); + } + + /** + * + * + *
+   * Type of Google Cloud Vision API feature to be extracted.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p4beta1.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 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.v1p4beta1.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.v1p4beta1.Feature.Type) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * + * + *
+   * The feature type.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Feature.Type type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * The feature type.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Feature.Type type = 1; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Feature.Type result = + com.google.cloud.vision.v1p4beta1.Feature.Type.valueOf(type_); + return result == null ? com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ != com.google.cloud.vision.v1p4beta1.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); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Feature other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Feature parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Feature prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The 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.v1p4beta1.Feature} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Feature) + com.google.cloud.vision.v1p4beta1.FeatureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Feature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Feature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Feature.class, + com.google.cloud.vision.v1p4beta1.Feature.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + + maxResults_ = 0; + + model_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Feature_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Feature getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Feature.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Feature build() { + com.google.cloud.vision.v1p4beta1.Feature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Feature buildPartial() { + com.google.cloud.vision.v1p4beta1.Feature result = + new com.google.cloud.vision.v1p4beta1.Feature(this); + result.type_ = type_; + result.maxResults_ = maxResults_; + result.model_ = model_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Feature) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Feature) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Feature other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Feature parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.Feature) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Feature.Type type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Feature.Type type = 1; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Feature.Type type = 1; + */ + public com.google.cloud.vision.v1p4beta1.Feature.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Feature.Type result = + com.google.cloud.vision.v1p4beta1.Feature.Type.valueOf(type_); + return result == null ? com.google.cloud.vision.v1p4beta1.Feature.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Feature.Type type = 1; + */ + public Builder setType(com.google.cloud.vision.v1p4beta1.Feature.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The feature type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Feature) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Feature) + private static final com.google.cloud.vision.v1p4beta1.Feature DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Feature(); + } + + public static com.google.cloud.vision.v1p4beta1.Feature getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Feature getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FeatureOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FeatureOrBuilder.java new file mode 100644 index 000000000000..5e653b0e0efd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/FeatureOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface FeatureOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.Feature) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The feature type.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Feature.Type type = 1; + */ + int getTypeValue(); + /** + * + * + *
+   * The feature type.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Feature.Type type = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsDestination.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsDestination.java new file mode 100644 index 000000000000..b4a3953746ee --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsDestination.java @@ -0,0 +1,675 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * The Google Cloud Storage location where the output will be written to.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GcsDestination} + */ +public final class GcsDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GcsDestination.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.GcsDestination)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.GcsDestination other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsDestination parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.GcsDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location where the output will be written to.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GcsDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.GcsDestination) + com.google.cloud.vision.v1p4beta1.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GcsDestination.class, + com.google.cloud.vision.v1p4beta1.GcsDestination.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.GcsDestination.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GcsDestination getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.GcsDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GcsDestination build() { + com.google.cloud.vision.v1p4beta1.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GcsDestination buildPartial() { + com.google.cloud.vision.v1p4beta1.GcsDestination result = + new com.google.cloud.vision.v1p4beta1.GcsDestination(this); + result.uri_ = uri_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.GcsDestination) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.GcsDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.GcsDestination other) { + if (other == com.google.cloud.vision.v1p4beta1.GcsDestination.getDefaultInstance()) + return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.GcsDestination parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GcsDestination) + private static final com.google.cloud.vision.v1p4beta1.GcsDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.GcsDestination(); + } + + public static com.google.cloud.vision.v1p4beta1.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsDestination(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsDestinationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsDestinationOrBuilder.java new file mode 100644 index 000000000000..4c3766914b2f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsDestinationOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface GcsDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsSource.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsSource.java new file mode 100644 index 000000000000..a424c7d422dc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsSource.java @@ -0,0 +1,604 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * The Google Cloud Storage location where the input will be read from.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GcsSource.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.GcsSource other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.GcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location where the input will be read from.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.GcsSource) + com.google.cloud.vision.v1p4beta1.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GcsSource.class, + com.google.cloud.vision.v1p4beta1.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.GcsSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GcsSource getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GcsSource build() { + com.google.cloud.vision.v1p4beta1.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GcsSource buildPartial() { + com.google.cloud.vision.v1p4beta1.GcsSource result = + new com.google.cloud.vision.v1p4beta1.GcsSource(this); + result.uri_ = uri_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.GcsSource) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.GcsSource other) { + if (other == com.google.cloud.vision.v1p4beta1.GcsSource.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.GcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GcsSource) + private static final com.google.cloud.vision.v1p4beta1.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.GcsSource(); + } + + public static com.google.cloud.vision.v1p4beta1.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsSourceOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsSourceOrBuilder.java new file mode 100644 index 000000000000..362bbe246482 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GcsSourceOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GeometryProto.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GeometryProto.java new file mode 100644 index 000000000000..c3f6aa9a38dd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GeometryProto.java @@ -0,0 +1,104 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +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_v1p4beta1_Vertex_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Vertex_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Position_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_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/v1p4beta1/geometry" + + ".proto\022\035google.cloud.vision.v1p4beta1\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" + + "1p4beta1.Vertex\022L\n\023normalized_vertices\030\002" + + " \003(\0132/.google.cloud.vision.v1p4beta1.Nor" + + "malizedVertex\"+\n\010Position\022\t\n\001x\030\001 \001(\002\022\t\n\001" + + "y\030\002 \001(\002\022\t\n\001z\030\003 \001(\002B\203\001\n!com.google.cloud." + + "vision.v1p4beta1B\rGeometryProtoP\001ZCgoogl" + + "e.golang.org/genproto/googleapis/cloud/v" + + "ision/v1p4beta1;vision\370\001\001\242\002\004GCVNb\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_vision_v1p4beta1_Vertex_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p4beta1_Vertex_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Vertex_descriptor, + new java.lang.String[] { + "X", "Y", + }); + internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_descriptor, + new java.lang.String[] { + "X", "Y", + }); + internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_BoundingPoly_descriptor, + new java.lang.String[] { + "Vertices", "NormalizedVertices", + }); + internal_static_google_cloud_vision_v1p4beta1_Position_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vision_v1p4beta1_Position_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductRequest.java new file mode 100644 index 000000000000..5d5f3c3a2b85 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductRequest.java @@ -0,0 +1,613 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `GetProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GetProductRequest} + */ +public final class GetProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GetProductRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p4beta1.GetProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.GetProductRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.GetProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `GetProduct` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GetProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.GetProductRequest) + com.google.cloud.vision.v1p4beta1.GetProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GetProductRequest.class, + com.google.cloud.vision.v1p4beta1.GetProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.GetProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetProductRequest build() { + com.google.cloud.vision.v1p4beta1.GetProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetProductRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.GetProductRequest result = + new com.google.cloud.vision.v1p4beta1.GetProductRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.GetProductRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.GetProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.GetProductRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.GetProductRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.GetProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.GetProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GetProductRequest) + private static final com.google.cloud.vision.v1p4beta1.GetProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.GetProductRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.GetProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductRequestOrBuilder.java new file mode 100644 index 000000000000..88e70a96d6c8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface GetProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductSetRequest.java new file mode 100644 index 000000000000..b85005c6e9f7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductSetRequest.java @@ -0,0 +1,614 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `GetProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GetProductSetRequest} + */ +public final class GetProductSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GetProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p4beta1.GetProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.GetProductSetRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetProductSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.GetProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `GetProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GetProductSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.GetProductSetRequest) + com.google.cloud.vision.v1p4beta1.GetProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GetProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.GetProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.GetProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetProductSetRequest build() { + com.google.cloud.vision.v1p4beta1.GetProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetProductSetRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.GetProductSetRequest result = + new com.google.cloud.vision.v1p4beta1.GetProductSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.GetProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.GetProductSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.GetProductSetRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.GetProductSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.GetProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.GetProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GetProductSetRequest) + private static final com.google.cloud.vision.v1p4beta1.GetProductSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.GetProductSetRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.GetProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..1aa5f141d5fa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetProductSetRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface GetProductSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetReferenceImageRequest.java new file mode 100644 index 000000000000..8b891a5fb5e9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetReferenceImageRequest.java @@ -0,0 +1,614 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `GetReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GetReferenceImageRequest} + */ +public final class GetReferenceImageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetReferenceImageRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GetReferenceImageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `GetReferenceImage` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.GetReferenceImageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.GetReferenceImageRequest) + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest.class, + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest build() { + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest result = + new com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.GetReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GetReferenceImageRequest) + private static final com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..a903257d7988 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/GetReferenceImageRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface GetReferenceImageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Image.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Image.java new file mode 100644 index 000000000000..ca0ac903b04c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Image.java @@ -0,0 +1,817 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Client image to perform Google Cloud Vision API tasks over.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Image} + */ +public final class Image extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + content_ = input.readBytes(); + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.ImageSource.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ImageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Image.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImageSource getSource() { + return source_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImageSourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!content_.isEmpty()) { + output.writeBytes(1, content_); + } + if (source_ != null) { + output.writeMessage(2, getSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.Image)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Image other = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Image parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Image parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Image parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Image parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Image parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Image prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Client image to perform Google Cloud Vision API tasks over.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Image} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Image) + com.google.cloud.vision.v1p4beta1.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Image.class, + com.google.cloud.vision.v1p4beta1.Image.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.Image.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = com.google.protobuf.ByteString.EMPTY; + + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Image_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Image getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Image.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Image build() { + com.google.cloud.vision.v1p4beta1.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Image buildPartial() { + com.google.cloud.vision.v1p4beta1.Image result = + new com.google.cloud.vision.v1p4beta1.Image(this); + result.content_ = content_; + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Image) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Image) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Image other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Image parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource source_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageSource, + com.google.cloud.vision.v1p4beta1.ImageSource.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImageSource getSource() { + if (sourceBuilder_ == null) { + return source_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + public Builder setSource(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + public Builder setSource( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + public Builder mergeSource(com.google.cloud.vision.v1p4beta1.ImageSource value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImageSourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageSource, + com.google.cloud.vision.v1p4beta1.ImageSource.Builder, + com.google.cloud.vision.v1p4beta1.ImageSourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImageSource, + com.google.cloud.vision.v1p4beta1.ImageSource.Builder, + com.google.cloud.vision.v1p4beta1.ImageSourceOrBuilder>( + getSource(), getParentForChildren(), isClean()); + source_ = null; + } + return sourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Image) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Image) + private static final com.google.cloud.vision.v1p4beta1.Image DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Image(); + } + + public static com.google.cloud.vision.v1p4beta1.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Image(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotationContext.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotationContext.java new file mode 100644 index 000000000000..5b297f5c2b80 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotationContext.java @@ -0,0 +1,686 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.ImageAnnotationContext} + */ +public final class ImageAnnotationContext extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 16: + { + pageNumber_ = input.readInt32(); + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (pageNumber_ != 0) { + output.writeInt32(2, pageNumber_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.ImageAnnotationContext)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotationContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * 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.v1p4beta1.ImageAnnotationContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ImageAnnotationContext) + com.google.cloud.vision.v1p4beta1.ImageAnnotationContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.class, + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uri_ = ""; + + pageNumber_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContext getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotationContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContext build() { + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContext buildPartial() { + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext result = + new com.google.cloud.vision.v1p4beta1.ImageAnnotationContext(this); + result.uri_ = uri_; + result.pageNumber_ = pageNumber_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ImageAnnotationContext) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ImageAnnotationContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ImageAnnotationContext other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ImageAnnotationContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ImageAnnotationContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImageAnnotationContext) + private static final com.google.cloud.vision.v1p4beta1.ImageAnnotationContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ImageAnnotationContext(); + } + + public static com.google.cloud.vision.v1p4beta1.ImageAnnotationContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageAnnotationContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotationContextOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotationContextOrBuilder.java new file mode 100644 index 000000000000..933a7c1a1d79 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotationContextOrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImageAnnotationContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorProto.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorProto.java new file mode 100644 index 000000000000..cab42d838012 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorProto.java @@ -0,0 +1,812 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +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_v1p4beta1_Feature_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Feature_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ImageSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ImageSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Image_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Image_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_LocationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_LocationInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Property_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Property_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_LatLongRect_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_LatLongRect_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ColorInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ColorInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ImageProperties_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ImageProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_CropHint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_CropHint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ImageContext_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ImageContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_InputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_InputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_OutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_GcsDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_GcsDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_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/v1p4beta1/image_an" + + "notator.proto\022\035google.cloud.vision.v1p4b" + + "eta1\032\034google/api/annotations.proto\032,goog" + + "le/cloud/vision/v1p4beta1/geometry.proto" + + "\0322google/cloud/vision/v1p4beta1/product_" + + "search.proto\0323google/cloud/vision/v1p4be" + + "ta1/text_annotation.proto\0321google/cloud/" + + "vision/v1p4beta1/web_detection.proto\032#go" + + "ogle/longrunning/operations.proto\032 googl" + + "e/protobuf/field_mask.proto\032\037google/prot" + + "obuf/timestamp.proto\032\027google/rpc/status." + + "proto\032\027google/type/color.proto\032\030google/t" + + "ype/latlng.proto\"\216\003\n\007Feature\0229\n\004type\030\001 \001" + + "(\0162+.google.cloud.vision.v1p4beta1.Featu" + + "re.Type\022\023\n\013max_results\030\002 \001(\005\022\r\n\005model\030\003 " + + "\001(\t\"\243\002\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\022\n\016FA" + + "CE_DETECTION\020\001\022\026\n\022LANDMARK_DETECTION\020\002\022\022" + + "\n\016LOGO_DETECTION\020\003\022\023\n\017LABEL_DETECTION\020\004\022" + + "\022\n\016TEXT_DETECTION\020\005\022\033\n\027DOCUMENT_TEXT_DET" + + "ECTION\020\013\022\031\n\025SAFE_SEARCH_DETECTION\020\006\022\024\n\020I" + + "MAGE_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\023OBJE" + + "CT_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\005Im" + + "age\022\017\n\007content\030\001 \001(\014\022:\n\006source\030\002 \001(\0132*.g" + + "oogle.cloud.vision.v1p4beta1.ImageSource" + + "\"\233\016\n\016FaceAnnotation\022B\n\rbounding_poly\030\001 \001" + + "(\0132+.google.cloud.vision.v1p4beta1.Bound" + + "ingPoly\022E\n\020fd_bounding_poly\030\002 \001(\0132+.goog" + + "le.cloud.vision.v1p4beta1.BoundingPoly\022I" + + "\n\tlandmarks\030\003 \003(\01326.google.cloud.vision." + + "v1p4beta1.FaceAnnotation.Landmark\022\022\n\nrol" + + "l_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_confidence\030\007 \001" + + "(\002\022\036\n\026landmarking_confidence\030\010 \001(\002\022A\n\016jo" + + "y_likelihood\030\t \001(\0162).google.cloud.vision" + + ".v1p4beta1.Likelihood\022D\n\021sorrow_likeliho" + + "od\030\n \001(\0162).google.cloud.vision.v1p4beta1" + + ".Likelihood\022C\n\020anger_likelihood\030\013 \001(\0162)." + + "google.cloud.vision.v1p4beta1.Likelihood" + + "\022F\n\023surprise_likelihood\030\014 \001(\0162).google.c" + + "loud.vision.v1p4beta1.Likelihood\022K\n\030unde" + + "r_exposed_likelihood\030\r \001(\0162).google.clou" + + "d.vision.v1p4beta1.Likelihood\022E\n\022blurred" + + "_likelihood\030\016 \001(\0162).google.cloud.vision." + + "v1p4beta1.Likelihood\022F\n\023headwear_likelih" + + "ood\030\017 \001(\0162).google.cloud.vision.v1p4beta" + + "1.Likelihood\032\307\007\n\010Landmark\022I\n\004type\030\003 \001(\0162" + + ";.google.cloud.vision.v1p4beta1.FaceAnno" + + "tation.Landmark.Type\0229\n\010position\030\004 \001(\0132\'" + + ".google.cloud.vision.v1p4beta1.Position\"" + + "\264\006\n\004Type\022\024\n\020UNKNOWN_LANDMARK\020\000\022\014\n\010LEFT_E" + + "YE\020\001\022\r\n\tRIGHT_EYE\020\002\022\030\n\024LEFT_OF_LEFT_EYEB" + + "ROW\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_RIGHT_EY" + + "EBROW\020\006\022\031\n\025MIDPOINT_BETWEEN_EYES\020\007\022\014\n\010NO" + + "SE_TIP\020\010\022\r\n\tUPPER_LIP\020\t\022\r\n\tLOWER_LIP\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_CENTER\020\020\022\031" + + "\n\025LEFT_EYE_TOP_BOUNDARY\020\021\022\031\n\025LEFT_EYE_RI" + + "GHT_CORNER\020\022\022\034\n\030LEFT_EYE_BOTTOM_BOUNDARY" + + "\020\023\022\030\n\024LEFT_EYE_LEFT_CORNER\020\024\022\032\n\026RIGHT_EY" + + "E_TOP_BOUNDARY\020\025\022\032\n\026RIGHT_EYE_RIGHT_CORN" + + "ER\020\026\022\035\n\031RIGHT_EYE_BOTTOM_BOUNDARY\020\027\022\031\n\025R" + + "IGHT_EYE_LEFT_CORNER\020\030\022\037\n\033LEFT_EYEBROW_U" + + "PPER_MIDPOINT\020\031\022 \n\034RIGHT_EYEBROW_UPPER_M" + + "IDPOINT\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\017RI" + + "GHT_EYE_PUPIL\020\036\022\025\n\021FOREHEAD_GLABELLA\020\037\022\021" + + "\n\rCHIN_GNATHION\020 \022\024\n\020CHIN_LEFT_GONION\020!\022" + + "\025\n\021CHIN_RIGHT_GONION\020\"\"4\n\014LocationInfo\022$" + + "\n\007lat_lng\030\001 \001(\0132\023.google.type.LatLng\"=\n\010" + + "Property\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\"\300\002\n\020EntityAnnotation" + + "\022\013\n\003mid\030\001 \001(\t\022\016\n\006locale\030\002 \001(\t\022\023\n\013descrip" + + "tion\030\003 \001(\t\022\r\n\005score\030\004 \001(\002\022\026\n\nconfidence\030" + + "\005 \001(\002B\002\030\001\022\022\n\ntopicality\030\006 \001(\002\022B\n\rboundin" + + "g_poly\030\007 \001(\0132+.google.cloud.vision.v1p4b" + + "eta1.BoundingPoly\022>\n\tlocations\030\010 \003(\0132+.g" + + "oogle.cloud.vision.v1p4beta1.LocationInf" + + "o\022;\n\nproperties\030\t \003(\0132\'.google.cloud.vis" + + "ion.v1p4beta1.Property\"\240\001\n\031LocalizedObje" + + "ctAnnotation\022\013\n\003mid\030\001 \001(\t\022\025\n\rlanguage_co" + + "de\030\002 \001(\t\022\014\n\004name\030\003 \001(\t\022\r\n\005score\030\004 \001(\002\022B\n" + + "\rbounding_poly\030\005 \001(\0132+.google.cloud.visi" + + "on.v1p4beta1.BoundingPoly\"\274\002\n\024SafeSearch" + + "Annotation\0228\n\005adult\030\001 \001(\0162).google.cloud" + + ".vision.v1p4beta1.Likelihood\0228\n\005spoof\030\002 " + + "\001(\0162).google.cloud.vision.v1p4beta1.Like" + + "lihood\022:\n\007medical\030\003 \001(\0162).google.cloud.v" + + "ision.v1p4beta1.Likelihood\022;\n\010violence\030\004" + + " \001(\0162).google.cloud.vision.v1p4beta1.Lik" + + "elihood\0227\n\004racy\030\t \001(\0162).google.cloud.vis" + + "ion.v1p4beta1.Likelihood\"a\n\013LatLongRect\022" + + "(\n\013min_lat_lng\030\001 \001(\0132\023.google.type.LatLn" + + "g\022(\n\013max_lat_lng\030\002 \001(\0132\023.google.type.Lat" + + "Lng\"U\n\tColorInfo\022!\n\005color\030\001 \001(\0132\022.google" + + ".type.Color\022\r\n\005score\030\002 \001(\002\022\026\n\016pixel_frac" + + "tion\030\003 \001(\002\"T\n\030DominantColorsAnnotation\0228" + + "\n\006colors\030\001 \003(\0132(.google.cloud.vision.v1p" + + "4beta1.ColorInfo\"c\n\017ImageProperties\022P\n\017d" + + "ominant_colors\030\001 \001(\01327.google.cloud.visi" + + "on.v1p4beta1.DominantColorsAnnotation\"\177\n" + + "\010CropHint\022B\n\rbounding_poly\030\001 \001(\0132+.googl" + + "e.cloud.vision.v1p4beta1.BoundingPoly\022\022\n" + + "\nconfidence\030\002 \001(\002\022\033\n\023importance_fraction" + + "\030\003 \001(\002\"R\n\023CropHintsAnnotation\022;\n\ncrop_hi" + + "nts\030\001 \003(\0132\'.google.cloud.vision.v1p4beta" + + "1.CropHint\"(\n\017CropHintsParams\022\025\n\raspect_" + + "ratios\030\001 \003(\002\"1\n\022WebDetectionParams\022\033\n\023in" + + "clude_geo_results\030\002 \001(\010\"\330\002\n\014ImageContext" + + "\022A\n\rlat_long_rect\030\001 \001(\0132*.google.cloud.v" + + "ision.v1p4beta1.LatLongRect\022\026\n\016language_" + + "hints\030\002 \003(\t\022I\n\021crop_hints_params\030\004 \001(\0132." + + ".google.cloud.vision.v1p4beta1.CropHints" + + "Params\022Q\n\025product_search_params\030\005 \001(\01322." + + "google.cloud.vision.v1p4beta1.ProductSea" + + "rchParams\022O\n\024web_detection_params\030\006 \001(\0132" + + "1.google.cloud.vision.v1p4beta1.WebDetec" + + "tionParams\"\311\001\n\024AnnotateImageRequest\0223\n\005i" + + "mage\030\001 \001(\0132$.google.cloud.vision.v1p4bet" + + "a1.Image\0228\n\010features\030\002 \003(\0132&.google.clou" + + "d.vision.v1p4beta1.Feature\022B\n\rimage_cont" + + "ext\030\003 \001(\0132+.google.cloud.vision.v1p4beta" + + "1.ImageContext\":\n\026ImageAnnotationContext" + + "\022\013\n\003uri\030\001 \001(\t\022\023\n\013page_number\030\002 \001(\005\"\277\010\n\025A" + + "nnotateImageResponse\022G\n\020face_annotations" + + "\030\001 \003(\0132-.google.cloud.vision.v1p4beta1.F" + + "aceAnnotation\022M\n\024landmark_annotations\030\002 " + + "\003(\0132/.google.cloud.vision.v1p4beta1.Enti" + + "tyAnnotation\022I\n\020logo_annotations\030\003 \003(\0132/" + + ".google.cloud.vision.v1p4beta1.EntityAnn" + + "otation\022J\n\021label_annotations\030\004 \003(\0132/.goo" + + "gle.cloud.vision.v1p4beta1.EntityAnnotat" + + "ion\022^\n\034localized_object_annotations\030\026 \003(" + + "\01328.google.cloud.vision.v1p4beta1.Locali" + + "zedObjectAnnotation\022I\n\020text_annotations\030" + + "\005 \003(\0132/.google.cloud.vision.v1p4beta1.En" + + "tityAnnotation\022K\n\024full_text_annotation\030\014" + + " \001(\0132-.google.cloud.vision.v1p4beta1.Tex" + + "tAnnotation\022S\n\026safe_search_annotation\030\006 " + + "\001(\01323.google.cloud.vision.v1p4beta1.Safe" + + "SearchAnnotation\022S\n\033image_properties_ann" + + "otation\030\010 \001(\0132..google.cloud.vision.v1p4" + + "beta1.ImageProperties\022Q\n\025crop_hints_anno" + + "tation\030\013 \001(\01322.google.cloud.vision.v1p4b" + + "eta1.CropHintsAnnotation\022B\n\rweb_detectio" + + "n\030\r \001(\0132+.google.cloud.vision.v1p4beta1." + + "WebDetection\022S\n\026product_search_results\030\016" + + " \001(\01323.google.cloud.vision.v1p4beta1.Pro" + + "ductSearchResults\022!\n\005error\030\t \001(\0132\022.googl" + + "e.rpc.Status\022F\n\007context\030\025 \001(\01325.google.c" + + "loud.vision.v1p4beta1.ImageAnnotationCon" + + "text\"\266\001\n\024AnnotateFileResponse\022@\n\014input_c" + + "onfig\030\001 \001(\0132*.google.cloud.vision.v1p4be" + + "ta1.InputConfig\022G\n\tresponses\030\002 \003(\01324.goo" + + "gle.cloud.vision.v1p4beta1.AnnotateImage" + + "Response\022\023\n\013total_pages\030\003 \001(\005\"c\n\032BatchAn" + + "notateImagesRequest\022E\n\010requests\030\001 \003(\01323." + + "google.cloud.vision.v1p4beta1.AnnotateIm" + + "ageRequest\"f\n\033BatchAnnotateImagesRespons" + + "e\022G\n\tresponses\030\001 \003(\01324.google.cloud.visi" + + "on.v1p4beta1.AnnotateImageResponse\"\344\001\n\023A" + + "nnotateFileRequest\022@\n\014input_config\030\001 \001(\013" + + "2*.google.cloud.vision.v1p4beta1.InputCo" + + "nfig\0228\n\010features\030\002 \003(\0132&.google.cloud.vi" + + "sion.v1p4beta1.Feature\022B\n\rimage_context\030" + + "\003 \001(\0132+.google.cloud.vision.v1p4beta1.Im" + + "ageContext\022\r\n\005pages\030\004 \003(\005\"a\n\031BatchAnnota" + + "teFilesRequest\022D\n\010requests\030\001 \003(\01322.googl" + + "e.cloud.vision.v1p4beta1.AnnotateFileReq" + + "uest\"d\n\032BatchAnnotateFilesResponse\022F\n\tre" + + "sponses\030\001 \003(\01323.google.cloud.vision.v1p4" + + "beta1.AnnotateFileResponse\"\236\002\n\030AsyncAnno" + + "tateFileRequest\022@\n\014input_config\030\001 \001(\0132*." + + "google.cloud.vision.v1p4beta1.InputConfi" + + "g\0228\n\010features\030\002 \003(\0132&.google.cloud.visio" + + "n.v1p4beta1.Feature\022B\n\rimage_context\030\003 \001" + + "(\0132+.google.cloud.vision.v1p4beta1.Image" + + "Context\022B\n\routput_config\030\004 \001(\0132+.google." + + "cloud.vision.v1p4beta1.OutputConfig\"_\n\031A" + + "syncAnnotateFileResponse\022B\n\routput_confi" + + "g\030\001 \001(\0132+.google.cloud.vision.v1p4beta1." + + "OutputConfig\"\254\001\n\037AsyncBatchAnnotateImage" + + "sRequest\022E\n\010requests\030\001 \003(\01323.google.clou" + + "d.vision.v1p4beta1.AnnotateImageRequest\022" + + "B\n\routput_config\030\002 \001(\0132+.google.cloud.vi" + + "sion.v1p4beta1.OutputConfig\"f\n AsyncBatc" + + "hAnnotateImagesResponse\022B\n\routput_config" + + "\030\001 \001(\0132+.google.cloud.vision.v1p4beta1.O" + + "utputConfig\"k\n\036AsyncBatchAnnotateFilesRe" + + "quest\022I\n\010requests\030\001 \003(\01327.google.cloud.v" + + "ision.v1p4beta1.AsyncAnnotateFileRequest" + + "\"n\n\037AsyncBatchAnnotateFilesResponse\022K\n\tr" + + "esponses\030\001 \003(\01328.google.cloud.vision.v1p" + + "4beta1.AsyncAnnotateFileResponse\"o\n\013Inpu" + + "tConfig\022<\n\ngcs_source\030\001 \001(\0132(.google.clo" + + "ud.vision.v1p4beta1.GcsSource\022\017\n\007content" + + "\030\003 \001(\014\022\021\n\tmime_type\030\002 \001(\t\"j\n\014OutputConfi" + + "g\022F\n\017gcs_destination\030\001 \001(\0132-.google.clou" + + "d.vision.v1p4beta1.GcsDestination\022\022\n\nbat" + + "ch_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\021Opera" + + "tionMetadata\022E\n\005state\030\001 \001(\01626.google.clo" + + "ud.vision.v1p4beta1.OperationMetadata.St" + + "ate\022/\n\013create_time\030\005 \001(\0132\032.google.protob" + + "uf.Timestamp\022/\n\013update_time\030\006 \001(\0132\032.goog" + + "le.protobuf.Timestamp\"Q\n\005State\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_UNLIKELY\020\001\022\014\n\010UNLIKE" + + "LY\020\002\022\014\n\010POSSIBLE\020\003\022\n\n\006LIKELY\020\004\022\017\n\013VERY_L" + + "IKELY\020\0052\317\005\n\016ImageAnnotator\022\263\001\n\023BatchAnno" + + "tateImages\0229.google.cloud.vision.v1p4bet" + + "a1.BatchAnnotateImagesRequest\032:.google.c" + + "loud.vision.v1p4beta1.BatchAnnotateImage" + + "sResponse\"%\202\323\344\223\002\037\"\032/v1p4beta1/images:ann" + + "otate:\001*\022\257\001\n\022BatchAnnotateFiles\0228.google" + + ".cloud.vision.v1p4beta1.BatchAnnotateFil" + + "esRequest\0329.google.cloud.vision.v1p4beta" + + "1.BatchAnnotateFilesResponse\"$\202\323\344\223\002\036\"\031/v" + + "1p4beta1/files:annotate:\001*\022\252\001\n\030AsyncBatc" + + "hAnnotateImages\022>.google.cloud.vision.v1" + + "p4beta1.AsyncBatchAnnotateImagesRequest\032" + + "\035.google.longrunning.Operation\"/\202\323\344\223\002)\"$" + + "/v1p4beta1/images:asyncBatchAnnotate:\001*\022" + + "\247\001\n\027AsyncBatchAnnotateFiles\022=.google.clo" + + "ud.vision.v1p4beta1.AsyncBatchAnnotateFi" + + "lesRequest\032\035.google.longrunning.Operatio" + + "n\".\202\323\344\223\002(\"#/v1p4beta1/files:asyncBatchAn" + + "notate:\001*B\211\001\n!com.google.cloud.vision.v1" + + "p4beta1B\023ImageAnnotatorProtoP\001ZCgoogle.g" + + "olang.org/genproto/googleapis/cloud/visi" + + "on/v1p4beta1;vision\370\001\001\242\002\004GCVNb\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.v1p4beta1.GeometryProto.getDescriptor(), + com.google.cloud.vision.v1p4beta1.ProductSearchProto.getDescriptor(), + com.google.cloud.vision.v1p4beta1.TextAnnotationProto.getDescriptor(), + com.google.cloud.vision.v1p4beta1.WebDetectionProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.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_v1p4beta1_Feature_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p4beta1_Feature_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Feature_descriptor, + new java.lang.String[] { + "Type", "MaxResults", "Model", + }); + internal_static_google_cloud_vision_v1p4beta1_ImageSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p4beta1_ImageSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ImageSource_descriptor, + new java.lang.String[] { + "GcsImageUri", "ImageUri", + }); + internal_static_google_cloud_vision_v1p4beta1_Image_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vision_v1p4beta1_Image_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Image_descriptor, + new java.lang.String[] { + "Content", "Source", + }); + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_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_v1p4beta1_FaceAnnotation_Landmark_descriptor = + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_FaceAnnotation_Landmark_descriptor, + new java.lang.String[] { + "Type", "Position", + }); + internal_static_google_cloud_vision_v1p4beta1_LocationInfo_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vision_v1p4beta1_LocationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_LocationInfo_descriptor, + new java.lang.String[] { + "LatLng", + }); + internal_static_google_cloud_vision_v1p4beta1_Property_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vision_v1p4beta1_Property_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Property_descriptor, + new java.lang.String[] { + "Name", "Value", "Uint64Value", + }); + internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_EntityAnnotation_descriptor, + new java.lang.String[] { + "Mid", + "Locale", + "Description", + "Score", + "Confidence", + "Topicality", + "BoundingPoly", + "Locations", + "Properties", + }); + internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_descriptor, + new java.lang.String[] { + "Mid", "LanguageCode", "Name", "Score", "BoundingPoly", + }); + internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_descriptor, + new java.lang.String[] { + "Adult", "Spoof", "Medical", "Violence", "Racy", + }); + internal_static_google_cloud_vision_v1p4beta1_LatLongRect_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_vision_v1p4beta1_LatLongRect_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_LatLongRect_descriptor, + new java.lang.String[] { + "MinLatLng", "MaxLatLng", + }); + internal_static_google_cloud_vision_v1p4beta1_ColorInfo_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_vision_v1p4beta1_ColorInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ColorInfo_descriptor, + new java.lang.String[] { + "Color", "Score", "PixelFraction", + }); + internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_DominantColorsAnnotation_descriptor, + new java.lang.String[] { + "Colors", + }); + internal_static_google_cloud_vision_v1p4beta1_ImageProperties_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_vision_v1p4beta1_ImageProperties_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ImageProperties_descriptor, + new java.lang.String[] { + "DominantColors", + }); + internal_static_google_cloud_vision_v1p4beta1_CropHint_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_vision_v1p4beta1_CropHint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_CropHint_descriptor, + new java.lang.String[] { + "BoundingPoly", "Confidence", "ImportanceFraction", + }); + internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_CropHintsAnnotation_descriptor, + new java.lang.String[] { + "CropHints", + }); + internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_CropHintsParams_descriptor, + new java.lang.String[] { + "AspectRatios", + }); + internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_descriptor, + new java.lang.String[] { + "IncludeGeoResults", + }); + internal_static_google_cloud_vision_v1p4beta1_ImageContext_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_vision_v1p4beta1_ImageContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ImageContext_descriptor, + new java.lang.String[] { + "LatLongRect", + "LanguageHints", + "CropHintsParams", + "ProductSearchParams", + "WebDetectionParams", + }); + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageRequest_descriptor, + new java.lang.String[] { + "Image", "Features", "ImageContext", + }); + internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ImageAnnotationContext_descriptor, + new java.lang.String[] { + "Uri", "PageNumber", + }); + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_vision_v1p4beta1_AnnotateImageResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_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_v1p4beta1_AnnotateFileResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileResponse_descriptor, + new java.lang.String[] { + "InputConfig", "Responses", "TotalPages", + }); + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesRequest_descriptor, + new java.lang.String[] { + "Requests", + }); + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateImagesResponse_descriptor, + new java.lang.String[] { + "Responses", + }); + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AnnotateFileRequest_descriptor, + new java.lang.String[] { + "InputConfig", "Features", "ImageContext", "Pages", + }); + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesRequest_descriptor, + new java.lang.String[] { + "Requests", + }); + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_BatchAnnotateFilesResponse_descriptor, + new java.lang.String[] { + "Responses", + }); + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileRequest_descriptor, + new java.lang.String[] { + "InputConfig", "Features", "ImageContext", "OutputConfig", + }); + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AsyncAnnotateFileResponse_descriptor, + new java.lang.String[] { + "OutputConfig", + }); + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesRequest_descriptor, + new java.lang.String[] { + "Requests", "OutputConfig", + }); + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateImagesResponse_descriptor, + new java.lang.String[] { + "OutputConfig", + }); + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesRequest_descriptor, + new java.lang.String[] { + "Requests", + }); + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AsyncBatchAnnotateFilesResponse_descriptor, + new java.lang.String[] { + "Responses", + }); + internal_static_google_cloud_vision_v1p4beta1_InputConfig_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_google_cloud_vision_v1p4beta1_InputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_InputConfig_descriptor, + new java.lang.String[] { + "GcsSource", "Content", "MimeType", + }); + internal_static_google_cloud_vision_v1p4beta1_OutputConfig_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_cloud_vision_v1p4beta1_OutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_OutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "BatchSize", + }); + internal_static_google_cloud_vision_v1p4beta1_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_google_cloud_vision_v1p4beta1_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_GcsSource_descriptor, + new java.lang.String[] { + "Uri", + }); + internal_static_google_cloud_vision_v1p4beta1_GcsDestination_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_google_cloud_vision_v1p4beta1_GcsDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_GcsDestination_descriptor, + new java.lang.String[] { + "Uri", + }); + internal_static_google_cloud_vision_v1p4beta1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_google_cloud_vision_v1p4beta1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_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.v1p4beta1.GeometryProto.getDescriptor(); + com.google.cloud.vision.v1p4beta1.ProductSearchProto.getDescriptor(); + com.google.cloud.vision.v1p4beta1.TextAnnotationProto.getDescriptor(); + com.google.cloud.vision.v1p4beta1.WebDetectionProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageContext.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageContext.java new file mode 100644 index 000000000000..11ffeb0fc83d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageContext.java @@ -0,0 +1,1856 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Image context and/or feature-specific parameters.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImageContext} + */ +public final class ImageContext extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.LatLongRect.Builder subBuilder = null; + if (latLongRect_ != null) { + subBuilder = latLongRect_.toBuilder(); + } + latLongRect_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams.Builder subBuilder = null; + if (cropHintsParams_ != null) { + subBuilder = cropHintsParams_.toBuilder(); + } + cropHintsParams_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.CropHintsParams.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cropHintsParams_); + cropHintsParams_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.cloud.vision.v1p4beta1.ProductSearchParams.Builder subBuilder = null; + if (productSearchParams_ != null) { + subBuilder = productSearchParams_.toBuilder(); + } + productSearchParams_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ProductSearchParams.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productSearchParams_); + productSearchParams_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.cloud.vision.v1p4beta1.WebDetectionParams.Builder subBuilder = null; + if (webDetectionParams_ != null) { + subBuilder = webDetectionParams_.toBuilder(); + } + webDetectionParams_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetectionParams.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(webDetectionParams_); + webDetectionParams_ = subBuilder.buildPartial(); + } + + 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 { + 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.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImageContext.class, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder.class); + } + + private int bitField0_; + public static final int LAT_LONG_RECT_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.LatLongRect latLongRect_; + /** + * + * + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public boolean hasLatLongRect() { + return latLongRect_ != null; + } + /** + * + * + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p4beta1.LatLongRect getLatLongRect() { + return latLongRect_ == null + ? com.google.cloud.vision.v1p4beta1.LatLongRect.getDefaultInstance() + : latLongRect_; + } + /** + * + * + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams cropHintsParams_; + /** + * + * + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public boolean hasCropHintsParams() { + return cropHintsParams_ != null; + } + /** + * + * + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsParams getCropHintsParams() { + return cropHintsParams_ == null + ? com.google.cloud.vision.v1p4beta1.CropHintsParams.getDefaultInstance() + : cropHintsParams_; + } + /** + * + * + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsParamsOrBuilder getCropHintsParamsOrBuilder() { + return getCropHintsParams(); + } + + public static final int PRODUCT_SEARCH_PARAMS_FIELD_NUMBER = 5; + private com.google.cloud.vision.v1p4beta1.ProductSearchParams productSearchParams_; + /** + * + * + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public boolean hasProductSearchParams() { + return productSearchParams_ != null; + } + /** + * + * + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchParams getProductSearchParams() { + return productSearchParams_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSearchParams.getDefaultInstance() + : productSearchParams_; + } + /** + * + * + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchParamsOrBuilder + getProductSearchParamsOrBuilder() { + return getProductSearchParams(); + } + + public static final int WEB_DETECTION_PARAMS_FIELD_NUMBER = 6; + private com.google.cloud.vision.v1p4beta1.WebDetectionParams webDetectionParams_; + /** + * + * + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public boolean hasWebDetectionParams() { + return webDetectionParams_ != null; + } + /** + * + * + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p4beta1.WebDetectionParams getWebDetectionParams() { + return webDetectionParams_ == null + ? com.google.cloud.vision.v1p4beta1.WebDetectionParams.getDefaultInstance() + : webDetectionParams_; + } + /** + * + * + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p4beta1.WebDetectionParamsOrBuilder + getWebDetectionParamsOrBuilder() { + return getWebDetectionParams(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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); + } + + @java.lang.Override + 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.v1p4beta1.ImageContext)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ImageContext other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.ImageContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Image context and/or feature-specific parameters.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImageContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ImageContext) + com.google.cloud.vision.v1p4beta1.ImageContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImageContext.class, + com.google.cloud.vision.v1p4beta1.ImageContext.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageContext getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ImageContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageContext build() { + com.google.cloud.vision.v1p4beta1.ImageContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageContext buildPartial() { + com.google.cloud.vision.v1p4beta1.ImageContext result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ImageContext) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ImageContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ImageContext other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ImageContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.ImageContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.LatLongRect latLongRect_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.LatLongRect, + com.google.cloud.vision.v1p4beta1.LatLongRect.Builder, + com.google.cloud.vision.v1p4beta1.LatLongRectOrBuilder> + latLongRectBuilder_; + /** + * + * + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public boolean hasLatLongRect() { + return latLongRectBuilder_ != null || latLongRect_ != null; + } + /** + * + * + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p4beta1.LatLongRect getLatLongRect() { + if (latLongRectBuilder_ == null) { + return latLongRect_ == null + ? com.google.cloud.vision.v1p4beta1.LatLongRect.getDefaultInstance() + : latLongRect_; + } else { + return latLongRectBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public Builder setLatLongRect(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public Builder setLatLongRect( + com.google.cloud.vision.v1p4beta1.LatLongRect.Builder builderForValue) { + if (latLongRectBuilder_ == null) { + latLongRect_ = builderForValue.build(); + onChanged(); + } else { + latLongRectBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public Builder mergeLatLongRect(com.google.cloud.vision.v1p4beta1.LatLongRect value) { + if (latLongRectBuilder_ == null) { + if (latLongRect_ != null) { + latLongRect_ = + com.google.cloud.vision.v1p4beta1.LatLongRect.newBuilder(latLongRect_) + .mergeFrom(value) + .buildPartial(); + } else { + latLongRect_ = value; + } + onChanged(); + } else { + latLongRectBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p4beta1.LatLongRect.Builder getLatLongRectBuilder() { + + onChanged(); + return getLatLongRectFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + public com.google.cloud.vision.v1p4beta1.LatLongRectOrBuilder getLatLongRectOrBuilder() { + if (latLongRectBuilder_ != null) { + return latLongRectBuilder_.getMessageOrBuilder(); + } else { + return latLongRect_ == null + ? com.google.cloud.vision.v1p4beta1.LatLongRect.getDefaultInstance() + : latLongRect_; + } + } + /** + * + * + *
+     * Not used.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.LatLongRect, + com.google.cloud.vision.v1p4beta1.LatLongRect.Builder, + com.google.cloud.vision.v1p4beta1.LatLongRectOrBuilder> + getLatLongRectFieldBuilder() { + if (latLongRectBuilder_ == null) { + latLongRectBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.LatLongRect, + com.google.cloud.vision.v1p4beta1.LatLongRect.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams cropHintsParams_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.CropHintsParams, + com.google.cloud.vision.v1p4beta1.CropHintsParams.Builder, + com.google.cloud.vision.v1p4beta1.CropHintsParamsOrBuilder> + cropHintsParamsBuilder_; + /** + * + * + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public boolean hasCropHintsParams() { + return cropHintsParamsBuilder_ != null || cropHintsParams_ != null; + } + /** + * + * + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsParams getCropHintsParams() { + if (cropHintsParamsBuilder_ == null) { + return cropHintsParams_ == null + ? com.google.cloud.vision.v1p4beta1.CropHintsParams.getDefaultInstance() + : cropHintsParams_; + } else { + return cropHintsParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public Builder setCropHintsParams(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public Builder setCropHintsParams( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public Builder mergeCropHintsParams(com.google.cloud.vision.v1p4beta1.CropHintsParams value) { + if (cropHintsParamsBuilder_ == null) { + if (cropHintsParams_ != null) { + cropHintsParams_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsParams.Builder getCropHintsParamsBuilder() { + + onChanged(); + return getCropHintsParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + public com.google.cloud.vision.v1p4beta1.CropHintsParamsOrBuilder + getCropHintsParamsOrBuilder() { + if (cropHintsParamsBuilder_ != null) { + return cropHintsParamsBuilder_.getMessageOrBuilder(); + } else { + return cropHintsParams_ == null + ? com.google.cloud.vision.v1p4beta1.CropHintsParams.getDefaultInstance() + : cropHintsParams_; + } + } + /** + * + * + *
+     * Parameters for crop hints annotation request.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.CropHintsParams, + com.google.cloud.vision.v1p4beta1.CropHintsParams.Builder, + com.google.cloud.vision.v1p4beta1.CropHintsParamsOrBuilder> + getCropHintsParamsFieldBuilder() { + if (cropHintsParamsBuilder_ == null) { + cropHintsParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.CropHintsParams, + com.google.cloud.vision.v1p4beta1.CropHintsParams.Builder, + com.google.cloud.vision.v1p4beta1.CropHintsParamsOrBuilder>( + getCropHintsParams(), getParentForChildren(), isClean()); + cropHintsParams_ = null; + } + return cropHintsParamsBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.ProductSearchParams productSearchParams_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchParams, + com.google.cloud.vision.v1p4beta1.ProductSearchParams.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchParamsOrBuilder> + productSearchParamsBuilder_; + /** + * + * + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public boolean hasProductSearchParams() { + return productSearchParamsBuilder_ != null || productSearchParams_ != null; + } + /** + * + * + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchParams getProductSearchParams() { + if (productSearchParamsBuilder_ == null) { + return productSearchParams_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSearchParams.getDefaultInstance() + : productSearchParams_; + } else { + return productSearchParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public Builder setProductSearchParams( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public Builder setProductSearchParams( + com.google.cloud.vision.v1p4beta1.ProductSearchParams.Builder builderForValue) { + if (productSearchParamsBuilder_ == null) { + productSearchParams_ = builderForValue.build(); + onChanged(); + } else { + productSearchParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public Builder mergeProductSearchParams( + com.google.cloud.vision.v1p4beta1.ProductSearchParams value) { + if (productSearchParamsBuilder_ == null) { + if (productSearchParams_ != null) { + productSearchParams_ = + com.google.cloud.vision.v1p4beta1.ProductSearchParams.newBuilder(productSearchParams_) + .mergeFrom(value) + .buildPartial(); + } else { + productSearchParams_ = value; + } + onChanged(); + } else { + productSearchParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchParams.Builder + getProductSearchParamsBuilder() { + + onChanged(); + return getProductSearchParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchParamsOrBuilder + getProductSearchParamsOrBuilder() { + if (productSearchParamsBuilder_ != null) { + return productSearchParamsBuilder_.getMessageOrBuilder(); + } else { + return productSearchParams_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSearchParams.getDefaultInstance() + : productSearchParams_; + } + } + /** + * + * + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchParams, + com.google.cloud.vision.v1p4beta1.ProductSearchParams.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchParamsOrBuilder> + getProductSearchParamsFieldBuilder() { + if (productSearchParamsBuilder_ == null) { + productSearchParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchParams, + com.google.cloud.vision.v1p4beta1.ProductSearchParams.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchParamsOrBuilder>( + getProductSearchParams(), getParentForChildren(), isClean()); + productSearchParams_ = null; + } + return productSearchParamsBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.WebDetectionParams webDetectionParams_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetectionParams, + com.google.cloud.vision.v1p4beta1.WebDetectionParams.Builder, + com.google.cloud.vision.v1p4beta1.WebDetectionParamsOrBuilder> + webDetectionParamsBuilder_; + /** + * + * + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public boolean hasWebDetectionParams() { + return webDetectionParamsBuilder_ != null || webDetectionParams_ != null; + } + /** + * + * + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p4beta1.WebDetectionParams getWebDetectionParams() { + if (webDetectionParamsBuilder_ == null) { + return webDetectionParams_ == null + ? com.google.cloud.vision.v1p4beta1.WebDetectionParams.getDefaultInstance() + : webDetectionParams_; + } else { + return webDetectionParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public Builder setWebDetectionParams( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public Builder setWebDetectionParams( + com.google.cloud.vision.v1p4beta1.WebDetectionParams.Builder builderForValue) { + if (webDetectionParamsBuilder_ == null) { + webDetectionParams_ = builderForValue.build(); + onChanged(); + } else { + webDetectionParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public Builder mergeWebDetectionParams( + com.google.cloud.vision.v1p4beta1.WebDetectionParams value) { + if (webDetectionParamsBuilder_ == null) { + if (webDetectionParams_ != null) { + webDetectionParams_ = + com.google.cloud.vision.v1p4beta1.WebDetectionParams.newBuilder(webDetectionParams_) + .mergeFrom(value) + .buildPartial(); + } else { + webDetectionParams_ = value; + } + onChanged(); + } else { + webDetectionParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p4beta1.WebDetectionParams.Builder + getWebDetectionParamsBuilder() { + + onChanged(); + return getWebDetectionParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + public com.google.cloud.vision.v1p4beta1.WebDetectionParamsOrBuilder + getWebDetectionParamsOrBuilder() { + if (webDetectionParamsBuilder_ != null) { + return webDetectionParamsBuilder_.getMessageOrBuilder(); + } else { + return webDetectionParams_ == null + ? com.google.cloud.vision.v1p4beta1.WebDetectionParams.getDefaultInstance() + : webDetectionParams_; + } + } + /** + * + * + *
+     * Parameters for web detection.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetectionParams, + com.google.cloud.vision.v1p4beta1.WebDetectionParams.Builder, + com.google.cloud.vision.v1p4beta1.WebDetectionParamsOrBuilder> + getWebDetectionParamsFieldBuilder() { + if (webDetectionParamsBuilder_ == null) { + webDetectionParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetectionParams, + com.google.cloud.vision.v1p4beta1.WebDetectionParams.Builder, + com.google.cloud.vision.v1p4beta1.WebDetectionParamsOrBuilder>( + getWebDetectionParams(), getParentForChildren(), isClean()); + webDetectionParams_ = null; + } + return webDetectionParamsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ImageContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImageContext) + private static final com.google.cloud.vision.v1p4beta1.ImageContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ImageContext(); + } + + public static com.google.cloud.vision.v1p4beta1.ImageContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageContextOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageContextOrBuilder.java new file mode 100644 index 000000000000..d5549aadda60 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageContextOrBuilder.java @@ -0,0 +1,203 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImageContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ImageContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + boolean hasLatLongRect(); + /** + * + * + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + com.google.cloud.vision.v1p4beta1.LatLongRect getLatLongRect(); + /** + * + * + *
+   * Not used.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.LatLongRect lat_long_rect = 1; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + boolean hasCropHintsParams(); + /** + * + * + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + com.google.cloud.vision.v1p4beta1.CropHintsParams getCropHintsParams(); + /** + * + * + *
+   * Parameters for crop hints annotation request.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.CropHintsParams crop_hints_params = 4; + */ + com.google.cloud.vision.v1p4beta1.CropHintsParamsOrBuilder getCropHintsParamsOrBuilder(); + + /** + * + * + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + boolean hasProductSearchParams(); + /** + * + * + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + com.google.cloud.vision.v1p4beta1.ProductSearchParams getProductSearchParams(); + /** + * + * + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSearchParams product_search_params = 5; + */ + com.google.cloud.vision.v1p4beta1.ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder(); + + /** + * + * + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + boolean hasWebDetectionParams(); + /** + * + * + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + com.google.cloud.vision.v1p4beta1.WebDetectionParams getWebDetectionParams(); + /** + * + * + *
+   * Parameters for web detection.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.WebDetectionParams web_detection_params = 6; + */ + com.google.cloud.vision.v1p4beta1.WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageOrBuilder.java new file mode 100644 index 000000000000..9e2dadc6c523 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageOrBuilder.java @@ -0,0 +1,60 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource source = 2; + */ + com.google.cloud.vision.v1p4beta1.ImageSourceOrBuilder getSourceOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageProperties.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageProperties.java new file mode 100644 index 000000000000..ac1e216ee2d2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageProperties.java @@ -0,0 +1,710 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Stores image properties, such as dominant colors.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImageProperties} + */ +public final class ImageProperties extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.Builder subBuilder = null; + if (dominantColors_ != null) { + subBuilder = dominantColors_.toBuilder(); + } + dominantColors_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dominantColors_); + dominantColors_ = subBuilder.buildPartial(); + } + + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImageProperties.class, + com.google.cloud.vision.v1p4beta1.ImageProperties.Builder.class); + } + + public static final int DOMINANT_COLORS_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominantColors_; + /** + * + * + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public boolean hasDominantColors() { + return dominantColors_ != null; + } + /** + * + * + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation getDominantColors() { + return dominantColors_ == null + ? com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.getDefaultInstance() + : dominantColors_; + } + /** + * + * + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotationOrBuilder + getDominantColorsOrBuilder() { + return getDominantColors(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (dominantColors_ != null) { + output.writeMessage(1, getDominantColors()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.ImageProperties)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ImageProperties other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageProperties parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageProperties parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageProperties parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.ImageProperties prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Stores image properties, such as dominant colors.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImageProperties} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ImageProperties) + com.google.cloud.vision.v1p4beta1.ImagePropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImageProperties.class, + com.google.cloud.vision.v1p4beta1.ImageProperties.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (dominantColorsBuilder_ == null) { + dominantColors_ = null; + } else { + dominantColors_ = null; + dominantColorsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageProperties_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageProperties getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ImageProperties.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageProperties build() { + com.google.cloud.vision.v1p4beta1.ImageProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageProperties buildPartial() { + com.google.cloud.vision.v1p4beta1.ImageProperties result = + new com.google.cloud.vision.v1p4beta1.ImageProperties(this); + if (dominantColorsBuilder_ == null) { + result.dominantColors_ = dominantColors_; + } else { + result.dominantColors_ = dominantColorsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ImageProperties) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ImageProperties) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ImageProperties other) { + if (other == com.google.cloud.vision.v1p4beta1.ImageProperties.getDefaultInstance()) + return this; + if (other.hasDominantColors()) { + mergeDominantColors(other.getDominantColors()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ImageProperties parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.ImageProperties) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominantColors_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation, + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotationOrBuilder> + dominantColorsBuilder_; + /** + * + * + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public boolean hasDominantColors() { + return dominantColorsBuilder_ != null || dominantColors_ != null; + } + /** + * + * + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation getDominantColors() { + if (dominantColorsBuilder_ == null) { + return dominantColors_ == null + ? com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.getDefaultInstance() + : dominantColors_; + } else { + return dominantColorsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public Builder setDominantColors( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public Builder setDominantColors( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public Builder mergeDominantColors( + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation value) { + if (dominantColorsBuilder_ == null) { + if (dominantColors_ != null) { + dominantColors_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.Builder + getDominantColorsBuilder() { + + onChanged(); + return getDominantColorsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + public com.google.cloud.vision.v1p4beta1.DominantColorsAnnotationOrBuilder + getDominantColorsOrBuilder() { + if (dominantColorsBuilder_ != null) { + return dominantColorsBuilder_.getMessageOrBuilder(); + } else { + return dominantColors_ == null + ? com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.getDefaultInstance() + : dominantColors_; + } + } + /** + * + * + *
+     * If present, dominant colors completed successfully.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation, + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotationOrBuilder> + getDominantColorsFieldBuilder() { + if (dominantColorsBuilder_ == null) { + dominantColorsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation, + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.Builder, + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotationOrBuilder>( + getDominantColors(), getParentForChildren(), isClean()); + dominantColors_ = null; + } + return dominantColorsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ImageProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImageProperties) + private static final com.google.cloud.vision.v1p4beta1.ImageProperties DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ImageProperties(); + } + + public static com.google.cloud.vision.v1p4beta1.ImageProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageProperties getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImagePropertiesOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImagePropertiesOrBuilder.java new file mode 100644 index 000000000000..db3686657e37 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImagePropertiesOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImagePropertiesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ImageProperties) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + boolean hasDominantColors(); + /** + * + * + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotation getDominantColors(); + /** + * + * + *
+   * If present, dominant colors completed successfully.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.DominantColorsAnnotation dominant_colors = 1; + */ + com.google.cloud.vision.v1p4beta1.DominantColorsAnnotationOrBuilder getDominantColorsOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageSource.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageSource.java new file mode 100644 index 000000000000..fde5f54f0f82 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageSource.java @@ -0,0 +1,877 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * External image source (Google Cloud Storage or web URL image location).
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImageSource} + */ +public final class ImageSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + gcsImageUri_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + imageUri_ = s; + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImageSource.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getGcsImageUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gcsImageUri_); + } + if (!getImageUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, imageUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.ImageSource)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ImageSource other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.ImageSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * External image source (Google Cloud Storage or web URL image location).
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImageSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ImageSource) + com.google.cloud.vision.v1p4beta1.ImageSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImageSource.class, + com.google.cloud.vision.v1p4beta1.ImageSource.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + gcsImageUri_ = ""; + + imageUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_ImageSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageSource getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ImageSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageSource build() { + com.google.cloud.vision.v1p4beta1.ImageSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageSource buildPartial() { + com.google.cloud.vision.v1p4beta1.ImageSource result = + new com.google.cloud.vision.v1p4beta1.ImageSource(this); + result.gcsImageUri_ = gcsImageUri_; + result.imageUri_ = imageUri_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ImageSource) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ImageSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ImageSource other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ImageSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ImageSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImageSource) + private static final com.google.cloud.vision.v1p4beta1.ImageSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ImageSource(); + } + + public static com.google.cloud.vision.v1p4beta1.ImageSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImageSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageSourceOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageSourceOrBuilder.java new file mode 100644 index 000000000000..96706e17fe40 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImageSourceOrBuilder.java @@ -0,0 +1,86 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImageSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsGcsSource.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsGcsSource.java new file mode 100644 index 000000000000..7167d0e4687f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsGcsSource.java @@ -0,0 +1,927 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * The Google Cloud Storage location for a csv file which preserves a list of
+ * ImportProductSetRequests in each line.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource} + */ +public final class ImportProductSetsGcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + csvFileUri_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.class, + com.google.cloud.vision.v1p4beta1.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 8 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
+   * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+   * columns are required. All other columns are optional.
+   * If the `ProductSet` or `Product` specified by the `product-set-id` and
+   * `product-id` values does not exist, then the system will create a new
+   * `ProductSet` or `Product` for the image. In this case, the
+   * `product-display-name` column refers to
+   * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+   * `product-category` column refers to
+   * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+   * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+   * The `image-id` column is optional but must be unique if provided. If it is
+   * empty, the system will automatically assign a unique id to the image.
+   * The `product-display-name` column is optional. If it is empty, the system
+   * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+   * space (" "). You can update the `display_name` later by using the API.
+   * If a `Product` with the specified `product-id` already exists, then the
+   * system ignores the `product-display-name`, `product-category`, and `labels`
+   * columns.
+   * The `labels` column (optional) is a line containing a list of
+   * comma-separated key-value pairs, in the following format:
+   *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+   * The `bounding-poly` column (optional) identifies one region of
+   * interest from the image in the same manner as `CreateReferenceImage`. If
+   * you do not specify the `bounding-poly` column, then the system will try to
+   * detect regions of interest automatically.
+   * At most one `bounding-poly` column is allowed per line. If the image
+   * contains multiple regions of interest, add a line to the CSV file that
+   * includes the same product information, and the `bounding-poly` values for
+   * each region of interest.
+   * The `bounding-poly` column must contain an even number of comma-separated
+   * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+   * non-negative integers for absolute bounding polygons, and float values
+   * in [0, 1] for normalized bounding polygons.
+   * The system will resize the image if the image resolution is too
+   * large to process (larger than 20MP).
+   * 
+ * + * 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 8 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
+   * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+   * columns are required. All other columns are optional.
+   * If the `ProductSet` or `Product` specified by the `product-set-id` and
+   * `product-id` values does not exist, then the system will create a new
+   * `ProductSet` or `Product` for the image. In this case, the
+   * `product-display-name` column refers to
+   * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+   * `product-category` column refers to
+   * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+   * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+   * The `image-id` column is optional but must be unique if provided. If it is
+   * empty, the system will automatically assign a unique id to the image.
+   * The `product-display-name` column is optional. If it is empty, the system
+   * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+   * space (" "). You can update the `display_name` later by using the API.
+   * If a `Product` with the specified `product-id` already exists, then the
+   * system ignores the `product-display-name`, `product-category`, and `labels`
+   * columns.
+   * The `labels` column (optional) is a line containing a list of
+   * comma-separated key-value pairs, in the following format:
+   *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+   * The `bounding-poly` column (optional) identifies one region of
+   * interest from the image in the same manner as `CreateReferenceImage`. If
+   * you do not specify the `bounding-poly` column, then the system will try to
+   * detect regions of interest automatically.
+   * At most one `bounding-poly` column is allowed per line. If the image
+   * contains multiple regions of interest, add a line to the CSV file that
+   * includes the same product information, and the `bounding-poly` values for
+   * each region of interest.
+   * The `bounding-poly` column must contain an even number of comma-separated
+   * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+   * non-negative integers for absolute bounding polygons, and float values
+   * in [0, 1] for normalized bounding polygons.
+   * The system will resize the image if the image resolution is too
+   * large to process (larger than 20MP).
+   * 
+ * + * 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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getCsvFileUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, csvFileUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.ImportProductSetsGcsSource)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location for a csv file which preserves a list of
+   * ImportProductSetRequests in each line.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.class, + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + csvFileUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource build() { + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource buildPartial() { + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource result = + new com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource(this); + result.csvFileUri_ = csvFileUri_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource other) { + if (other + == com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.getDefaultInstance()) + return this; + if (!other.getCsvFileUri().isEmpty()) { + csvFileUri_ = other.csvFileUri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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 8 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
+     * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+     * columns are required. All other columns are optional.
+     * If the `ProductSet` or `Product` specified by the `product-set-id` and
+     * `product-id` values does not exist, then the system will create a new
+     * `ProductSet` or `Product` for the image. In this case, the
+     * `product-display-name` column refers to
+     * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+     * The `image-id` column is optional but must be unique if provided. If it is
+     * empty, the system will automatically assign a unique id to the image.
+     * The `product-display-name` column is optional. If it is empty, the system
+     * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+     * space (" "). You can update the `display_name` later by using the API.
+     * If a `Product` with the specified `product-id` already exists, then the
+     * system ignores the `product-display-name`, `product-category`, and `labels`
+     * columns.
+     * The `labels` column (optional) is a line containing a list of
+     * comma-separated key-value pairs, in the following format:
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+     * The `bounding-poly` column (optional) identifies one region of
+     * interest from the image in the same manner as `CreateReferenceImage`. If
+     * you do not specify the `bounding-poly` column, then the system will try to
+     * detect regions of interest automatically.
+     * At most one `bounding-poly` column is allowed per line. If the image
+     * contains multiple regions of interest, add a line to the CSV file that
+     * includes the same product information, and the `bounding-poly` values for
+     * each region of interest.
+     * The `bounding-poly` column must contain an even number of comma-separated
+     * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+     * non-negative integers for absolute bounding polygons, and float values
+     * in [0, 1] for normalized bounding polygons.
+     * The system will resize the image if the image resolution is too
+     * large to process (larger than 20MP).
+     * 
+ * + * 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 8 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
+     * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+     * columns are required. All other columns are optional.
+     * If the `ProductSet` or `Product` specified by the `product-set-id` and
+     * `product-id` values does not exist, then the system will create a new
+     * `ProductSet` or `Product` for the image. In this case, the
+     * `product-display-name` column refers to
+     * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+     * The `image-id` column is optional but must be unique if provided. If it is
+     * empty, the system will automatically assign a unique id to the image.
+     * The `product-display-name` column is optional. If it is empty, the system
+     * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+     * space (" "). You can update the `display_name` later by using the API.
+     * If a `Product` with the specified `product-id` already exists, then the
+     * system ignores the `product-display-name`, `product-category`, and `labels`
+     * columns.
+     * The `labels` column (optional) is a line containing a list of
+     * comma-separated key-value pairs, in the following format:
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+     * The `bounding-poly` column (optional) identifies one region of
+     * interest from the image in the same manner as `CreateReferenceImage`. If
+     * you do not specify the `bounding-poly` column, then the system will try to
+     * detect regions of interest automatically.
+     * At most one `bounding-poly` column is allowed per line. If the image
+     * contains multiple regions of interest, add a line to the CSV file that
+     * includes the same product information, and the `bounding-poly` values for
+     * each region of interest.
+     * The `bounding-poly` column must contain an even number of comma-separated
+     * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+     * non-negative integers for absolute bounding polygons, and float values
+     * in [0, 1] for normalized bounding polygons.
+     * The system will resize the image if the image resolution is too
+     * large to process (larger than 20MP).
+     * 
+ * + * 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 8 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
+     * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+     * columns are required. All other columns are optional.
+     * If the `ProductSet` or `Product` specified by the `product-set-id` and
+     * `product-id` values does not exist, then the system will create a new
+     * `ProductSet` or `Product` for the image. In this case, the
+     * `product-display-name` column refers to
+     * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+     * The `image-id` column is optional but must be unique if provided. If it is
+     * empty, the system will automatically assign a unique id to the image.
+     * The `product-display-name` column is optional. If it is empty, the system
+     * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+     * space (" "). You can update the `display_name` later by using the API.
+     * If a `Product` with the specified `product-id` already exists, then the
+     * system ignores the `product-display-name`, `product-category`, and `labels`
+     * columns.
+     * The `labels` column (optional) is a line containing a list of
+     * comma-separated key-value pairs, in the following format:
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+     * The `bounding-poly` column (optional) identifies one region of
+     * interest from the image in the same manner as `CreateReferenceImage`. If
+     * you do not specify the `bounding-poly` column, then the system will try to
+     * detect regions of interest automatically.
+     * At most one `bounding-poly` column is allowed per line. If the image
+     * contains multiple regions of interest, add a line to the CSV file that
+     * includes the same product information, and the `bounding-poly` values for
+     * each region of interest.
+     * The `bounding-poly` column must contain an even number of comma-separated
+     * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+     * non-negative integers for absolute bounding polygons, and float values
+     * in [0, 1] for normalized bounding polygons.
+     * The system will resize the image if the image resolution is too
+     * large to process (larger than 20MP).
+     * 
+ * + * 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 8 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
+     * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+     * columns are required. All other columns are optional.
+     * If the `ProductSet` or `Product` specified by the `product-set-id` and
+     * `product-id` values does not exist, then the system will create a new
+     * `ProductSet` or `Product` for the image. In this case, the
+     * `product-display-name` column refers to
+     * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+     * The `image-id` column is optional but must be unique if provided. If it is
+     * empty, the system will automatically assign a unique id to the image.
+     * The `product-display-name` column is optional. If it is empty, the system
+     * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+     * space (" "). You can update the `display_name` later by using the API.
+     * If a `Product` with the specified `product-id` already exists, then the
+     * system ignores the `product-display-name`, `product-category`, and `labels`
+     * columns.
+     * The `labels` column (optional) is a line containing a list of
+     * comma-separated key-value pairs, in the following format:
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+     * The `bounding-poly` column (optional) identifies one region of
+     * interest from the image in the same manner as `CreateReferenceImage`. If
+     * you do not specify the `bounding-poly` column, then the system will try to
+     * detect regions of interest automatically.
+     * At most one `bounding-poly` column is allowed per line. If the image
+     * contains multiple regions of interest, add a line to the CSV file that
+     * includes the same product information, and the `bounding-poly` values for
+     * each region of interest.
+     * The `bounding-poly` column must contain an even number of comma-separated
+     * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+     * non-negative integers for absolute bounding polygons, and float values
+     * in [0, 1] for normalized bounding polygons.
+     * The system will resize the image if the image resolution is too
+     * large to process (larger than 20MP).
+     * 
+ * + * 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 8 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
+     * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+     * columns are required. All other columns are optional.
+     * If the `ProductSet` or `Product` specified by the `product-set-id` and
+     * `product-id` values does not exist, then the system will create a new
+     * `ProductSet` or `Product` for the image. In this case, the
+     * `product-display-name` column refers to
+     * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+     * The `image-id` column is optional but must be unique if provided. If it is
+     * empty, the system will automatically assign a unique id to the image.
+     * The `product-display-name` column is optional. If it is empty, the system
+     * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+     * space (" "). You can update the `display_name` later by using the API.
+     * If a `Product` with the specified `product-id` already exists, then the
+     * system ignores the `product-display-name`, `product-category`, and `labels`
+     * columns.
+     * The `labels` column (optional) is a line containing a list of
+     * comma-separated key-value pairs, in the following format:
+     *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+     * The `bounding-poly` column (optional) identifies one region of
+     * interest from the image in the same manner as `CreateReferenceImage`. If
+     * you do not specify the `bounding-poly` column, then the system will try to
+     * detect regions of interest automatically.
+     * At most one `bounding-poly` column is allowed per line. If the image
+     * contains multiple regions of interest, add a line to the CSV file that
+     * includes the same product information, and the `bounding-poly` values for
+     * each region of interest.
+     * The `bounding-poly` column must contain an even number of comma-separated
+     * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+     * non-negative integers for absolute bounding polygons, and float values
+     * in [0, 1] for normalized bounding polygons.
+     * The system will resize the image if the image resolution is too
+     * large to process (larger than 20MP).
+     * 
+ * + * 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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) + private static final com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource(); + } + + public static com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsGcsSourceOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsGcsSourceOrBuilder.java new file mode 100644 index 000000000000..e13a0a0f9581 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsGcsSourceOrBuilder.java @@ -0,0 +1,123 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImportProductSetsGcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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 8 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
+   * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+   * columns are required. All other columns are optional.
+   * If the `ProductSet` or `Product` specified by the `product-set-id` and
+   * `product-id` values does not exist, then the system will create a new
+   * `ProductSet` or `Product` for the image. In this case, the
+   * `product-display-name` column refers to
+   * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+   * `product-category` column refers to
+   * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+   * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+   * The `image-id` column is optional but must be unique if provided. If it is
+   * empty, the system will automatically assign a unique id to the image.
+   * The `product-display-name` column is optional. If it is empty, the system
+   * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+   * space (" "). You can update the `display_name` later by using the API.
+   * If a `Product` with the specified `product-id` already exists, then the
+   * system ignores the `product-display-name`, `product-category`, and `labels`
+   * columns.
+   * The `labels` column (optional) is a line containing a list of
+   * comma-separated key-value pairs, in the following format:
+   *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+   * The `bounding-poly` column (optional) identifies one region of
+   * interest from the image in the same manner as `CreateReferenceImage`. If
+   * you do not specify the `bounding-poly` column, then the system will try to
+   * detect regions of interest automatically.
+   * At most one `bounding-poly` column is allowed per line. If the image
+   * contains multiple regions of interest, add a line to the CSV file that
+   * includes the same product information, and the `bounding-poly` values for
+   * each region of interest.
+   * The `bounding-poly` column must contain an even number of comma-separated
+   * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+   * non-negative integers for absolute bounding polygons, and float values
+   * in [0, 1] for normalized bounding polygons.
+   * The system will resize the image if the image resolution is too
+   * large to process (larger than 20MP).
+   * 
+ * + * 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 8 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
+   * The `image-uri`, `product-set-id`, `product-id`, and `product-category`
+   * columns are required. All other columns are optional.
+   * If the `ProductSet` or `Product` specified by the `product-set-id` and
+   * `product-id` values does not exist, then the system will create a new
+   * `ProductSet` or `Product` for the image. In this case, the
+   * `product-display-name` column refers to
+   * [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the
+   * `product-category` column refers to
+   * [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the
+   * `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels].
+   * The `image-id` column is optional but must be unique if provided. If it is
+   * empty, the system will automatically assign a unique id to the image.
+   * The `product-display-name` column is optional. If it is empty, the system
+   * sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a
+   * space (" "). You can update the `display_name` later by using the API.
+   * If a `Product` with the specified `product-id` already exists, then the
+   * system ignores the `product-display-name`, `product-category`, and `labels`
+   * columns.
+   * The `labels` column (optional) is a line containing a list of
+   * comma-separated key-value pairs, in the following format:
+   *     "key_1=value_1,key_2=value_2,...,key_n=value_n"
+   * The `bounding-poly` column (optional) identifies one region of
+   * interest from the image in the same manner as `CreateReferenceImage`. If
+   * you do not specify the `bounding-poly` column, then the system will try to
+   * detect regions of interest automatically.
+   * At most one `bounding-poly` column is allowed per line. If the image
+   * contains multiple regions of interest, add a line to the CSV file that
+   * includes the same product information, and the `bounding-poly` values for
+   * each region of interest.
+   * The `bounding-poly` column must contain an even number of comma-separated
+   * numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
+   * non-negative integers for absolute bounding polygons, and float values
+   * in [0, 1] for normalized bounding polygons.
+   * The system will resize the image if the image resolution is too
+   * large to process (larger than 20MP).
+   * 
+ * + * string csv_file_uri = 1; + */ + com.google.protobuf.ByteString getCsvFileUriBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsInputConfig.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsInputConfig.java new file mode 100644 index 000000000000..beb12206d508 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsInputConfig.java @@ -0,0 +1,829 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * The input content for the `ImportProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig} + */ +public final class ImportProductSetsInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.Builder subBuilder = + null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) source_) + .toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource getGcsSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceOrBuilder + getGcsSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The input content for the `ImportProductSets` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig) + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.class, + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig build() { + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig buildPartial() { + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig result = + new com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig(this); + if (sourceCase_ == 1) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource, + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.Builder, + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder mergeGcsSource( + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ + != com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + .getDefaultInstance()) { + source_ = + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.newBuilder( + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceOrBuilder + getGcsSourceOrBuilder() { + if ((sourceCase_ == 1) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource, + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.Builder, + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource, + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.Builder, + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceOrBuilder>( + (com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return gcsSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig) + private static final com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig(); + } + + public static com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsInputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsInputConfigOrBuilder.java new file mode 100644 index 000000000000..87301eeea19d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsInputConfigOrBuilder.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImportProductSetsInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource getGcsSource(); + /** + * + * + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceOrBuilder getGcsSourceOrBuilder(); + + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.SourceCase getSourceCase(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsRequest.java new file mode 100644 index 000000000000..60f2a95c9ddf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsRequest.java @@ -0,0 +1,882 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `ImportProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImportProductSetsRequest} + */ +public final class ImportProductSetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.Builder subBuilder = + null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig inputConfig_; + /** + * + * + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigOrBuilder + getInputConfigOrBuilder() { + return getInputConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (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.v1p4beta1.ImportProductSetsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ImportProductSets` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ImportProductSetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ImportProductSetsRequest) + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest.class, + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest build() { + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest result = + new com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest(this); + result.parent_ = parent_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig, + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.Builder, + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder mergeInputConfig( + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.Builder + getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigOrBuilder + getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig, + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.Builder, + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig, + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.Builder, + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ImportProductSetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImportProductSetsRequest) + private static final com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsRequestOrBuilder.java new file mode 100644 index 000000000000..1da871fb8056 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsRequestOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImportProductSetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + boolean hasInputConfig(); + /** + * + * + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig getInputConfig(); + /** + * + * + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig input_config = 2; + */ + com.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigOrBuilder getInputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsResponse.java new file mode 100644 index 000000000000..01c74145cbf4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsResponse.java @@ -0,0 +1,1509 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.ImportProductSetsResponse} + */ +public final class ImportProductSetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + referenceImages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + referenceImages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.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; + } + 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 { + 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.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public java.util.List getReferenceImagesList() { + return referenceImages_; + } + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesOrBuilderList() { + return referenceImages_; + } + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public int getReferenceImagesCount() { + return referenceImages_.size(); + } + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage getReferenceImages(int index) { + return referenceImages_.get(index); + } + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < 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); + } + + @java.lang.Override + 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.v1p4beta1.ImportProductSetsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImportProductSetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the `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.v1p4beta1.ImportProductSetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ImportProductSetsResponse) + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse.class, + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse build() { + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.ReferenceImageOrBuilder> + referenceImagesBuilder_; + + /** + * + * + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder getReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder addReferenceImagesBuilder() { + return getReferenceImagesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.ReferenceImage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder addReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.ReferenceImage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesBuilderList() { + return getReferenceImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.ReferenceImageOrBuilder> + getReferenceImagesFieldBuilder() { + if (referenceImagesBuilder_ == null) { + referenceImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ImportProductSetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImportProductSetsResponse) + private static final com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsResponseOrBuilder.java new file mode 100644 index 000000000000..353a89134d44 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ImportProductSetsResponseOrBuilder.java @@ -0,0 +1,133 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ImportProductSetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ImportProductSetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + java.util.List getReferenceImagesList(); + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1p4beta1.ReferenceImage getReferenceImages(int index); + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + int getReferenceImagesCount(); + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesOrBuilderList(); + /** + * + * + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/InputConfig.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/InputConfig.java new file mode 100644 index 000000000000..3194615b79cc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/InputConfig.java @@ -0,0 +1,970 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * The desired input location and metadata.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.InputConfig} + */ +public final class InputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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() { + content_ = com.google.protobuf.ByteString.EMPTY; + 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; + case 10: + { + com.google.cloud.vision.v1p4beta1.GcsSource.Builder subBuilder = null; + if (gcsSource_ != null) { + subBuilder = gcsSource_.toBuilder(); + } + gcsSource_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gcsSource_); + gcsSource_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + mimeType_ = s; + break; + } + case 26: + { + content_ = input.readBytes(); + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_InputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.InputConfig.class, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder.class); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.GcsSource gcsSource_; + /** + * + * + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return gcsSource_ != null; + } + /** + * + * + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsSource getGcsSource() { + return gcsSource_ == null + ? com.google.cloud.vision.v1p4beta1.GcsSource.getDefaultInstance() + : gcsSource_; + } + /** + * + * + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return getGcsSource(); + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString content_; + /** + * + * + *
+   * File content, represented as a stream of bytes.
+   * Note: As with all `bytes` fields, protobuffers use a pure binary
+   * representation, whereas JSON representations use base64.
+   * Currently, this field only works for BatchAnnotateFiles requests. It does
+   * not work for AsyncBatchAnnotateFiles requests.
+   * 
+ * + * bytes content = 3; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + + 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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gcsSource_ != null) { + output.writeMessage(1, getGcsSource()); + } + if (!getMimeTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); + } + if (!content_.isEmpty()) { + output.writeBytes(3, content_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsSource()); + } + if (!getMimeTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); + } + if (!content_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, content_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p4beta1.InputConfig)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.InputConfig other = + (com.google.cloud.vision.v1p4beta1.InputConfig) obj; + + boolean result = true; + result = result && (hasGcsSource() == other.hasGcsSource()); + if (hasGcsSource()) { + result = result && getGcsSource().equals(other.getGcsSource()); + } + result = result && getContent().equals(other.getContent()); + 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().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.v1p4beta1.InputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.InputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.InputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.InputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The desired input location and metadata.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.InputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.InputConfig) + com.google.cloud.vision.v1p4beta1.InputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_InputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.InputConfig.class, + com.google.cloud.vision.v1p4beta1.InputConfig.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.InputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (gcsSourceBuilder_ == null) { + gcsSource_ = null; + } else { + gcsSource_ = null; + gcsSourceBuilder_ = null; + } + content_ = com.google.protobuf.ByteString.EMPTY; + + mimeType_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_InputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.InputConfig getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.InputConfig build() { + com.google.cloud.vision.v1p4beta1.InputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.InputConfig buildPartial() { + com.google.cloud.vision.v1p4beta1.InputConfig result = + new com.google.cloud.vision.v1p4beta1.InputConfig(this); + if (gcsSourceBuilder_ == null) { + result.gcsSource_ = gcsSource_; + } else { + result.gcsSource_ = gcsSourceBuilder_.build(); + } + result.content_ = content_; + result.mimeType_ = mimeType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.InputConfig) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.InputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.InputConfig other) { + if (other == com.google.cloud.vision.v1p4beta1.InputConfig.getDefaultInstance()) return this; + if (other.hasGcsSource()) { + mergeGcsSource(other.getGcsSource()); + } + if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { + setContent(other.getContent()); + } + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.InputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.InputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.GcsSource gcsSource_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.GcsSource, + com.google.cloud.vision.v1p4beta1.GcsSource.Builder, + com.google.cloud.vision.v1p4beta1.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null + ? com.google.cloud.vision.v1p4beta1.GcsSource.getDefaultInstance() + : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.vision.v1p4beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (gcsSource_ != null) { + gcsSource_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsSource.Builder getGcsSourceBuilder() { + + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null + ? com.google.cloud.vision.v1p4beta1.GcsSource.getDefaultInstance() + : gcsSource_; + } + } + /** + * + * + *
+     * The Google Cloud Storage location to read the input from.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.GcsSource, + com.google.cloud.vision.v1p4beta1.GcsSource.Builder, + com.google.cloud.vision.v1p4beta1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.GcsSource, + com.google.cloud.vision.v1p4beta1.GcsSource.Builder, + com.google.cloud.vision.v1p4beta1.GcsSourceOrBuilder>( + getGcsSource(), getParentForChildren(), isClean()); + gcsSource_ = null; + } + return gcsSourceBuilder_; + } + + private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * File content, represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * Currently, this field only works for BatchAnnotateFiles requests. It does
+     * not work for AsyncBatchAnnotateFiles requests.
+     * 
+ * + * bytes content = 3; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + /** + * + * + *
+     * File content, represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * Currently, this field only works for BatchAnnotateFiles requests. It does
+     * not work for AsyncBatchAnnotateFiles requests.
+     * 
+ * + * bytes content = 3; + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * File content, represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * Currently, this field only works for BatchAnnotateFiles requests. It does
+     * not work for AsyncBatchAnnotateFiles requests.
+     * 
+ * + * bytes content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + 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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.InputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.InputConfig) + private static final com.google.cloud.vision.v1p4beta1.InputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.InputConfig(); + } + + public static com.google.cloud.vision.v1p4beta1.InputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.InputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/InputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/InputConfigOrBuilder.java new file mode 100644 index 000000000000..eef180de90e1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/InputConfigOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface InputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.InputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + boolean hasGcsSource(); + /** + * + * + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1p4beta1.GcsSource getGcsSource(); + /** + * + * + *
+   * The Google Cloud Storage location to read the input from.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1p4beta1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * File content, represented as a stream of bytes.
+   * Note: As with all `bytes` fields, protobuffers use a pure binary
+   * representation, whereas JSON representations use base64.
+   * Currently, this field only works for BatchAnnotateFiles requests. It does
+   * not work for AsyncBatchAnnotateFiles requests.
+   * 
+ * + * bytes content = 3; + */ + com.google.protobuf.ByteString getContent(); + + /** + * + * + *
+   * 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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LatLongRect.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LatLongRect.java new file mode 100644 index 000000000000..cdf8e6eda221 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LatLongRect.java @@ -0,0 +1,937 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Rectangle determined by min and max `LatLng` pairs.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.LatLongRect} + */ +public final class LatLongRect extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LatLongRect_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LatLongRect_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.LatLongRect.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (minLatLng_ != null) { + output.writeMessage(1, getMinLatLng()); + } + if (maxLatLng_ != null) { + output.writeMessage(2, getMaxLatLng()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.LatLongRect)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.LatLongRect other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LatLongRect parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LatLongRect parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LatLongRect parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LatLongRect parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LatLongRect parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.LatLongRect prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Rectangle determined by min and max `LatLng` pairs.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.LatLongRect} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.LatLongRect) + com.google.cloud.vision.v1p4beta1.LatLongRectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LatLongRect_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LatLongRect_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.LatLongRect.class, + com.google.cloud.vision.v1p4beta1.LatLongRect.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LatLongRect_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LatLongRect getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.LatLongRect.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LatLongRect build() { + com.google.cloud.vision.v1p4beta1.LatLongRect result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LatLongRect buildPartial() { + com.google.cloud.vision.v1p4beta1.LatLongRect result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.LatLongRect) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.LatLongRect) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.LatLongRect other) { + if (other == com.google.cloud.vision.v1p4beta1.LatLongRect.getDefaultInstance()) return this; + if (other.hasMinLatLng()) { + mergeMinLatLng(other.getMinLatLng()); + } + if (other.hasMaxLatLng()) { + mergeMaxLatLng(other.getMaxLatLng()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.LatLongRect parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.LatLongRect) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.LatLongRect) + private static final com.google.cloud.vision.v1p4beta1.LatLongRect DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.LatLongRect(); + } + + public static com.google.cloud.vision.v1p4beta1.LatLongRect getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LatLongRect getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LatLongRectOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LatLongRectOrBuilder.java new file mode 100644 index 000000000000..8fa002a72f4a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LatLongRectOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface LatLongRectOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Likelihood.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Likelihood.java new file mode 100644 index 000000000000..ad88716e6301 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Likelihood.java @@ -0,0 +1,218 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A bucketized representation of likelihood, which is intended to give clients
+ * highly stable results across model upgrades.
+ * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p4beta1.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 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.v1p4beta1.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.v1p4beta1.Likelihood) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsRequest.java new file mode 100644 index 000000000000..6f68a4264d3e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsRequest.java @@ -0,0 +1,848 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `ListProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductSetsRequest} + */ +public final class ListProductSetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (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.v1p4beta1.ListProductSetsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ListProductSets` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductSetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ListProductSetsRequest) + com.google.cloud.vision.v1p4beta1.ListProductSetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest.class, + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductSetsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ListProductSetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductSetsRequest build() { + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductSetsRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest result = + new com.google.cloud.vision.v1p4beta1.ListProductSetsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ListProductSetsRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ListProductSetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ListProductSetsRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ListProductSetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ListProductSetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductSetsRequest) + private static final com.google.cloud.vision.v1p4beta1.ListProductSetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ListProductSetsRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.ListProductSetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductSetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsRequestOrBuilder.java new file mode 100644 index 000000000000..3df7b3ca2749 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsRequestOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ListProductSetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsResponse.java new file mode 100644 index 000000000000..26deb75befab --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsResponse.java @@ -0,0 +1,1103 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Response message for the `ListProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductSetsResponse} + */ +public final class ListProductSetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + productSets_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + productSets_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.ProductSet.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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 { + 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.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public java.util.List getProductSetsList() { + return productSets_; + } + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public java.util.List + getProductSetsOrBuilderList() { + return productSets_; + } + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public int getProductSetsCount() { + return productSets_.size(); + } + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet getProductSets(int index) { + return productSets_.get(index); + } + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < productSets_.size(); i++) { + output.writeMessage(1, productSets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.ListProductSetsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductSetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the `ListProductSets` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductSetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ListProductSetsResponse) + com.google.cloud.vision.v1p4beta1.ListProductSetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse.class, + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productSetsBuilder_ == null) { + productSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productSetsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductSetsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ListProductSetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductSetsResponse build() { + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductSetsResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ListProductSetsResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ListProductSetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ListProductSetsResponse other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ListProductSetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder> + productSetsBuilder_; + + /** + * + * + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public int getProductSetsCount() { + if (productSetsBuilder_ == null) { + return productSets_.size(); + } else { + return productSetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet getProductSets(int index) { + if (productSetsBuilder_ == null) { + return productSets_.get(index); + } else { + return productSetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public Builder setProductSets(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public Builder setProductSets( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public Builder addProductSets(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public Builder addProductSets(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public Builder addProductSets( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public Builder addProductSets( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet.Builder getProductSetsBuilder(int index) { + return getProductSetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder getProductSetsOrBuilder( + int index) { + if (productSetsBuilder_ == null) { + return productSets_.get(index); + } else { + return productSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet.Builder addProductSetsBuilder() { + return getProductSetsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance()); + } + /** + * + * + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet.Builder addProductSetsBuilder(int index) { + return getProductSetsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance()); + } + /** + * + * + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + public java.util.List + getProductSetsBuilderList() { + return getProductSetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder> + getProductSetsFieldBuilder() { + if (productSetsBuilder_ == null) { + productSetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ListProductSetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductSetsResponse) + private static final com.google.cloud.vision.v1p4beta1.ListProductSetsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ListProductSetsResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.ListProductSetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductSetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsResponseOrBuilder.java new file mode 100644 index 000000000000..a2a116319e56 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductSetsResponseOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ListProductSetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ListProductSetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + java.util.List getProductSetsList(); + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + com.google.cloud.vision.v1p4beta1.ProductSet getProductSets(int index); + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + int getProductSetsCount(); + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + java.util.List + getProductSetsOrBuilderList(); + /** + * + * + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSet product_sets = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetRequest.java new file mode 100644 index 000000000000..cc04467c3943 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetRequest.java @@ -0,0 +1,865 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `ListProductsInProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest} + */ +public final class ListProductsInProductSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (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.v1p4beta1.ListProductsInProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ListProductsInProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest) + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.Builder.class); + } + + // Construct using + // com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest build() { + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest result = + new com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest(this); + result.name_ = name_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest) + private static final com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..cb1d841e545b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetRequestOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ListProductsInProductSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetResponse.java new file mode 100644 index 000000000000..a971fabb25bf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetResponse.java @@ -0,0 +1,1111 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Response message for the `ListProductsInProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse} + */ +public final class ListProductsInProductSetResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.Product.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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 { + 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.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public java.util.List getProductsList() { + return products_; + } + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public int getProductsCount() { + return products_.size(); + } + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product getProducts(int index) { + return products_.get(index); + } + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.ListProductsInProductSetResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsInProductSetResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the `ListProductsInProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.class, + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.Builder.class); + } + + // Construct using + // com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse build() { + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) { + return mergeFrom( + (com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public Builder setProducts(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder addProducts(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductOrBuilder getProductsOrBuilder(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) + private static final com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetResponseOrBuilder.java new file mode 100644 index 000000000000..7a1d895752ac --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsInProductSetResponseOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ListProductsInProductSetResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + java.util.List getProductsList(); + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + com.google.cloud.vision.v1p4beta1.Product getProducts(int index); + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + int getProductsCount(); + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + * + * + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsRequest.java new file mode 100644 index 000000000000..893300dedf01 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsRequest.java @@ -0,0 +1,855 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `ListProducts` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductsRequest} + */ +public final class ListProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductsRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (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.v1p4beta1.ListProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ListProductsRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ListProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ListProducts` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ListProductsRequest) + com.google.cloud.vision.v1p4beta1.ListProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductsRequest.class, + com.google.cloud.vision.v1p4beta1.ListProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ListProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsRequest build() { + com.google.cloud.vision.v1p4beta1.ListProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.ListProductsRequest result = + new com.google.cloud.vision.v1p4beta1.ListProductsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ListProductsRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ListProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ListProductsRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ListProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ListProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductsRequest) + private static final com.google.cloud.vision.v1p4beta1.ListProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ListProductsRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.ListProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsRequestOrBuilder.java new file mode 100644 index 000000000000..6f3e46e3b772 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsRequestOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ListProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsResponse.java new file mode 100644 index 000000000000..cda64ba17e46 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsResponse.java @@ -0,0 +1,1099 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Response message for the `ListProducts` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductsResponse} + */ +public final class ListProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.Product.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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 { + 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.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductsResponse.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public java.util.List getProductsList() { + return products_; + } + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public int getProductsCount() { + return products_.size(); + } + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product getProducts(int index) { + return products_.get(index); + } + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < 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.v1p4beta1.ListProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ListProductsResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ListProductsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the `ListProducts` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ListProductsResponse) + com.google.cloud.vision.v1p4beta1.ListProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListProductsResponse.class, + com.google.cloud.vision.v1p4beta1.ListProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ListProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsResponse build() { + com.google.cloud.vision.v1p4beta1.ListProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.ListProductsResponse result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ListProductsResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ListProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ListProductsResponse other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ListProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public Builder setProducts(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder addProducts(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductOrBuilder getProductsOrBuilder(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance()); + } + /** + * + * + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance()); + } + /** + * + * + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ListProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductsResponse) + private static final com.google.cloud.vision.v1p4beta1.ListProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ListProductsResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.ListProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsResponseOrBuilder.java new file mode 100644 index 000000000000..82ac32d54612 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListProductsResponseOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ListProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ListProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + java.util.List getProductsList(); + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + com.google.cloud.vision.v1p4beta1.Product getProducts(int index); + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + int getProductsCount(); + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + * + * + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Product products = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesRequest.java new file mode 100644 index 000000000000..6b07025f1b16 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesRequest.java @@ -0,0 +1,872 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `ListReferenceImages` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListReferenceImagesRequest} + */ +public final class ListReferenceImagesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (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.v1p4beta1.ListReferenceImagesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ListReferenceImages` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListReferenceImagesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ListReferenceImagesRequest) + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.class, + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest build() { + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest result = + new com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ListReferenceImagesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListReferenceImagesRequest) + private static final com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesRequestOrBuilder.java new file mode 100644 index 000000000000..43e9ccd4d406 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesRequestOrBuilder.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ListReferenceImagesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesResponse.java new file mode 100644 index 000000000000..6ffbae377ba5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesResponse.java @@ -0,0 +1,1188 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Response message for the `ListReferenceImages` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListReferenceImagesResponse} + */ +public final class ListReferenceImagesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + referenceImages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + referenceImages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.ReferenceImage.parser(), + extensionRegistry)); + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + 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 { + 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.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public java.util.List getReferenceImagesList() { + return referenceImages_; + } + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesOrBuilderList() { + return referenceImages_; + } + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public int getReferenceImagesCount() { + return referenceImages_.size(); + } + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage getReferenceImages(int index) { + return referenceImages_.get(index); + } + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < 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); + } + + @java.lang.Override + 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.v1p4beta1.ListReferenceImagesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ListReferenceImagesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the `ListReferenceImages` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ListReferenceImagesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.class, + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (referenceImagesBuilder_ == null) { + referenceImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + referenceImagesBuilder_.clear(); + } + pageSize_ = 0; + + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse build() { + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse buildPartial() { + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.ReferenceImageOrBuilder> + referenceImagesBuilder_; + + /** + * + * + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder getReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder addReferenceImagesBuilder() { + return getReferenceImagesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.ReferenceImage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder addReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.ReferenceImage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesBuilderList() { + return getReferenceImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.ReferenceImageOrBuilder> + getReferenceImagesFieldBuilder() { + if (referenceImagesBuilder_ == null) { + referenceImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ReferenceImage, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) + private static final com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse(); + } + + public static com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesResponseOrBuilder.java new file mode 100644 index 000000000000..3c7ca3f7003d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ListReferenceImagesResponseOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ListReferenceImagesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + java.util.List getReferenceImagesList(); + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1p4beta1.ReferenceImage getReferenceImages(int index); + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + int getReferenceImagesCount(); + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesOrBuilderList(); + /** + * + * + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocalizedObjectAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocalizedObjectAnnotation.java new file mode 100644 index 000000000000..bf31ee908878 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocalizedObjectAnnotation.java @@ -0,0 +1,1286 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Set of detected objects with bounding boxes.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation} + */ +public final class LocalizedObjectAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly boundingPoly_; + /** + * + * + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + * + * + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + /** + * + * + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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); + } + + @java.lang.Override + 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.v1p4beta1.LocalizedObjectAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocalizedObjectAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Set of detected objects with bounding boxes.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation) + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.class, + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mid_ = ""; + + languageCode_ = ""; + + name_ = ""; + + score_ = 0F; + + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocalizedObjectAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation build() { + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation buildPartial() { + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + boundingPolyBuilder_; + /** + * + * + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + } + /** + * + * + *
+     * Image region to which this object belongs. This must be populated.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), getParentForChildren(), isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation) + private static final com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation(); + } + + public static com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocalizedObjectAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocalizedObjectAnnotationOrBuilder.java new file mode 100644 index 000000000000..f080d6e93b27 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocalizedObjectAnnotationOrBuilder.java @@ -0,0 +1,119 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface LocalizedObjectAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + boolean hasBoundingPoly(); + /** + * + * + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly(); + /** + * + * + *
+   * Image region to which this object belongs. This must be populated.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 5; + */ + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationInfo.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationInfo.java new file mode 100644 index 000000000000..b7929dd811dd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationInfo.java @@ -0,0 +1,685 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Detected entity location information.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.LocationInfo} + */ +public final class LocationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.LocationInfo.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (latLng_ != null) { + output.writeMessage(1, getLatLng()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.LocationInfo)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.LocationInfo other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.LocationInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.LocationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Detected entity location information.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.LocationInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.LocationInfo) + com.google.cloud.vision.v1p4beta1.LocationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.LocationInfo.class, + com.google.cloud.vision.v1p4beta1.LocationInfo.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (latLngBuilder_ == null) { + latLng_ = null; + } else { + latLng_ = null; + latLngBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_LocationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LocationInfo getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.LocationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LocationInfo build() { + com.google.cloud.vision.v1p4beta1.LocationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LocationInfo buildPartial() { + com.google.cloud.vision.v1p4beta1.LocationInfo result = + new com.google.cloud.vision.v1p4beta1.LocationInfo(this); + if (latLngBuilder_ == null) { + result.latLng_ = latLng_; + } else { + result.latLng_ = latLngBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.LocationInfo) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.LocationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.LocationInfo other) { + if (other == com.google.cloud.vision.v1p4beta1.LocationInfo.getDefaultInstance()) return this; + if (other.hasLatLng()) { + mergeLatLng(other.getLatLng()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.LocationInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.LocationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.LocationInfo) + private static final com.google.cloud.vision.v1p4beta1.LocationInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.LocationInfo(); + } + + public static com.google.cloud.vision.v1p4beta1.LocationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.LocationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationInfoOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationInfoOrBuilder.java new file mode 100644 index 000000000000..6c610afde366 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationInfoOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface LocationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationName.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationName.java new file mode 100644 index 000000000000..089b2fb61992 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/LocationName.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 + * + * 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.v1p4beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() {} + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/NormalizedVertex.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/NormalizedVertex.java new file mode 100644 index 000000000000..2bd0b6fcef47 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/NormalizedVertex.java @@ -0,0 +1,608 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.NormalizedVertex} + */ +public final class NormalizedVertex extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 13: + { + x_ = input.readFloat(); + break; + } + case 21: + { + y_ = input.readFloat(); + 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.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.NormalizedVertex.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (x_ != 0F) { + output.writeFloat(1, x_); + } + if (y_ != 0F) { + output.writeFloat(2, y_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (x_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, x_); + } + if (y_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, y_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vision.v1p4beta1.NormalizedVertex)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.NormalizedVertex other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.NormalizedVertex parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.NormalizedVertex parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.NormalizedVertex prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A vertex represents a 2D point in the image.
+   * NOTE: the normalized vertex coordinates are relative to the original image
+   * and range from 0 to 1.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.NormalizedVertex} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.NormalizedVertex) + com.google.cloud.vision.v1p4beta1.NormalizedVertexOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.NormalizedVertex.class, + com.google.cloud.vision.v1p4beta1.NormalizedVertex.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.NormalizedVertex.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + x_ = 0F; + + y_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_NormalizedVertex_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.NormalizedVertex getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.NormalizedVertex.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.NormalizedVertex build() { + com.google.cloud.vision.v1p4beta1.NormalizedVertex result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.NormalizedVertex buildPartial() { + com.google.cloud.vision.v1p4beta1.NormalizedVertex result = + new com.google.cloud.vision.v1p4beta1.NormalizedVertex(this); + result.x_ = x_; + result.y_ = y_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.NormalizedVertex) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.NormalizedVertex) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.NormalizedVertex other) { + if (other == com.google.cloud.vision.v1p4beta1.NormalizedVertex.getDefaultInstance()) + return this; + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.NormalizedVertex parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.NormalizedVertex) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.NormalizedVertex) + private static final com.google.cloud.vision.v1p4beta1.NormalizedVertex DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.NormalizedVertex(); + } + + public static com.google.cloud.vision.v1p4beta1.NormalizedVertex getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NormalizedVertex parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NormalizedVertex(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.NormalizedVertex getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/NormalizedVertexOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/NormalizedVertexOrBuilder.java new file mode 100644 index 000000000000..a26afb955af1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/NormalizedVertexOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface NormalizedVertexOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OperationMetadata.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OperationMetadata.java new file mode 100644 index 000000000000..52c1df8795a9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OperationMetadata.java @@ -0,0 +1,1288 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Contains metadata for the BatchAnnotateImages operation.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.OperationMetadata.class, + com.google.cloud.vision.v1p4beta1.OperationMetadata.Builder.class); + } + + /** + * + * + *
+   * Batch operation states.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p4beta1.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 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.v1p4beta1.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.v1p4beta1.OperationMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * Current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1p4beta1.OperationMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.OperationMetadata.State result = + com.google.cloud.vision.v1p4beta1.OperationMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (state_ + != com.google.cloud.vision.v1p4beta1.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); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.OperationMetadata other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Contains metadata for the BatchAnnotateImages operation.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.OperationMetadata) + com.google.cloud.vision.v1p4beta1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.OperationMetadata.class, + com.google.cloud.vision.v1p4beta1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.OperationMetadata build() { + com.google.cloud.vision.v1p4beta1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.OperationMetadata buildPartial() { + com.google.cloud.vision.v1p4beta1.OperationMetadata result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.OperationMetadata) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.OperationMetadata other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OperationMetadata.State state = 1; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1p4beta1.OperationMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.OperationMetadata.State result = + com.google.cloud.vision.v1p4beta1.OperationMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.vision.v1p4beta1.OperationMetadata.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.OperationMetadata.State state = 1; + */ + public Builder setState(com.google.cloud.vision.v1p4beta1.OperationMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.OperationMetadata) + private static final com.google.cloud.vision.v1p4beta1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.OperationMetadata(); + } + + public static com.google.cloud.vision.v1p4beta1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..511dba6429cb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OperationMetadataOrBuilder.java @@ -0,0 +1,93 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OperationMetadata.State state = 1; + */ + int getStateValue(); + /** + * + * + *
+   * Current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.OperationMetadata.State state = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OutputConfig.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OutputConfig.java new file mode 100644 index 000000000000..3954ac8d7431 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OutputConfig.java @@ -0,0 +1,815 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * The desired output location and metadata.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.OutputConfig} + */ +public final class OutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.GcsDestination.Builder subBuilder = null; + if (gcsDestination_ != null) { + subBuilder = gcsDestination_.toBuilder(); + } + gcsDestination_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gcsDestination_); + gcsDestination_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + batchSize_ = input.readInt32(); + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.OutputConfig.class, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder.class); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.GcsDestination gcsDestination_; + /** + * + * + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public boolean hasGcsDestination() { + return gcsDestination_ != null; + } + /** + * + * + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsDestination getGcsDestination() { + return gcsDestination_ == null + ? com.google.cloud.vision.v1p4beta1.GcsDestination.getDefaultInstance() + : gcsDestination_; + } + /** + * + * + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gcsDestination_ != null) { + output.writeMessage(1, getGcsDestination()); + } + if (batchSize_ != 0) { + output.writeInt32(2, batchSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.OutputConfig)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.OutputConfig other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.OutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.OutputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.OutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The desired output location and metadata.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.OutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.OutputConfig) + com.google.cloud.vision.v1p4beta1.OutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.OutputConfig.class, + com.google.cloud.vision.v1p4beta1.OutputConfig.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.OutputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (gcsDestinationBuilder_ == null) { + gcsDestination_ = null; + } else { + gcsDestination_ = null; + gcsDestinationBuilder_ = null; + } + batchSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_OutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.OutputConfig getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.OutputConfig build() { + com.google.cloud.vision.v1p4beta1.OutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.OutputConfig buildPartial() { + com.google.cloud.vision.v1p4beta1.OutputConfig result = + new com.google.cloud.vision.v1p4beta1.OutputConfig(this); + if (gcsDestinationBuilder_ == null) { + result.gcsDestination_ = gcsDestination_; + } else { + result.gcsDestination_ = gcsDestinationBuilder_.build(); + } + result.batchSize_ = batchSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.OutputConfig) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.OutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.OutputConfig other) { + if (other == com.google.cloud.vision.v1p4beta1.OutputConfig.getDefaultInstance()) return this; + if (other.hasGcsDestination()) { + mergeGcsDestination(other.getGcsDestination()); + } + if (other.getBatchSize() != 0) { + setBatchSize(other.getBatchSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.OutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.OutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.GcsDestination gcsDestination_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.GcsDestination, + com.google.cloud.vision.v1p4beta1.GcsDestination.Builder, + com.google.cloud.vision.v1p4beta1.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + return gcsDestination_ == null + ? com.google.cloud.vision.v1p4beta1.GcsDestination.getDefaultInstance() + : gcsDestination_; + } else { + return gcsDestinationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination(com.google.cloud.vision.v1p4beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (gcsDestination_ != null) { + gcsDestination_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsDestination.Builder getGcsDestinationBuilder() { + + onChanged(); + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.vision.v1p4beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (gcsDestinationBuilder_ != null) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + return gcsDestination_ == null + ? com.google.cloud.vision.v1p4beta1.GcsDestination.getDefaultInstance() + : gcsDestination_; + } + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output(s) to.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.GcsDestination, + com.google.cloud.vision.v1p4beta1.GcsDestination.Builder, + com.google.cloud.vision.v1p4beta1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.GcsDestination, + com.google.cloud.vision.v1p4beta1.GcsDestination.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.OutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.OutputConfig) + private static final com.google.cloud.vision.v1p4beta1.OutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.OutputConfig(); + } + + public static com.google.cloud.vision.v1p4beta1.OutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OutputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.OutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OutputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OutputConfigOrBuilder.java new file mode 100644 index 000000000000..980b1decf23d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/OutputConfigOrBuilder.java @@ -0,0 +1,60 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface OutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.OutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + com.google.cloud.vision.v1p4beta1.GcsDestination getGcsDestination(); + /** + * + * + *
+   * The Google Cloud Storage location to write the output(s) to.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.GcsDestination gcs_destination = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Page.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Page.java new file mode 100644 index 000000000000..97d06344567a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Page.java @@ -0,0 +1,1451 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Detected page from OCR.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Page} + */ +public final class Page extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder subBuilder = + null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block.parser(), extensionRegistry)); + break; + } + case 45: + { + confidence_ = input.readFloat(); + 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 { + 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.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Page_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Page_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Page.class, + com.google.cloud.vision.v1p4beta1.Page.Builder.class); + } + + private int bitField0_; + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_; + /** + * + * + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + * + * + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + /** + * + * + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public java.util.List getBlocksList() { + return blocks_; + } + /** + * + * + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + public java.util.List + getBlocksOrBuilderList() { + return blocks_; + } + /** + * + * + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + public int getBlocksCount() { + return blocks_.size(); + } + /** + * + * + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p4beta1.Block getBlocks(int index) { + return blocks_.get(index); + } + /** + * + * + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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); + } + + @java.lang.Override + 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.v1p4beta1.Page)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Page other = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Page prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Detected page from OCR.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Page} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Page) + com.google.cloud.vision.v1p4beta1.PageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Page_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Page_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Page.class, + com.google.cloud.vision.v1p4beta1.Page.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Page_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Page getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Page.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Page build() { + com.google.cloud.vision.v1p4beta1.Page result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Page buildPartial() { + com.google.cloud.vision.v1p4beta1.Page result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Page) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Page) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Page other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Page parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.Page) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + propertyBuilder_; + /** + * + * + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + * + * + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder + getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + } + /** + * + * + *
+     * Additional information detected on the page.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block, + com.google.cloud.vision.v1p4beta1.Block.Builder, + com.google.cloud.vision.v1p4beta1.BlockOrBuilder> + blocksBuilder_; + + /** + * + * + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public Builder setBlocks(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public Builder setBlocks( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public Builder addBlocks(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public Builder addBlocks(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public Builder addBlocks(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public Builder addBlocks( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p4beta1.Block.Builder getBlocksBuilder(int index) { + return getBlocksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p4beta1.Block.Builder addBlocksBuilder() { + return getBlocksFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Block.getDefaultInstance()); + } + /** + * + * + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + public com.google.cloud.vision.v1p4beta1.Block.Builder addBlocksBuilder(int index) { + return getBlocksFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Block.getDefaultInstance()); + } + /** + * + * + *
+     * List of blocks of text, images etc on this page.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + public java.util.List getBlocksBuilderList() { + return getBlocksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Block, + com.google.cloud.vision.v1p4beta1.Block.Builder, + com.google.cloud.vision.v1p4beta1.BlockOrBuilder> + getBlocksFieldBuilder() { + if (blocksBuilder_ == null) { + blocksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Block, + com.google.cloud.vision.v1p4beta1.Block.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Page) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Page) + private static final com.google.cloud.vision.v1p4beta1.Page DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Page(); + } + + public static com.google.cloud.vision.v1p4beta1.Page getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Page getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PageOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PageOrBuilder.java new file mode 100644 index 000000000000..bfb5dd853b0d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PageOrBuilder.java @@ -0,0 +1,128 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface PageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.Page) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + * + * + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty(); + /** + * + * + *
+   * Additional information detected on the page.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Block blocks = 4; + */ + java.util.List getBlocksList(); + /** + * + * + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + com.google.cloud.vision.v1p4beta1.Block getBlocks(int index); + /** + * + * + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + int getBlocksCount(); + /** + * + * + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + java.util.List + getBlocksOrBuilderList(); + /** + * + * + *
+   * List of blocks of text, images etc on this page.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Block blocks = 4; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Paragraph.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Paragraph.java new file mode 100644 index 000000000000..39fc35a8004d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Paragraph.java @@ -0,0 +1,1719 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Structural unit of text representing a number of words in certain order.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Paragraph} + */ +public final class Paragraph extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder subBuilder = + null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word.parser(), extensionRegistry)); + break; + } + case 37: + { + confidence_ = input.readFloat(); + 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 { + 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.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Paragraph_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Paragraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Paragraph.class, + com.google.cloud.vision.v1p4beta1.Paragraph.Builder.class); + } + + private int bitField0_; + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_; + /** + * + * + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + * + * + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + /** + * + * + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + return getProperty(); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingBox() { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public java.util.List getWordsList() { + return words_; + } + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + public java.util.List + getWordsOrBuilderList() { + return words_; + } + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + public int getWordsCount() { + return words_.size(); + } + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p4beta1.Word getWords(int index) { + return words_.get(index); + } + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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); + } + + @java.lang.Override + 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.v1p4beta1.Paragraph)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Paragraph other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Paragraph parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Paragraph prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Structural unit of text representing a number of words in certain order.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Paragraph} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Paragraph) + com.google.cloud.vision.v1p4beta1.ParagraphOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Paragraph_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Paragraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Paragraph.class, + com.google.cloud.vision.v1p4beta1.Paragraph.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Paragraph_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Paragraph getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Paragraph.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Paragraph build() { + com.google.cloud.vision.v1p4beta1.Paragraph result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Paragraph buildPartial() { + com.google.cloud.vision.v1p4beta1.Paragraph result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Paragraph) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Paragraph) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Paragraph other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Paragraph parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.Paragraph) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + propertyBuilder_; + /** + * + * + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + * + * + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder + getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + } + /** + * + * + *
+     * Additional information detected for the paragraph.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), getParentForChildren(), isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox(com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox( + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder mergeBoundingBox(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word, + com.google.cloud.vision.v1p4beta1.Word.Builder, + com.google.cloud.vision.v1p4beta1.WordOrBuilder> + wordsBuilder_; + + /** + * + * + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public Builder setWords(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public Builder setWords( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public Builder addWords(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public Builder addWords(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public Builder addWords(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public Builder addWords( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p4beta1.Word.Builder getWordsBuilder(int index) { + return getWordsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p4beta1.Word.Builder addWordsBuilder() { + return getWordsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Word.getDefaultInstance()); + } + /** + * + * + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + public com.google.cloud.vision.v1p4beta1.Word.Builder addWordsBuilder(int index) { + return getWordsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Word.getDefaultInstance()); + } + /** + * + * + *
+     * List of words in this paragraph.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + public java.util.List getWordsBuilderList() { + return getWordsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Word, + com.google.cloud.vision.v1p4beta1.Word.Builder, + com.google.cloud.vision.v1p4beta1.WordOrBuilder> + getWordsFieldBuilder() { + if (wordsBuilder_ == null) { + wordsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Word, + com.google.cloud.vision.v1p4beta1.Word.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Paragraph) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Paragraph) + private static final com.google.cloud.vision.v1p4beta1.Paragraph DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Paragraph(); + } + + public static com.google.cloud.vision.v1p4beta1.Paragraph getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Paragraph getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ParagraphOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ParagraphOrBuilder.java new file mode 100644 index 000000000000..b1780573214b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ParagraphOrBuilder.java @@ -0,0 +1,176 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ParagraphOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.Paragraph) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + * + * + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty(); + /** + * + * + *
+   * Additional information detected for the paragraph.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder(); + + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + java.util.List getWordsList(); + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + com.google.cloud.vision.v1p4beta1.Word getWords(int index); + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + int getWordsCount(); + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + java.util.List getWordsOrBuilderList(); + /** + * + * + *
+   * List of words in this paragraph.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Word words = 3; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Position.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Position.java new file mode 100644 index 000000000000..f393fbe070b6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Position.java @@ -0,0 +1,689 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.Position} + */ +public final class Position extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 13: + { + x_ = input.readFloat(); + break; + } + case 21: + { + y_ = input.readFloat(); + break; + } + case 29: + { + z_ = input.readFloat(); + 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.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Position_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Position_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Position.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (x_ != 0F) { + output.writeFloat(1, x_); + } + if (y_ != 0F) { + output.writeFloat(2, y_); + } + if (z_ != 0F) { + output.writeFloat(3, z_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (x_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, x_); + } + if (y_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, y_); + } + 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.v1p4beta1.Position)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Position other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Position parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Position parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Position parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Position parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Position parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Position prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A 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.v1p4beta1.Position} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Position) + com.google.cloud.vision.v1p4beta1.PositionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Position_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Position_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Position.class, + com.google.cloud.vision.v1p4beta1.Position.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + x_ = 0F; + + y_ = 0F; + + z_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Position_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Position getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Position.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Position build() { + com.google.cloud.vision.v1p4beta1.Position result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Position buildPartial() { + com.google.cloud.vision.v1p4beta1.Position result = + new com.google.cloud.vision.v1p4beta1.Position(this); + result.x_ = x_; + result.y_ = y_; + result.z_ = z_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Position) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Position) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Position other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Position parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Position) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Position) + private static final com.google.cloud.vision.v1p4beta1.Position DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Position(); + } + + public static com.google.cloud.vision.v1p4beta1.Position getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Position getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PositionOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PositionOrBuilder.java new file mode 100644 index 000000000000..9e4d774e1307 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PositionOrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface PositionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Product.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Product.java new file mode 100644 index 000000000000..aabc404d9e91 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Product.java @@ -0,0 +1,2598 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A Product contains ReferenceImages.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Product} + */ +public final class Product extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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.v1p4beta1.Product.KeyValue.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Product.class, + com.google.cloud.vision.v1p4beta1.Product.Builder.class); + } + + public interface KeyValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue} + */ + public static final class KeyValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Product.KeyValue.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.Product.KeyValue)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Product.KeyValue other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Product.KeyValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A product label represented as a key-value pair.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Product.KeyValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Product.KeyValue) + com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Product.KeyValue.class, + com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Product.KeyValue getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Product.KeyValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Product.KeyValue build() { + com.google.cloud.vision.v1p4beta1.Product.KeyValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Product.KeyValue buildPartial() { + com.google.cloud.vision.v1p4beta1.Product.KeyValue result = + new com.google.cloud.vision.v1p4beta1.Product.KeyValue(this); + result.key_ = key_; + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Product.KeyValue) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Product.KeyValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Product.KeyValue other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Product.KeyValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Product.KeyValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Product.KeyValue) + private static final com.google.cloud.vision.v1p4beta1.Product.KeyValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Product.KeyValue(); + } + + public static com.google.cloud.vision.v1p4beta1.Product.KeyValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.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", "apparel", or "toys".
+   * 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", "apparel", or "toys".
+   * 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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder getProductLabelsOrBuilder( + int index) { + return productLabels_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (!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.v1p4beta1.Product)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Product other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Product prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Product contains ReferenceImages.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Product} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Product) + com.google.cloud.vision.v1p4beta1.ProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Product.class, + com.google.cloud.vision.v1p4beta1.Product.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_Product_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Product getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Product build() { + com.google.cloud.vision.v1p4beta1.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Product buildPartial() { + com.google.cloud.vision.v1p4beta1.Product result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Product) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Product) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Product other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Product parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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", "apparel", or "toys".
+     * 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", "apparel", or "toys".
+     * 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", "apparel", or "toys".
+     * 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", "apparel", or "toys".
+     * 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", "apparel", or "toys".
+     * 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.v1p4beta1.Product.KeyValue, + com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public Builder setProductLabels( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public Builder setProductLabels( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder addProductLabelsBuilder() { + return getProductLabelsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder addProductLabelsBuilder( + int index) { + return getProductLabelsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + public java.util.List + getProductLabelsBuilderList() { + return getProductLabelsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product.KeyValue, + com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder, + com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder> + getProductLabelsFieldBuilder() { + if (productLabelsBuilder_ == null) { + productLabelsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product.KeyValue, + com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder, + com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder>( + productLabels_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + productLabels_ = null; + } + return productLabelsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Product) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Product) + private static final com.google.cloud.vision.v1p4beta1.Product DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Product(); + } + + public static com.google.cloud.vision.v1p4beta1.Product getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Product getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductName.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductName.java new file mode 100644 index 000000000000..2ca4c2e67a2b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductName.java @@ -0,0 +1,208 @@ +/* + * 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.v1p4beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class 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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductOrBuilder.java new file mode 100644 index 000000000000..5add73cd729e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductOrBuilder.java @@ -0,0 +1,190 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ProductOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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", "apparel", or "toys".
+   * 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", "apparel", or "toys".
+   * 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.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product.KeyValue product_labels = 5; + */ + com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder getProductLabelsOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchParams.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchParams.java new file mode 100644 index 000000000000..850bfa37aeb5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchParams.java @@ -0,0 +1,1355 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Parameters for a product search request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ProductSearchParams} + */ +public final class ProductSearchParams extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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() { + 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; + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + productSet_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + productCategories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + productCategories_.add(s); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 74: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + 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 { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + productCategories_ = productCategories_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSearchParams.class, + com.google.cloud.vision.v1p4beta1.ProductSearchParams.Builder.class); + } + + private int bitField0_; + public static final int BOUNDING_POLY_FIELD_NUMBER = 9; + private com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + public static final int PRODUCT_SET_FIELD_NUMBER = 6; + private volatile java.lang.Object productSet_; + /** + * + * + *
+   * The resource name of a [ProductSet][google.cloud.vision.v1p4beta1.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.v1p4beta1.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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.v1p4beta1.ProductSearchParams)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ProductSearchParams other = + (com.google.cloud.vision.v1p4beta1.ProductSearchParams) obj; + + boolean result = true; + result = result && (hasBoundingPoly() == other.hasBoundingPoly()); + if (hasBoundingPoly()) { + result = result && getBoundingPoly().equals(other.getBoundingPoly()); + } + 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(); + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().hashCode(); + } + 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.v1p4beta1.ProductSearchParams parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchParams parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchParams parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ProductSearchParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Parameters for a product search request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ProductSearchParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ProductSearchParams) + com.google.cloud.vision.v1p4beta1.ProductSearchParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSearchParams.class, + com.google.cloud.vision.v1p4beta1.ProductSearchParams.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + productSet_ = ""; + + productCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchParams getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchParams build() { + com.google.cloud.vision.v1p4beta1.ProductSearchParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchParams buildPartial() { + com.google.cloud.vision.v1p4beta1.ProductSearchParams result = + new com.google.cloud.vision.v1p4beta1.ProductSearchParams(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + result.productSet_ = productSet_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + productCategories_ = productCategories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.productCategories_ = productCategories_; + result.filter_ = filter_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ProductSearchParams) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ProductSearchParams) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ProductSearchParams other) { + if (other == com.google.cloud.vision.v1p4beta1.ProductSearchParams.getDefaultInstance()) + return this; + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + if (!other.getProductSet().isEmpty()) { + productSet_ = other.productSet_; + onChanged(); + } + if (!other.productCategories_.isEmpty()) { + if (productCategories_.isEmpty()) { + productCategories_ = other.productCategories_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureProductCategoriesIsMutable(); + productCategories_.addAll(other.productCategories_); + } + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ProductSearchParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.ProductSearchParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), getParentForChildren(), isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private java.lang.Object productSet_ = ""; + /** + * + * + *
+     * The resource name of a [ProductSet][google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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_ & 0x00000004) == 0x00000004)) { + productCategories_ = new com.google.protobuf.LazyStringArrayList(productCategories_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" should be
+     * specified.
+     * 
+ * + * repeated string product_categories = 7; + */ + public Builder clearProductCategories() { + productCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of product categories to search in. Currently, we only consider
+     * the first category, and either "homegoods", "apparel", or "toys" 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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ProductSearchParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchParams) + private static final com.google.cloud.vision.v1p4beta1.ProductSearchParams DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ProductSearchParams(); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchParamsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchParamsOrBuilder.java new file mode 100644 index 000000000000..ee2d6d7ce9fc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchParamsOrBuilder.java @@ -0,0 +1,147 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ProductSearchParamsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ProductSearchParams) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_poly = 9; + */ + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + * + * + *
+   * The resource name of a [ProductSet][google.cloud.vision.v1p4beta1.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.v1p4beta1.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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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", "apparel", or "toys" 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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchProto.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchProto.java new file mode 100644 index 000000000000..b3c059a7bb97 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchProto.java @@ -0,0 +1,128 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search.proto + +package com.google.cloud.vision.v1p4beta1; + +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_v1p4beta1_ProductSearchParams_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_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/v1p4beta1/product_" + + "search.proto\022\035google.cloud.vision.v1p4be" + + "ta1\032\034google/api/annotations.proto\032,googl" + + "e/cloud/vision/v1p4beta1/geometry.proto\032" + + ":google/cloud/vision/v1p4beta1/product_s" + + "earch_service.proto\032\037google/protobuf/tim" + + "estamp.proto\"\232\001\n\023ProductSearchParams\022B\n\r" + + "bounding_poly\030\t \001(\0132+.google.cloud.visio" + + "n.v1p4beta1.BoundingPoly\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\"\373\003\n\024ProductSearchResults\022.\n\nin" + + "dex_time\030\002 \001(\0132\032.google.protobuf.Timesta" + + "mp\022K\n\007results\030\005 \003(\0132:.google.cloud.visio" + + "n.v1p4beta1.ProductSearchResults.Result\022" + + "b\n\027product_grouped_results\030\006 \003(\0132A.googl" + + "e.cloud.vision.v1p4beta1.ProductSearchRe" + + "sults.GroupedResult\032_\n\006Result\0227\n\007product" + + "\030\001 \001(\0132&.google.cloud.vision.v1p4beta1.P" + + "roduct\022\r\n\005score\030\002 \001(\002\022\r\n\005image\030\003 \001(\t\032\240\001\n" + + "\rGroupedResult\022B\n\rbounding_poly\030\001 \001(\0132+." + + "google.cloud.vision.v1p4beta1.BoundingPo" + + "ly\022K\n\007results\030\002 \003(\0132:.google.cloud.visio" + + "n.v1p4beta1.ProductSearchResults.ResultB" + + "\210\001\n!com.google.cloud.vision.v1p4beta1B\022P" + + "roductSearchProtoP\001ZCgoogle.golang.org/g" + + "enproto/googleapis/cloud/vision/v1p4beta" + + "1;vision\370\001\001\242\002\004GCVNb\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.v1p4beta1.GeometryProto.getDescriptor(), + com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ProductSearchParams_descriptor, + new java.lang.String[] { + "BoundingPoly", "ProductSet", "ProductCategories", "Filter", + }); + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_descriptor, + new java.lang.String[] { + "IndexTime", "Results", "ProductGroupedResults", + }); + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_descriptor = + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_descriptor, + new java.lang.String[] { + "Product", "Score", "Image", + }); + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_descriptor = + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_descriptor, + new java.lang.String[] { + "BoundingPoly", "Results", + }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.vision.v1p4beta1.GeometryProto.getDescriptor(); + com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchResults.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchResults.java new file mode 100644 index 000000000000..eadbfb2b0bd0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchResults.java @@ -0,0 +1,4244 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Results for a product search request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ProductSearchResults} + */ +public final class ProductSearchResults extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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() { + results_ = java.util.Collections.emptyList(); + productGroupedResults_ = 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; + 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 42: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + results_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result>(); + mutable_bitField0_ |= 0x00000002; + } + results_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.parser(), + extensionRegistry)); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + productGroupedResults_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult>(); + mutable_bitField0_ |= 0x00000004; + } + productGroupedResults_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.parser(), + extensionRegistry)); + 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 { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + productGroupedResults_ = java.util.Collections.unmodifiableList(productGroupedResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.class, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Builder.class); + } + + public interface ResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ProductSearchResults.Result) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + boolean hasProduct(); + /** + * + * + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + com.google.cloud.vision.v1p4beta1.Product getProduct(); + /** + * + * + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + com.google.cloud.vision.v1p4beta1.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+     * A confidence level on the match, ranging from 0 (no confidence) to
+     * 1 (full confidence).
+     * 
+ * + * 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.v1p4beta1.ProductSearchResults.Result} + */ + public static final class Result extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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; + } + 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.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.class, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.Product product_; + /** + * + * + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product getProduct() { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.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).
+     * 
+ * + * 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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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); + } + + @java.lang.Override + 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.v1p4beta1.ProductSearchResults.Result)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Information about a product.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ProductSearchResults.Result} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ProductSearchResults.Result) + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.class, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + score_ = 0F; + + image_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_Result_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result build() { + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result buildPartial() { + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result result = + new com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result(this); + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.score_ = score_; + result.image_ = image_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.vision.v1p4beta1.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public Builder mergeProduct(com.google.cloud.vision.v1p4beta1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1p4beta1.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.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).
+       * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + /** + * + * + *
+       * A confidence level on the match, ranging from 0 (no confidence) to
+       * 1 (full confidence).
+       * 
+ * + * 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).
+       * 
+ * + * 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; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ProductSearchResults.Result) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchResults.Result) + private static final com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result(); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface GroupedResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + boolean hasBoundingPoly(); + /** + * + * + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly(); + /** + * + * + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + java.util.List getResultsList(); + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result getResults(int index); + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + int getResultsCount(); + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + java.util.List + getResultsOrBuilderList(); + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder getResultsOrBuilder( + int index); + } + /** + * + * + *
+   * Information about the products similar to a single product in a query
+   * image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult} + */ + public static final class GroupedResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) + GroupedResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupedResult.newBuilder() to construct. + private GroupedResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupedResult() { + results_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupedResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + results_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result>(); + mutable_bitField0_ |= 0x00000002; + } + results_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.parser(), + extensionRegistry)); + 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 { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + 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.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.class, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder.class); + } + + private int bitField0_; + public static final int BOUNDING_POLY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingPoly_; + /** + * + * + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + * + * + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + /** + * + * + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + public static final int RESULTS_FIELD_NUMBER = 2; + private java.util.List results_; + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + public java.util.List + getResultsList() { + return results_; + } + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result getResults(int index) { + return results_.get(index); + } + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder + getResultsOrBuilder(int index) { + return results_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (boundingPoly_ != null) { + output.writeMessage(1, getBoundingPoly()); + } + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(2, results_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (boundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBoundingPoly()); + } + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.v1p4beta1.ProductSearchResults.GroupedResult)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult other = + (com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) obj; + + boolean result = true; + result = result && (hasBoundingPoly() == other.hasBoundingPoly()); + if (hasBoundingPoly()) { + result = result && getBoundingPoly().equals(other.getBoundingPoly()); + } + 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(); + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().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.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + 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.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + com.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.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + java.io.InputStream 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.v1p4beta1.ProductSearchResults.GroupedResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + parseDelimitedFrom( + java.io.InputStream 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.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Information about the products similar to a single product in a query
+     * image.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.class, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder.class); + } + + // Construct using + // com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + resultsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_GroupedResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult build() { + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult buildPartial() { + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult result = + new com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) { + return mergeFrom( + (com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult other) { + if (other + == com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + .getDefaultInstance()) return this; + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000002); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + boundingPolyBuilder_; + /** + * + * + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public boolean hasBoundingPoly() { + return boundingPolyBuilder_ != null || boundingPoly_ != null; + } + /** + * + * + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1p4beta1.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 product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = builderForValue.build(); + onChanged(); + } else { + boundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1p4beta1.BoundingPoly.newBuilder(boundingPoly_) + .mergeFrom(value) + .buildPartial(); + } else { + boundingPoly_ = value; + } + onChanged(); + } else { + boundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.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 product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null + ? com.google.cloud.vision.v1p4beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + } + /** + * + * + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), getParentForChildren(), isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private java.util.List + results_ = java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + results_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result>(results_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + 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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + 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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public Builder setResults( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public Builder setResults( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public Builder addResults( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public Builder addResults( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public Builder addResults( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public Builder addResults( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public Builder addAllResults( + java.lang.Iterable< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result> + 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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + 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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder + getResultsBuilder(int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder> + 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.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder + addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + * + * + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder + addResultsBuilder(int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + * + * + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 2; + * + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder>( + results_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) + private static final com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult(); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupedResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupedResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + 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 RESULTS_FIELD_NUMBER = 5; + private java.util.List results_; + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List + getResultsList() { + return results_; + } + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result getResults(int index) { + return results_.get(index); + } + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int PRODUCT_GROUPED_RESULTS_FIELD_NUMBER = 6; + private java.util.List + productGroupedResults_; + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public java.util.List + getProductGroupedResultsList() { + return productGroupedResults_; + } + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder> + getProductGroupedResultsOrBuilderList() { + return productGroupedResults_; + } + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public int getProductGroupedResultsCount() { + return productGroupedResults_.size(); + } + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + getProductGroupedResults(int index) { + return productGroupedResults_.get(index); + } + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder + getProductGroupedResultsOrBuilder(int index) { + return productGroupedResults_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (indexTime_ != null) { + output.writeMessage(2, getIndexTime()); + } + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(5, results_.get(i)); + } + for (int i = 0; i < productGroupedResults_.size(); i++) { + output.writeMessage(6, productGroupedResults_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (indexTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIndexTime()); + } + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, results_.get(i)); + } + for (int i = 0; i < productGroupedResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, productGroupedResults_.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.v1p4beta1.ProductSearchResults)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ProductSearchResults other = + (com.google.cloud.vision.v1p4beta1.ProductSearchResults) obj; + + boolean result = true; + result = result && (hasIndexTime() == other.hasIndexTime()); + if (hasIndexTime()) { + result = result && getIndexTime().equals(other.getIndexTime()); + } + result = result && getResultsList().equals(other.getResultsList()); + result = result && getProductGroupedResultsList().equals(other.getProductGroupedResultsList()); + 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 (hasIndexTime()) { + hash = (37 * hash) + INDEX_TIME_FIELD_NUMBER; + hash = (53 * hash) + getIndexTime().hashCode(); + } + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (getProductGroupedResultsCount() > 0) { + hash = (37 * hash) + PRODUCT_GROUPED_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getProductGroupedResultsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.ProductSearchResults prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Results for a product search request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ProductSearchResults} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ProductSearchResults) + com.google.cloud.vision.v1p4beta1.ProductSearchResultsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.class, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) { + getResultsFieldBuilder(); + getProductGroupedResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (indexTimeBuilder_ == null) { + indexTime_ = null; + } else { + indexTime_ = null; + indexTimeBuilder_ = null; + } + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + resultsBuilder_.clear(); + } + if (productGroupedResultsBuilder_ == null) { + productGroupedResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + productGroupedResultsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSearchResults_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchResults.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults build() { + com.google.cloud.vision.v1p4beta1.ProductSearchResults result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults buildPartial() { + com.google.cloud.vision.v1p4beta1.ProductSearchResults result = + new com.google.cloud.vision.v1p4beta1.ProductSearchResults(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (indexTimeBuilder_ == null) { + result.indexTime_ = indexTime_; + } else { + result.indexTime_ = indexTimeBuilder_.build(); + } + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (productGroupedResultsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + productGroupedResults_ = java.util.Collections.unmodifiableList(productGroupedResults_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.productGroupedResults_ = productGroupedResults_; + } else { + result.productGroupedResults_ = productGroupedResultsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ProductSearchResults) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ProductSearchResults) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ProductSearchResults other) { + if (other == com.google.cloud.vision.v1p4beta1.ProductSearchResults.getDefaultInstance()) + return this; + if (other.hasIndexTime()) { + mergeIndexTime(other.getIndexTime()); + } + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000002); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (productGroupedResultsBuilder_ == null) { + if (!other.productGroupedResults_.isEmpty()) { + if (productGroupedResults_.isEmpty()) { + productGroupedResults_ = other.productGroupedResults_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureProductGroupedResultsIsMutable(); + productGroupedResults_.addAll(other.productGroupedResults_); + } + onChanged(); + } + } else { + if (!other.productGroupedResults_.isEmpty()) { + if (productGroupedResultsBuilder_.isEmpty()) { + productGroupedResultsBuilder_.dispose(); + productGroupedResultsBuilder_ = null; + productGroupedResults_ = other.productGroupedResults_; + bitField0_ = (bitField0_ & ~0x00000004); + productGroupedResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductGroupedResultsFieldBuilder() + : null; + } else { + productGroupedResultsBuilder_.addAllMessages(other.productGroupedResults_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ProductSearchResults parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.ProductSearchResults) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + 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 results_ = + java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + results_ = + new java.util.ArrayList( + results_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public Builder setResults( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public Builder setResults( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public Builder addResults(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder> + 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.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder + addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + * + * + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder>( + results_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private java.util.List + productGroupedResults_ = java.util.Collections.emptyList(); + + private void ensureProductGroupedResultsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + productGroupedResults_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult>( + productGroupedResults_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder> + productGroupedResultsBuilder_; + + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public java.util.List + getProductGroupedResultsList() { + if (productGroupedResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(productGroupedResults_); + } else { + return productGroupedResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public int getProductGroupedResultsCount() { + if (productGroupedResultsBuilder_ == null) { + return productGroupedResults_.size(); + } else { + return productGroupedResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + getProductGroupedResults(int index) { + if (productGroupedResultsBuilder_ == null) { + return productGroupedResults_.get(index); + } else { + return productGroupedResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder setProductGroupedResults( + int index, com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult value) { + if (productGroupedResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductGroupedResultsIsMutable(); + productGroupedResults_.set(index, value); + onChanged(); + } else { + productGroupedResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder setProductGroupedResults( + int index, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder + builderForValue) { + if (productGroupedResultsBuilder_ == null) { + ensureProductGroupedResultsIsMutable(); + productGroupedResults_.set(index, builderForValue.build()); + onChanged(); + } else { + productGroupedResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder addProductGroupedResults( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult value) { + if (productGroupedResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductGroupedResultsIsMutable(); + productGroupedResults_.add(value); + onChanged(); + } else { + productGroupedResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder addProductGroupedResults( + int index, com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult value) { + if (productGroupedResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductGroupedResultsIsMutable(); + productGroupedResults_.add(index, value); + onChanged(); + } else { + productGroupedResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder addProductGroupedResults( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder + builderForValue) { + if (productGroupedResultsBuilder_ == null) { + ensureProductGroupedResultsIsMutable(); + productGroupedResults_.add(builderForValue.build()); + onChanged(); + } else { + productGroupedResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder addProductGroupedResults( + int index, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder + builderForValue) { + if (productGroupedResultsBuilder_ == null) { + ensureProductGroupedResultsIsMutable(); + productGroupedResults_.add(index, builderForValue.build()); + onChanged(); + } else { + productGroupedResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder addAllProductGroupedResults( + java.lang.Iterable< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult> + values) { + if (productGroupedResultsBuilder_ == null) { + ensureProductGroupedResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productGroupedResults_); + onChanged(); + } else { + productGroupedResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder clearProductGroupedResults() { + if (productGroupedResultsBuilder_ == null) { + productGroupedResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + productGroupedResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public Builder removeProductGroupedResults(int index) { + if (productGroupedResultsBuilder_ == null) { + ensureProductGroupedResultsIsMutable(); + productGroupedResults_.remove(index); + onChanged(); + } else { + productGroupedResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder + getProductGroupedResultsBuilder(int index) { + return getProductGroupedResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder + getProductGroupedResultsOrBuilder(int index) { + if (productGroupedResultsBuilder_ == null) { + return productGroupedResults_.get(index); + } else { + return productGroupedResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder> + getProductGroupedResultsOrBuilderList() { + if (productGroupedResultsBuilder_ != null) { + return productGroupedResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(productGroupedResults_); + } + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder + addProductGroupedResultsBuilder() { + return getProductGroupedResultsFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + .getDefaultInstance()); + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder + addProductGroupedResultsBuilder(int index) { + return getProductGroupedResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + .getDefaultInstance()); + } + /** + * + * + *
+     * List of results grouped by products detected in the query image. Each entry
+     * corresponds to one bounding polygon in the query image, and contains the
+     * matching products specific to that region. There may be duplicate product
+     * matches in the union of all the per-product results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + public java.util.List< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder> + getProductGroupedResultsBuilderList() { + return getProductGroupedResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder> + getProductGroupedResultsFieldBuilder() { + if (productGroupedResultsBuilder_ == null) { + productGroupedResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.Builder, + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder>( + productGroupedResults_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + productGroupedResults_ = null; + } + return productGroupedResultsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ProductSearchResults) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchResults) + private static final com.google.cloud.vision.v1p4beta1.ProductSearchResults DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ProductSearchResults(); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSearchResults getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSearchResults getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchResultsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchResultsOrBuilder.java new file mode 100644 index 000000000000..88e3c647d3ce --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchResultsOrBuilder.java @@ -0,0 +1,178 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ProductSearchResultsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.ProductSearchResults) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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 results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + java.util.List getResultsList(); + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + com.google.cloud.vision.v1p4beta1.ProductSearchResults.Result getResults(int index); + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + int getResultsCount(); + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + java.util.List + getResultsOrBuilderList(); + /** + * + * + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.Result results = 5; + */ + com.google.cloud.vision.v1p4beta1.ProductSearchResults.ResultOrBuilder getResultsOrBuilder( + int index); + + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + java.util.List + getProductGroupedResultsList(); + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult getProductGroupedResults( + int index); + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + int getProductGroupedResultsCount(); + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder> + getProductGroupedResultsOrBuilderList(); + /** + * + * + *
+   * List of results grouped by products detected in the query image. Each entry
+   * corresponds to one bounding polygon in the query image, and contains the
+   * matching products specific to that region. There may be duplicate product
+   * matches in the union of all the per-product results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult product_grouped_results = 6; + * + */ + com.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResultOrBuilder + getProductGroupedResultsOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchServiceProto.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchServiceProto.java new file mode 100644 index 000000000000..02358a689b36 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchServiceProto.java @@ -0,0 +1,596 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +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_v1p4beta1_Product_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Product_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ProductSet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ProductSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_BatchOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_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/v1p4beta1/product_" + + "search_service.proto\022\035google.cloud.visio" + + "n.v1p4beta1\032\034google/api/annotations.prot" + + "o\032,google/cloud/vision/v1p4beta1/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.v1p4beta1.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.v1p4beta1.BoundingPoly\"s\n\024CreatePro" + + "ductRequest\022\016\n\006parent\030\001 \001(\t\0227\n\007product\030\002" + + " \001(\0132&.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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" + + "4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4" + + "beta1.ImportProductSetsInputConfig\"\212\001\n\031I" + + "mportProductSetsResponse\022G\n\020reference_im" + + "ages\030\001 \003(\0132-.google.cloud.vision.v1p4bet" + + "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." + + "v1p4beta1.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.v1p4beta1.CreateProductSetRequest\032" + + ").google.cloud.vision.v1p4beta1.ProductS" + + "et\"K\202\323\344\223\002E\"6/v1p4beta1/{parent=projects/" + + "*/locations/*}/productSets:\013product_set\022" + + "\300\001\n\017ListProductSets\0225.google.cloud.visio" + + "n.v1p4beta1.ListProductSetsRequest\0326.goo" + + "gle.cloud.vision.v1p4beta1.ListProductSe" + + "tsResponse\">\202\323\344\223\0028\0226/v1p4beta1/{parent=p" + + "rojects/*/locations/*}/productSets\022\257\001\n\rG" + + "etProductSet\0223.google.cloud.vision.v1p4b" + + "eta1.GetProductSetRequest\032).google.cloud" + + ".vision.v1p4beta1.ProductSet\">\202\323\344\223\0028\0226/v" + + "1p4beta1/{name=projects/*/locations/*/pr" + + "oductSets/*}\022\316\001\n\020UpdateProductSet\0226.goog" + + "le.cloud.vision.v1p4beta1.UpdateProductS" + + "etRequest\032).google.cloud.vision.v1p4beta" + + "1.ProductSet\"W\202\323\344\223\002Q2B/v1p4beta1/{produc" + + "t_set.name=projects/*/locations/*/produc" + + "tSets/*}:\013product_set\022\242\001\n\020DeleteProductS" + + "et\0226.google.cloud.vision.v1p4beta1.Delet" + + "eProductSetRequest\032\026.google.protobuf.Emp" + + "ty\">\202\323\344\223\0028*6/v1p4beta1/{name=projects/*/" + + "locations/*/productSets/*}\022\262\001\n\rCreatePro" + + "duct\0223.google.cloud.vision.v1p4beta1.Cre" + + "ateProductRequest\032&.google.cloud.vision." + + "v1p4beta1.Product\"D\202\323\344\223\002>\"3/v1p4beta1/{p" + + "arent=projects/*/locations/*}/products:\007" + + "product\022\264\001\n\014ListProducts\0222.google.cloud." + + "vision.v1p4beta1.ListProductsRequest\0323.g" + + "oogle.cloud.vision.v1p4beta1.ListProduct" + + "sResponse\";\202\323\344\223\0025\0223/v1p4beta1/{parent=pr" + + "ojects/*/locations/*}/products\022\243\001\n\nGetPr" + + "oduct\0220.google.cloud.vision.v1p4beta1.Ge" + + "tProductRequest\032&.google.cloud.vision.v1" + + "p4beta1.Product\";\202\323\344\223\0025\0223/v1p4beta1/{nam" + + "e=projects/*/locations/*/products/*}\022\272\001\n" + + "\rUpdateProduct\0223.google.cloud.vision.v1p" + + "4beta1.UpdateProductRequest\032&.google.clo" + + "ud.vision.v1p4beta1.Product\"L\202\323\344\223\002F2;/v1" + + "p4beta1/{product.name=projects/*/locatio" + + "ns/*/products/*}:\007product\022\231\001\n\rDeleteProd" + + "uct\0223.google.cloud.vision.v1p4beta1.Dele" + + "teProductRequest\032\026.google.protobuf.Empty" + + "\";\202\323\344\223\0025*3/v1p4beta1/{name=projects/*/lo" + + "cations/*/products/*}\022\341\001\n\024CreateReferenc" + + "eImage\022:.google.cloud.vision.v1p4beta1.C" + + "reateReferenceImageRequest\032-.google.clou" + + "d.vision.v1p4beta1.ReferenceImage\"^\202\323\344\223\002" + + "X\"E/v1p4beta1/{parent=projects/*/locatio" + + "ns/*/products/*}/referenceImages:\017refere" + + "nce_image\022\271\001\n\024DeleteReferenceImage\022:.goo" + + "gle.cloud.vision.v1p4beta1.DeleteReferen" + + "ceImageRequest\032\026.google.protobuf.Empty\"M" + + "\202\323\344\223\002G*E/v1p4beta1/{name=projects/*/loca" + + "tions/*/products/*/referenceImages/*}\022\333\001" + + "\n\023ListReferenceImages\0229.google.cloud.vis" + + "ion.v1p4beta1.ListReferenceImagesRequest" + + "\032:.google.cloud.vision.v1p4beta1.ListRef" + + "erenceImagesResponse\"M\202\323\344\223\002G\022E/v1p4beta1" + + "/{parent=projects/*/locations/*/products" + + "/*}/referenceImages\022\312\001\n\021GetReferenceImag" + + "e\0227.google.cloud.vision.v1p4beta1.GetRef" + + "erenceImageRequest\032-.google.cloud.vision" + + ".v1p4beta1.ReferenceImage\"M\202\323\344\223\002G\022E/v1p4" + + "beta1/{name=projects/*/locations/*/produ" + + "cts/*/referenceImages/*}\022\274\001\n\026AddProductT" + + "oProductSet\022<.google.cloud.vision.v1p4be" + + "ta1.AddProductToProductSetRequest\032\026.goog" + + "le.protobuf.Empty\"L\202\323\344\223\002F\"A/v1p4beta1/{n" + + "ame=projects/*/locations/*/productSets/*" + + "}:addProduct:\001*\022\311\001\n\033RemoveProductFromPro" + + "ductSet\022A.google.cloud.vision.v1p4beta1." + + "RemoveProductFromProductSetRequest\032\026.goo" + + "gle.protobuf.Empty\"O\202\323\344\223\002I\"D/v1p4beta1/{" + + "name=projects/*/locations/*/productSets/" + + "*}:removeProduct:\001*\022\344\001\n\030ListProductsInPr" + + "oductSet\022>.google.cloud.vision.v1p4beta1" + + ".ListProductsInProductSetRequest\032?.googl" + + "e.cloud.vision.v1p4beta1.ListProductsInP" + + "roductSetResponse\"G\202\323\344\223\002A\022?/v1p4beta1/{n" + + "ame=projects/*/locations/*/productSets/*" + + "}/products\022\265\001\n\021ImportProductSets\0227.googl" + + "e.cloud.vision.v1p4beta1.ImportProductSe" + + "tsRequest\032\035.google.longrunning.Operation" + + "\"H\202\323\344\223\002B\"=/v1p4beta1/{parent=projects/*/" + + "locations/*}/productSets:import:\001*B\217\001\n!c" + + "om.google.cloud.vision.v1p4beta1B\031Produc" + + "tSearchServiceProtoP\001ZCgoogle.golang.org" + + "/genproto/googleapis/cloud/vision/v1p4be" + + "ta1;vision\370\001\001\242\002\004GCVNb\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.v1p4beta1.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_v1p4beta1_Product_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p4beta1_Product_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Product_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", "ProductCategory", "ProductLabels", + }); + internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_descriptor = + internal_static_google_cloud_vision_v1p4beta1_Product_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_vision_v1p4beta1_ProductSet_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p4beta1_ProductSet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ProductSet_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "IndexTime", "IndexError", + }); + internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_descriptor, + new java.lang.String[] { + "Name", "Uri", "BoundingPolys", + }); + internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_CreateProductRequest_descriptor, + new java.lang.String[] { + "Parent", "Product", "ProductId", + }); + internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ListProductsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ListProductsResponse_descriptor, + new java.lang.String[] { + "Products", "NextPageToken", + }); + internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_GetProductRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_descriptor, + new java.lang.String[] { + "Product", "UpdateMask", + }); + internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_DeleteProductRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_CreateProductSetRequest_descriptor, + new java.lang.String[] { + "Parent", "ProductSet", "ProductSetId", + }); + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ListProductSetsResponse_descriptor, + new java.lang.String[] { + "ProductSets", "NextPageToken", + }); + internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_GetProductSetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_descriptor, + new java.lang.String[] { + "ProductSet", "UpdateMask", + }); + internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_DeleteProductSetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_CreateReferenceImageRequest_descriptor, + new java.lang.String[] { + "Parent", "ReferenceImage", "ReferenceImageId", + }); + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ListReferenceImagesResponse_descriptor, + new java.lang.String[] { + "ReferenceImages", "PageSize", "NextPageToken", + }); + internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_GetReferenceImageRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_DeleteReferenceImageRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_AddProductToProductSetRequest_descriptor, + new java.lang.String[] { + "Name", "Product", + }); + internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_descriptor, + new java.lang.String[] { + "Name", "Product", + }); + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetRequest_descriptor, + new java.lang.String[] { + "Name", "PageSize", "PageToken", + }); + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ListProductsInProductSetResponse_descriptor, + new java.lang.String[] { + "Products", "NextPageToken", + }); + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsGcsSource_descriptor, + new java.lang.String[] { + "CsvFileUri", + }); + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsInputConfig_descriptor, + new java.lang.String[] { + "GcsSource", "Source", + }); + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsRequest_descriptor, + new java.lang.String[] { + "Parent", "InputConfig", + }); + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_ImportProductSetsResponse_descriptor, + new java.lang.String[] { + "ReferenceImages", "Statuses", + }); + internal_static_google_cloud_vision_v1p4beta1_BatchOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_vision_v1p4beta1_BatchOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_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.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSet.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSet.java new file mode 100644 index 000000000000..fbb96d75daf0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSet.java @@ -0,0 +1,1370 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.ProductSet} + */ +public final class ProductSet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSet.class, + com.google.cloud.vision.v1p4beta1.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 timestamp is the default value
+   * "1970-01-01T00:00:00Z".
+   * 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 timestamp is the default value
+   * "1970-01-01T00:00:00Z".
+   * 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 timestamp is the default value
+   * "1970-01-01T00:00:00Z".
+   * 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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (indexTime_ != null) { + output.writeMessage(3, getIndexTime()); + } + if (indexError_ != null) { + output.writeMessage(4, getIndexError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (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.v1p4beta1.ProductSet)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ProductSet other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.ProductSet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A 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.v1p4beta1.ProductSet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ProductSet) + com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ProductSet.class, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ProductSet_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSet getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSet build() { + com.google.cloud.vision.v1p4beta1.ProductSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSet buildPartial() { + com.google.cloud.vision.v1p4beta1.ProductSet result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ProductSet) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ProductSet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ProductSet other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ProductSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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 timestamp is the default value
+     * "1970-01-01T00:00:00Z".
+     * 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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ProductSet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSet) + private static final com.google.cloud.vision.v1p4beta1.ProductSet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ProductSet(); + } + + public static com.google.cloud.vision.v1p4beta1.ProductSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ProductSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSetName.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSetName.java new file mode 100644 index 000000000000..949727b684e1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSetName.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 + * + * 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.v1p4beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class 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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSetOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSetOrBuilder.java new file mode 100644 index 000000000000..5681e82de02a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSetOrBuilder.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ProductSetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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 timestamp is the default value
+   * "1970-01-01T00:00:00Z".
+   * 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 timestamp is the default value
+   * "1970-01-01T00:00:00Z".
+   * 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 timestamp is the default value
+   * "1970-01-01T00:00:00Z".
+   * 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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Property.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Property.java new file mode 100644 index 000000000000..d615f6ff760a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Property.java @@ -0,0 +1,838 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A `Property` consists of a user-supplied name/value pair.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Property} + */ +public final class Property extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Property.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + if (uint64Value_ != 0L) { + output.writeUInt64(3, uint64Value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!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.v1p4beta1.Property)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Property other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Property parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Property prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A `Property` consists of a user-supplied name/value pair.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Property} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Property) + com.google.cloud.vision.v1p4beta1.PropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Property.class, + com.google.cloud.vision.v1p4beta1.Property.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + value_ = ""; + + uint64Value_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_Property_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Property getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Property.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Property build() { + com.google.cloud.vision.v1p4beta1.Property result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Property buildPartial() { + com.google.cloud.vision.v1p4beta1.Property result = + new com.google.cloud.vision.v1p4beta1.Property(this); + result.name_ = name_; + result.value_ = value_; + result.uint64Value_ = uint64Value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Property) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Property) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Property other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Property parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Property) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Property) + private static final com.google.cloud.vision.v1p4beta1.Property DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Property(); + } + + public static com.google.cloud.vision.v1p4beta1.Property getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Property getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PropertyOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PropertyOrBuilder.java new file mode 100644 index 000000000000..d9cea549176c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/PropertyOrBuilder.java @@ -0,0 +1,63 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface PropertyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImage.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImage.java new file mode 100644 index 000000000000..905df6291550 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImage.java @@ -0,0 +1,1435 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A `ReferenceImage` represents a product image and its associated metadata,
+ * such as bounding boxes.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ReferenceImage} + */ +public final class ReferenceImage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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.v1p4beta1.BoundingPoly.parser(), extensionRegistry)); + 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 { + 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.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ReferenceImage.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolysOrBuilder( + int index) { + return boundingPolys_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!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.v1p4beta1.ReferenceImage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.ReferenceImage other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ReferenceImage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.ReferenceImage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A `ReferenceImage` represents a product image and its associated metadata,
+   * such as bounding boxes.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.ReferenceImage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.ReferenceImage) + com.google.cloud.vision.v1p4beta1.ReferenceImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.ReferenceImage.class, + com.google.cloud.vision.v1p4beta1.ReferenceImage.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + uri_ = ""; + + if (boundingPolysBuilder_ == null) { + boundingPolys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + boundingPolysBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_ReferenceImage_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ReferenceImage getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.ReferenceImage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ReferenceImage build() { + com.google.cloud.vision.v1p4beta1.ReferenceImage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ReferenceImage buildPartial() { + com.google.cloud.vision.v1p4beta1.ReferenceImage result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.ReferenceImage) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.ReferenceImage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.ReferenceImage other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.ReferenceImage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public Builder setBoundingPolys( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public Builder setBoundingPolys( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder addBoundingPolysBuilder() { + return getBoundingPolysFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder addBoundingPolysBuilder( + int index) { + return getBoundingPolysFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + public java.util.List + getBoundingPolysBuilderList() { + return getBoundingPolysFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingPolysFieldBuilder() { + if (boundingPolysBuilder_ == null) { + boundingPolysBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder>( + boundingPolys_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + boundingPolys_ = null; + } + return boundingPolysBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.ReferenceImage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ReferenceImage) + private static final com.google.cloud.vision.v1p4beta1.ReferenceImage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.ReferenceImage(); + } + + public static com.google.cloud.vision.v1p4beta1.ReferenceImage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.ReferenceImage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImageName.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImageName.java new file mode 100644 index 000000000000..96e4e7870242 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImageName.java @@ -0,0 +1,249 @@ +/* + * 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.v1p4beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class 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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImageOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImageOrBuilder.java new file mode 100644 index 000000000000..271f9da7a565 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/ReferenceImageOrBuilder.java @@ -0,0 +1,144 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface ReferenceImageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_polys = 3; + */ + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingPolysOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/RemoveProductFromProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/RemoveProductFromProductSetRequest.java new file mode 100644 index 000000000000..1612204bd707 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/RemoveProductFromProductSetRequest.java @@ -0,0 +1,801 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `RemoveProductFromProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest} + */ +public final class RemoveProductFromProductSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + product_ = s; + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getProductBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, product_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!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.v1p4beta1.RemoveProductFromProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.RemoveProductFromProductSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.RemoveProductFromProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.RemoveProductFromProductSetRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.RemoveProductFromProductSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.RemoveProductFromProductSetRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `RemoveProductFromProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest) + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.Builder.class); + } + + // Construct using + // com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + product_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_RemoveProductFromProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest build() { + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest result = + new com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest(this); + result.name_ = name_; + result.product_ = product_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest) { + return mergeFrom( + (com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest) + private static final com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/RemoveProductFromProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/RemoveProductFromProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..43f596760f99 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/RemoveProductFromProductSetRequestOrBuilder.java @@ -0,0 +1,60 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface RemoveProductFromProductSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SafeSearchAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SafeSearchAnnotation.java new file mode 100644 index 000000000000..01a9070efc23 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SafeSearchAnnotation.java @@ -0,0 +1,1137 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.SafeSearchAnnotation} + */ +public final class SafeSearchAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood adult = 1; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getAdult() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(adult_); + return result == null ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood spoof = 2; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getSpoof() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(spoof_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int MEDICAL_FIELD_NUMBER = 3; + private int medical_; + /** + * + * + *
+   * Likelihood that this is a medical image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood medical = 3; + */ + public int getMedicalValue() { + return medical_; + } + /** + * + * + *
+   * Likelihood that this is a medical image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood medical = 3; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getMedical() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(medical_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + public static final int VIOLENCE_FIELD_NUMBER = 4; + private int violence_; + /** + * + * + *
+   * Likelihood that this image contains violent content.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood violence = 4; + */ + public int getViolenceValue() { + return violence_; + } + /** + * + * + *
+   * Likelihood that this image contains violent content.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood violence = 4; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getViolence() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(violence_); + return result == null ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood racy = 9; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getRacy() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(racy_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (adult_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(1, adult_); + } + if (spoof_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(2, spoof_); + } + if (medical_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(3, medical_); + } + if (violence_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(4, violence_); + } + if (racy_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + output.writeEnum(9, racy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (adult_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, adult_); + } + if (spoof_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, spoof_); + } + if (medical_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, medical_); + } + if (violence_ != com.google.cloud.vision.v1p4beta1.Likelihood.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, violence_); + } + if (racy_ != com.google.cloud.vision.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.SafeSearchAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * 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.v1p4beta1.SafeSearchAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.SafeSearchAnnotation) + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.class, + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + adult_ = 0; + + spoof_ = 0; + + medical_ = 0; + + violence_ = 0; + + racy_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_SafeSearchAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation build() { + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation buildPartial() { + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation result = + new com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation(this); + result.adult_ = adult_; + result.spoof_ = spoof_; + result.medical_ = medical_; + result.violence_ = violence_; + result.racy_ = racy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood adult = 1; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getAdult() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(adult_); + return result == null ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Likelihood adult = 1; + */ + public Builder setAdult(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood spoof = 2; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getSpoof() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(spoof_); + return result == null ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Likelihood spoof = 2; + */ + public Builder setSpoof(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood medical = 3; + */ + public int getMedicalValue() { + return medical_; + } + /** + * + * + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood medical = 3; + */ + public Builder setMedicalValue(int value) { + medical_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood medical = 3; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getMedical() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(medical_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood medical = 3; + */ + public Builder setMedical(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + medical_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Likelihood that this is a medical image.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.Likelihood violence = 4; + */ + public int getViolenceValue() { + return violence_; + } + /** + * + * + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood violence = 4; + */ + public Builder setViolenceValue(int value) { + violence_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood violence = 4; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getViolence() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(violence_); + return result == null ? com.google.cloud.vision.v1p4beta1.Likelihood.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood violence = 4; + */ + public Builder setViolence(com.google.cloud.vision.v1p4beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + violence_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Likelihood that this image contains violent content.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood racy = 9; + */ + public com.google.cloud.vision.v1p4beta1.Likelihood getRacy() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.Likelihood result = + com.google.cloud.vision.v1p4beta1.Likelihood.valueOf(racy_); + return result == null ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Likelihood racy = 9; + */ + public Builder setRacy(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Likelihood racy = 9; + */ + public Builder clearRacy() { + + racy_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.SafeSearchAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.SafeSearchAnnotation) + private static final com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation(); + } + + public static com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.SafeSearchAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SafeSearchAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SafeSearchAnnotationOrBuilder.java new file mode 100644 index 000000000000..7f6b625fd878 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SafeSearchAnnotationOrBuilder.java @@ -0,0 +1,129 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface SafeSearchAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood adult = 1; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood spoof = 2; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getSpoof(); + + /** + * + * + *
+   * Likelihood that this is a medical image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood medical = 3; + */ + int getMedicalValue(); + /** + * + * + *
+   * Likelihood that this is a medical image.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood medical = 3; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getMedical(); + + /** + * + * + *
+   * Likelihood that this image contains violent content.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood violence = 4; + */ + int getViolenceValue(); + /** + * + * + *
+   * Likelihood that this image contains violent content.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Likelihood violence = 4; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Likelihood racy = 9; + */ + com.google.cloud.vision.v1p4beta1.Likelihood getRacy(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Symbol.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Symbol.java new file mode 100644 index 000000000000..e3e4f628403b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Symbol.java @@ -0,0 +1,1388 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A single symbol representation.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Symbol} + */ +public final class Symbol extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder subBuilder = + null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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; + } + 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.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Symbol_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Symbol_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Symbol.class, + com.google.cloud.vision.v1p4beta1.Symbol.Builder.class); + } + + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_; + /** + * + * + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + * + * + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + /** + * + * + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + return getProperty(); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingBox() { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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); + } + + @java.lang.Override + 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.v1p4beta1.Symbol)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Symbol other = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Symbol prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A single symbol representation.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Symbol} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Symbol) + com.google.cloud.vision.v1p4beta1.SymbolOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Symbol_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Symbol_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Symbol.class, + com.google.cloud.vision.v1p4beta1.Symbol.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Symbol_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Symbol getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Symbol.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Symbol build() { + com.google.cloud.vision.v1p4beta1.Symbol result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Symbol buildPartial() { + com.google.cloud.vision.v1p4beta1.Symbol result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Symbol) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Symbol) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Symbol other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Symbol parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.Symbol) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + propertyBuilder_; + /** + * + * + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + * + * + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder + getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + } + /** + * + * + *
+     * Additional information detected for the symbol.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), getParentForChildren(), isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder mergeBoundingBox(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Symbol) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Symbol) + private static final com.google.cloud.vision.v1p4beta1.Symbol DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Symbol(); + } + + public static com.google.cloud.vision.v1p4beta1.Symbol getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Symbol getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SymbolOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SymbolOrBuilder.java new file mode 100644 index 000000000000..404a47224ffd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/SymbolOrBuilder.java @@ -0,0 +1,146 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface SymbolOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.Symbol) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + * + * + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty(); + /** + * + * + *
+   * Additional information detected for the symbol.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotation.java new file mode 100644 index 000000000000..6e1b71bb6c4d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotation.java @@ -0,0 +1,4181 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.TextAnnotation.TextProperty] message definition below for more
+ * detail.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.TextAnnotation} + */ +public final class TextAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + pages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + pages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.Page.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + text_ = s; + 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 { + 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.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.TextAnnotation.class, + com.google.cloud.vision.v1p4beta1.TextAnnotation.Builder.class); + } + + public interface DetectedLanguageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage} + */ + public static final class DetectedLanguage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 21: + { + confidence_ = input.readFloat(); + 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.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, languageCode_); + } + if (confidence_ != 0F) { + output.writeFloat(2, confidence_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.TextAnnotation.DetectedLanguage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Detected language for a structural component.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage) + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.class, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.Builder.class); + } + + // Construct using + // com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + languageCode_ = ""; + + confidence_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage build() { + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage buildPartial() { + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage result = + new com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage(this); + result.languageCode_ = languageCode_; + result.confidence_ = confidence_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage) { + return mergeFrom( + (com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage) + private static final com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage(); + } + + public static com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DetectedBreakOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Detected break type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + int getTypeValue(); + /** + * + * + *
+     * Detected break type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak} + */ + public static final class DetectedBreak extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 8: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 16: + { + isPrefix_ = input.readBool(); + 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.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.class, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.Builder.class); + } + + /** + * + * + *
+     * Enum to denote the type of break found. New line, space etc.
+     * 
+ * + * Protobuf enum {@code google.cloud.vision.v1p4beta1.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 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.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak.BreakType) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * + * + *
+     * Detected break type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Detected break type.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType result = + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType.valueOf(type_); + return result == null + ? com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ + != com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType.UNKNOWN + .getNumber()) { + output.writeEnum(1, type_); + } + if (isPrefix_ != false) { + output.writeBool(2, isPrefix_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Detected start or end of a structural component.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak) + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreakOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.class, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + + isPrefix_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak build() { + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak buildPartial() { + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak result = + new com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak(this); + result.type_ = type_; + result.isPrefix_ = isPrefix_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + * + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + * + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType result = + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType.valueOf(type_); + return result == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType type = 1; + * + */ + public Builder setType( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Detected break type.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak) + private static final com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak(); + } + + public static com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TextPropertyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + java.util.List + getDetectedLanguagesList(); + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage getDetectedLanguages( + int index); + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + int getDetectedLanguagesCount(); + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder> + getDetectedLanguagesOrBuilderList(); + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder + getDetectedLanguagesOrBuilder(int index); + + /** + * + * + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + boolean hasDetectedBreak(); + /** + * + * + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak getDetectedBreak(); + /** + * + * + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreakOrBuilder + getDetectedBreakOrBuilder(); + } + /** + * + * + *
+   * Additional information detected on the structural component.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty} + */ + public static final class TextProperty extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + detectedLanguages_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage>(); + mutable_bitField0_ |= 0x00000001; + } + detectedLanguages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.parser(), + extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.Builder subBuilder = + null; + if (detectedBreak_ != null) { + subBuilder = detectedBreak_.toBuilder(); + } + detectedBreak_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(detectedBreak_); + detectedBreak_ = subBuilder.buildPartial(); + } + + 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 { + 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.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public java.util.List + getDetectedLanguagesList() { + return detectedLanguages_; + } + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder> + getDetectedLanguagesOrBuilderList() { + return detectedLanguages_; + } + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public int getDetectedLanguagesCount() { + return detectedLanguages_.size(); + } + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage getDetectedLanguages( + int index) { + return detectedLanguages_.get(index); + } + /** + * + * + *
+     * A list of detected languages together with confidence.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder + getDetectedLanguagesOrBuilder(int index) { + return detectedLanguages_.get(index); + } + + public static final int DETECTED_BREAK_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detectedBreak_; + /** + * + * + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public boolean hasDetectedBreak() { + return detectedBreak_ != null; + } + /** + * + * + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak getDetectedBreak() { + return detectedBreak_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.getDefaultInstance() + : detectedBreak_; + } + /** + * + * + *
+     * Detected start or end of a text segment.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreakOrBuilder + getDetectedBreakOrBuilder() { + return getDetectedBreak(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < detectedLanguages_.size(); i++) { + output.writeMessage(1, detectedLanguages_.get(i)); + } + if (detectedBreak_ != null) { + output.writeMessage(2, getDetectedBreak()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.TextAnnotation.TextProperty)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Additional information detected on the structural component.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty) + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.class, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty build() { + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty buildPartial() { + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty other) { + if (other + == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage>( + detectedLanguages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder> + detectedLanguagesBuilder_; + + /** + * + * + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public Builder setDetectedLanguages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public Builder setDetectedLanguages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public Builder addDetectedLanguages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public Builder addDetectedLanguages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public Builder addDetectedLanguages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public Builder addDetectedLanguages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public Builder addAllDetectedLanguages( + java.lang.Iterable< + ? extends com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage> + 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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.Builder + getDetectedLanguagesBuilder(int index) { + return getDetectedLanguagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder> + 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.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.Builder + addDetectedLanguagesBuilder() { + return getDetectedLanguagesFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + .getDefaultInstance()); + } + /** + * + * + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.Builder + addDetectedLanguagesBuilder(int index) { + return getDetectedLanguagesFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + .getDefaultInstance()); + } + /** + * + * + *
+       * A list of detected languages together with confidence.
+       * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage detected_languages = 1; + * + */ + public java.util.List< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.Builder> + getDetectedLanguagesBuilderList() { + return getDetectedLanguagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder> + getDetectedLanguagesFieldBuilder() { + if (detectedLanguagesBuilder_ == null) { + detectedLanguagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguageOrBuilder>( + detectedLanguages_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + detectedLanguages_ = null; + } + return detectedLanguagesBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detectedBreak_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreakOrBuilder> + detectedBreakBuilder_; + /** + * + * + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + * + */ + public boolean hasDetectedBreak() { + return detectedBreakBuilder_ != null || detectedBreak_ != null; + } + /** + * + * + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak getDetectedBreak() { + if (detectedBreakBuilder_ == null) { + return detectedBreak_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.getDefaultInstance() + : detectedBreak_; + } else { + return detectedBreakBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + * + */ + public Builder setDetectedBreak( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + * + */ + public Builder setDetectedBreak( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + * + */ + public Builder mergeDetectedBreak( + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak value) { + if (detectedBreakBuilder_ == null) { + if (detectedBreak_ != null) { + detectedBreak_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.Builder + getDetectedBreakBuilder() { + + onChanged(); + return getDetectedBreakFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreakOrBuilder + getDetectedBreakOrBuilder() { + if (detectedBreakBuilder_ != null) { + return detectedBreakBuilder_.getMessageOrBuilder(); + } else { + return detectedBreak_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.getDefaultInstance() + : detectedBreak_; + } + } + /** + * + * + *
+       * Detected start or end of a text segment.
+       * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak detected_break = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreakOrBuilder> + getDetectedBreakFieldBuilder() { + if (detectedBreakBuilder_ == null) { + detectedBreakBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreakOrBuilder>( + getDetectedBreak(), getParentForChildren(), isClean()); + detectedBreak_ = null; + } + return detectedBreakBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty) + private static final com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty(); + } + + public static com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public java.util.List getPagesList() { + return pages_; + } + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + public java.util.List + getPagesOrBuilderList() { + return pages_; + } + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + public int getPagesCount() { + return pages_.size(); + } + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p4beta1.Page getPages(int index) { + return pages_.get(index); + } + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < pages_.size(); i++) { + output.writeMessage(1, pages_.get(i)); + } + if (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, text_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.TextAnnotation)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.TextAnnotation other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.TextAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * 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.v1p4beta1.TextAnnotation.TextProperty] message definition below for more
+   * detail.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.TextAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.TextAnnotation) + com.google.cloud.vision.v1p4beta1.TextAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.TextAnnotation.class, + com.google.cloud.vision.v1p4beta1.TextAnnotation.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (pagesBuilder_ == null) { + pages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + pagesBuilder_.clear(); + } + text_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation build() { + com.google.cloud.vision.v1p4beta1.TextAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation buildPartial() { + com.google.cloud.vision.v1p4beta1.TextAnnotation result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.TextAnnotation) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.TextAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.TextAnnotation other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.TextAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page, + com.google.cloud.vision.v1p4beta1.Page.Builder, + com.google.cloud.vision.v1p4beta1.PageOrBuilder> + pagesBuilder_; + + /** + * + * + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public Builder setPages(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public Builder setPages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public Builder addPages(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public Builder addPages(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public Builder addPages(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public Builder addPages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p4beta1.Page.Builder getPagesBuilder(int index) { + return getPagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p4beta1.Page.Builder addPagesBuilder() { + return getPagesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Page.getDefaultInstance()); + } + /** + * + * + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + public com.google.cloud.vision.v1p4beta1.Page.Builder addPagesBuilder(int index) { + return getPagesFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Page.getDefaultInstance()); + } + /** + * + * + *
+     * List of pages detected by OCR.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + public java.util.List getPagesBuilderList() { + return getPagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Page, + com.google.cloud.vision.v1p4beta1.Page.Builder, + com.google.cloud.vision.v1p4beta1.PageOrBuilder> + getPagesFieldBuilder() { + if (pagesBuilder_ == null) { + pagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Page, + com.google.cloud.vision.v1p4beta1.Page.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.TextAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.TextAnnotation) + private static final com.google.cloud.vision.v1p4beta1.TextAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.TextAnnotation(); + } + + public static com.google.cloud.vision.v1p4beta1.TextAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.TextAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotationOrBuilder.java new file mode 100644 index 000000000000..19fed835f6ea --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotationOrBuilder.java @@ -0,0 +1,82 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface TextAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.TextAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + java.util.List getPagesList(); + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + com.google.cloud.vision.v1p4beta1.Page getPages(int index); + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + int getPagesCount(); + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + java.util.List getPagesOrBuilderList(); + /** + * + * + *
+   * List of pages detected by OCR.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Page pages = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotationProto.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotationProto.java new file mode 100644 index 000000000000..e5a0e5f253d0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/TextAnnotationProto.java @@ -0,0 +1,212 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +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_v1p4beta1_TextAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Page_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Page_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Block_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Block_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Paragraph_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Paragraph_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Word_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_Word_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_Symbol_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_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/v1p4beta1/text_ann" + + "otation.proto\022\035google.cloud.vision.v1p4b" + + "eta1\032\034google/api/annotations.proto\032,goog" + + "le/cloud/vision/v1p4beta1/geometry.proto" + + "\"\262\004\n\016TextAnnotation\0222\n\005pages\030\001 \003(\0132#.goo" + + "gle.cloud.vision.v1p4beta1.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.v1p4beta1.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" + + "1p4beta1.TextAnnotation.DetectedLanguage" + + "\022S\n\016detected_break\030\002 \001(\0132;.google.cloud." + + "vision.v1p4beta1.TextAnnotation.Detected" + + "Break\"\275\001\n\004Page\022L\n\010property\030\001 \001(\0132:.googl" + + "e.cloud.vision.v1p4beta1.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.v1p4beta1.Block\022\022\n\nconfidence\030\005 \001(\002\"\202\003" + + "\n\005Block\022L\n\010property\030\001 \001(\0132:.google.cloud" + + ".vision.v1p4beta1.TextAnnotation.TextPro" + + "perty\022A\n\014bounding_box\030\002 \001(\0132+.google.clo" + + "ud.vision.v1p4beta1.BoundingPoly\022<\n\npara" + + "graphs\030\003 \003(\0132(.google.cloud.vision.v1p4b" + + "eta1.Paragraph\022B\n\nblock_type\030\004 \001(\0162..goo" + + "gle.cloud.vision.v1p4beta1.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" + + ".v1p4beta1.TextAnnotation.TextProperty\022A" + + "\n\014bounding_box\030\002 \001(\0132+.google.cloud.visi" + + "on.v1p4beta1.BoundingPoly\0222\n\005words\030\003 \003(\013" + + "2#.google.cloud.vision.v1p4beta1.Word\022\022\n" + + "\nconfidence\030\004 \001(\002\"\343\001\n\004Word\022L\n\010property\030\001" + + " \001(\0132:.google.cloud.vision.v1p4beta1.Tex" + + "tAnnotation.TextProperty\022A\n\014bounding_box" + + "\030\002 \001(\0132+.google.cloud.vision.v1p4beta1.B" + + "oundingPoly\0226\n\007symbols\030\003 \003(\0132%.google.cl" + + "oud.vision.v1p4beta1.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.v1p4beta1.TextAnnotat" + + "ion.TextProperty\022A\n\014bounding_box\030\002 \001(\0132+" + + ".google.cloud.vision.v1p4beta1.BoundingP" + + "oly\022\014\n\004text\030\003 \001(\t\022\022\n\nconfidence\030\004 \001(\002B\211\001" + + "\n!com.google.cloud.vision.v1p4beta1B\023Tex" + + "tAnnotationProtoP\001ZCgoogle.golang.org/ge" + + "nproto/googleapis/cloud/vision/v1p4beta1" + + ";vision\370\001\001\242\002\004GCVNb\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.v1p4beta1.GeometryProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_descriptor, + new java.lang.String[] { + "Pages", "Text", + }); + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_descriptor = + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedLanguage_descriptor, + new java.lang.String[] { + "LanguageCode", "Confidence", + }); + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_descriptor = + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_DetectedBreak_descriptor, + new java.lang.String[] { + "Type", "IsPrefix", + }); + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_descriptor = + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_TextAnnotation_TextProperty_descriptor, + new java.lang.String[] { + "DetectedLanguages", "DetectedBreak", + }); + internal_static_google_cloud_vision_v1p4beta1_Page_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vision_v1p4beta1_Page_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Page_descriptor, + new java.lang.String[] { + "Property", "Width", "Height", "Blocks", "Confidence", + }); + internal_static_google_cloud_vision_v1p4beta1_Block_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vision_v1p4beta1_Block_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Block_descriptor, + new java.lang.String[] { + "Property", "BoundingBox", "Paragraphs", "BlockType", "Confidence", + }); + internal_static_google_cloud_vision_v1p4beta1_Paragraph_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vision_v1p4beta1_Paragraph_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Paragraph_descriptor, + new java.lang.String[] { + "Property", "BoundingBox", "Words", "Confidence", + }); + internal_static_google_cloud_vision_v1p4beta1_Word_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vision_v1p4beta1_Word_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Word_descriptor, + new java.lang.String[] { + "Property", "BoundingBox", "Symbols", "Confidence", + }); + internal_static_google_cloud_vision_v1p4beta1_Symbol_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vision_v1p4beta1_Symbol_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_Symbol_descriptor, + new java.lang.String[] { + "Property", "BoundingBox", "Text", "Confidence", + }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.vision.v1p4beta1.GeometryProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductRequest.java new file mode 100644 index 000000000000..60c158b4afec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductRequest.java @@ -0,0 +1,1025 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `UpdateProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.UpdateProductRequest} + */ +public final class UpdateProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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; + } + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.UpdateProductRequest.class, + com.google.cloud.vision.v1p4beta1.UpdateProductRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.Product product_; + /** + * + * + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product getProduct() { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (product_ != null) { + output.writeMessage(1, getProduct()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (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.v1p4beta1.UpdateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.UpdateProductRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.UpdateProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `UpdateProduct` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.UpdateProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.UpdateProductRequest) + com.google.cloud.vision.v1p4beta1.UpdateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.UpdateProductRequest.class, + com.google.cloud.vision.v1p4beta1.UpdateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.UpdateProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.UpdateProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.UpdateProductRequest build() { + com.google.cloud.vision.v1p4beta1.UpdateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.UpdateProductRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.UpdateProductRequest result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.UpdateProductRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.UpdateProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.UpdateProductRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.UpdateProductRequest.getDefaultInstance()) + return this; + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.UpdateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.UpdateProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product product = 1; + */ + public Builder mergeProduct(com.google.cloud.vision.v1p4beta1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Product, + com.google.cloud.vision.v1p4beta1.Product.Builder, + com.google.cloud.vision.v1p4beta1.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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.UpdateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.UpdateProductRequest) + private static final com.google.cloud.vision.v1p4beta1.UpdateProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.UpdateProductRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.UpdateProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.UpdateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductRequestOrBuilder.java new file mode 100644 index 000000000000..65f6eb0b366d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface UpdateProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.UpdateProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + boolean hasProduct(); + /** + * + * + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + com.google.cloud.vision.v1p4beta1.Product getProduct(); + /** + * + * + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.Product product = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductSetRequest.java new file mode 100644 index 000000000000..cde274944ea8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductSetRequest.java @@ -0,0 +1,1002 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Request message for the `UpdateProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.UpdateProductSetRequest} + */ +public final class UpdateProductSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.ProductSet.Builder subBuilder = null; + if (productSet_ != null) { + subBuilder = productSet_.toBuilder(); + } + productSet_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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; + } + 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.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest.Builder.class); + } + + public static final int PRODUCT_SET_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.ProductSet productSet_; + /** + * + * + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + public boolean hasProductSet() { + return productSet_ != null; + } + /** + * + * + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet getProductSet() { + return productSet_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance() + : productSet_; + } + /** + * + * + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (productSet_ != null) { + output.writeMessage(1, getProductSet()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (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.v1p4beta1.UpdateProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.UpdateProductSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `UpdateProductSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.UpdateProductSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.UpdateProductSetRequest) + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest.class, + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto + .internal_static_google_cloud_vision_v1p4beta1_UpdateProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest build() { + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest buildPartial() { + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest other) { + if (other == com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest.getDefaultInstance()) + return this; + if (other.hasProductSet()) { + mergeProductSet(other.getProductSet()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1p4beta1.ProductSet productSet_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder> + productSetBuilder_; + /** + * + * + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet getProductSet() { + if (productSetBuilder_ == null) { + return productSet_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance() + : productSet_; + } else { + return productSetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + public Builder setProductSet(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_set = 1; + */ + public Builder setProductSet( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSet product_set = 1; + */ + public Builder mergeProductSet(com.google.cloud.vision.v1p4beta1.ProductSet value) { + if (productSetBuilder_ == null) { + if (productSet_ != null) { + productSet_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSet.Builder getProductSetBuilder() { + + onChanged(); + return getProductSetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder getProductSetOrBuilder() { + if (productSetBuilder_ != null) { + return productSetBuilder_.getMessageOrBuilder(); + } else { + return productSet_ == null + ? com.google.cloud.vision.v1p4beta1.ProductSet.getDefaultInstance() + : productSet_; + } + } + /** + * + * + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.ProductSetOrBuilder> + getProductSetFieldBuilder() { + if (productSetBuilder_ == null) { + productSetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.ProductSet, + com.google.cloud.vision.v1p4beta1.ProductSet.Builder, + com.google.cloud.vision.v1p4beta1.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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.UpdateProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.UpdateProductSetRequest) + private static final com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest(); + } + + public static com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.UpdateProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..1cceef4ef3d6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/UpdateProductSetRequestOrBuilder.java @@ -0,0 +1,81 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/product_search_service.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface UpdateProductSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.UpdateProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + boolean hasProductSet(); + /** + * + * + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + com.google.cloud.vision.v1p4beta1.ProductSet getProductSet(); + /** + * + * + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.ProductSet product_set = 1; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Vertex.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Vertex.java new file mode 100644 index 000000000000..fdba9b29cd70 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Vertex.java @@ -0,0 +1,597 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * 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.v1p4beta1.Vertex} + */ +public final class Vertex extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 8: + { + x_ = input.readInt32(); + break; + } + case 16: + { + y_ = input.readInt32(); + 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.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Vertex_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Vertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Vertex.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (x_ != 0) { + output.writeInt32(1, x_); + } + if (y_ != 0) { + output.writeInt32(2, y_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.Vertex)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Vertex other = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Vertex parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Vertex prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A vertex represents a 2D point in the image.
+   * NOTE: the vertex coordinates are in the same scale as the original image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Vertex} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Vertex) + com.google.cloud.vision.v1p4beta1.VertexOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Vertex_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Vertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Vertex.class, + com.google.cloud.vision.v1p4beta1.Vertex.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + x_ = 0; + + y_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.GeometryProto + .internal_static_google_cloud_vision_v1p4beta1_Vertex_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Vertex getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Vertex.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Vertex build() { + com.google.cloud.vision.v1p4beta1.Vertex result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Vertex buildPartial() { + com.google.cloud.vision.v1p4beta1.Vertex result = + new com.google.cloud.vision.v1p4beta1.Vertex(this); + result.x_ = x_; + result.y_ = y_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Vertex) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Vertex) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Vertex other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Vertex parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Vertex) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Vertex) + private static final com.google.cloud.vision.v1p4beta1.Vertex DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Vertex(); + } + + public static com.google.cloud.vision.v1p4beta1.Vertex getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Vertex getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/VertexOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/VertexOrBuilder.java new file mode 100644 index 000000000000..ed5939b69af9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/VertexOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/geometry.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface VertexOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetection.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetection.java new file mode 100644 index 000000000000..c3c5a8cc4d93 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetection.java @@ -0,0 +1,8485 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/web_detection.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Relevant information for the image from the Internet.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetection} + */ +public final class WebDetection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + webEntities_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity>(); + mutable_bitField0_ |= 0x00000001; + } + webEntities_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.parser(), + extensionRegistry)); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + fullMatchingImages_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage>(); + mutable_bitField0_ |= 0x00000002; + } + fullMatchingImages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.parser(), + extensionRegistry)); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + partialMatchingImages_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage>(); + mutable_bitField0_ |= 0x00000004; + } + partialMatchingImages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.parser(), + extensionRegistry)); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + pagesWithMatchingImages_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage>(); + mutable_bitField0_ |= 0x00000008; + } + pagesWithMatchingImages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.parser(), + extensionRegistry)); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + visuallySimilarImages_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage>(); + mutable_bitField0_ |= 0x00000010; + } + visuallySimilarImages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.parser(), + extensionRegistry)); + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + bestGuessLabels_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel>(); + mutable_bitField0_ |= 0x00000020; + } + bestGuessLabels_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.class, + com.google.cloud.vision.v1p4beta1.WebDetection.Builder.class); + } + + public interface WebEntityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity} + */ + public static final class WebEntity extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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; + } + 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.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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); + } + + @java.lang.Override + 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.v1p4beta1.WebDetection.WebEntity)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Entity deduced from similar images on the Internet.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetection.WebEntity} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.WebDetection.WebEntity) + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.class, + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + entityId_ = ""; + + score_ = 0F; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity build() { + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity buildPartial() { + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity result = + new com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity(this); + result.entityId_ = entityId_; + result.score_ = score_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.WebDetection.WebEntity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection.WebEntity) + private static final com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity(); + } + + public static com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface WebImageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage} + */ + public static final class WebImage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 21: + { + score_ = input.readFloat(); + 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.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + if (score_ != 0F) { + output.writeFloat(2, score_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!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.v1p4beta1.WebDetection.WebImage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Metadata for online images.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetection.WebImage} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.WebDetection.WebImage) + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.class, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + url_ = ""; + + score_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage build() { + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage buildPartial() { + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage result = + new com.google.cloud.vision.v1p4beta1.WebDetection.WebImage(this); + result.url_ = url_; + result.score_ = score_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.WebDetection.WebImage) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.WebDetection.WebImage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.WebDetection.WebImage other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.WebDetection.WebImage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection.WebImage) + private static final com.google.cloud.vision.v1p4beta1.WebDetection.WebImage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.WebDetection.WebImage(); + } + + public static com.google.cloud.vision.v1p4beta1.WebDetection.WebImage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface WebLabelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebLabel} + */ + public static final class WebLabel extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + 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.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, label_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.WebDetection.WebLabel)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebLabel parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebLabel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebLabel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Label to provide extra metadata for the web detection.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetection.WebLabel} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.WebDetection.WebLabel) + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.class, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + label_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel build() { + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel buildPartial() { + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel result = + new com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel(this); + result.label_ = label_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.WebDetection.WebLabel) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection.WebLabel) + private static final com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel(); + } + + public static com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface WebPageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage getFullMatchingImages(int index); + /** + * + * + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder + getPartialMatchingImagesOrBuilder(int index); + } + /** + * + * + *
+   * Metadata for web pages.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetection.WebPage} + */ + public static final class WebPage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + 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< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage>(); + mutable_bitField0_ |= 0x00000008; + } + fullMatchingImages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.parser(), + extensionRegistry)); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + partialMatchingImages_ = + new java.util.ArrayList< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage>(); + mutable_bitField0_ |= 0x00000010; + } + partialMatchingImages_.add( + input.readMessage( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.parser(), + extensionRegistry)); + 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 { + 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.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.class, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + getFullMatchingImagesOrBuilderList() { + return fullMatchingImages_; + } + /** + * + * + *
+     * Fully matching images on the page.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + 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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder + getPartialMatchingImagesOrBuilder(int index) { + return partialMatchingImages_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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); + } + + @java.lang.Override + 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.v1p4beta1.WebDetection.WebPage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Metadata for web pages.
+     * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetection.WebPage} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.WebDetection.WebPage) + com.google.cloud.vision.v1p4beta1.WebDetection.WebPageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.class, + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebPage getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebPage build() { + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebPage buildPartial() { + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.WebDetection.WebPage) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.WebDetection.WebPage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.WebDetection.WebPage other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + fullMatchingImagesBuilder_; + + /** + * + * + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public Builder setFullMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public Builder setFullMatchingImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public Builder addFullMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public Builder addFullMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public Builder addFullMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public Builder addFullMatchingImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + 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.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addFullMatchingImagesBuilder() { + return getFullMatchingImagesFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + * + * + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addFullMatchingImagesBuilder(int index) { + return getFullMatchingImagesFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + * + * + *
+       * Fully matching images on the page.
+       * Can include resized copies of the query image.
+       * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage full_matching_images = 4; + * + */ + public java.util.List + getFullMatchingImagesBuilderList() { + return getFullMatchingImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + getFullMatchingImagesFieldBuilder() { + if (fullMatchingImagesBuilder_ == null) { + fullMatchingImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public Builder setPartialMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public Builder setPartialMatchingImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public Builder addPartialMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public Builder addPartialMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public Builder addPartialMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public Builder addPartialMatchingImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + 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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addPartialMatchingImagesBuilder() { + return getPartialMatchingImagesFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addPartialMatchingImagesBuilder(int index) { + return getPartialMatchingImagesFieldBuilder() + .addBuilder( + index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 5; + * + */ + public java.util.List + getPartialMatchingImagesBuilderList() { + return getPartialMatchingImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + getPartialMatchingImagesFieldBuilder() { + if (partialMatchingImagesBuilder_ == null) { + partialMatchingImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder>( + partialMatchingImages_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + partialMatchingImages_ = null; + } + return partialMatchingImagesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.WebDetection.WebPage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection.WebPage) + private static final com.google.cloud.vision.v1p4beta1.WebDetection.WebPage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.WebDetection.WebPage(); + } + + public static com.google.cloud.vision.v1p4beta1.WebDetection.WebPage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection.WebPage 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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List + getWebEntitiesList() { + return webEntities_; + } + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List + getWebEntitiesOrBuilderList() { + return webEntities_; + } + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public int getWebEntitiesCount() { + return webEntities_.size(); + } + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity getWebEntities(int index) { + return webEntities_.get(index); + } + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebPage getPagesWithMatchingImages( + int index) { + return pagesWithMatchingImages_.get(index); + } + /** + * + * + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public java.util.List + getVisuallySimilarImagesList() { + return visuallySimilarImages_; + } + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public java.util.List + getVisuallySimilarImagesOrBuilderList() { + return visuallySimilarImages_; + } + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public int getVisuallySimilarImagesCount() { + return visuallySimilarImages_.size(); + } + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage getVisuallySimilarImages( + int index) { + return visuallySimilarImages_.get(index); + } + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder + getVisuallySimilarImagesOrBuilder(int index) { + return visuallySimilarImages_.get(index); + } + + public static final int BEST_GUESS_LABELS_FIELD_NUMBER = 8; + private java.util.List bestGuessLabels_; + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public java.util.List + getBestGuessLabelsList() { + return bestGuessLabels_; + } + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public java.util.List + getBestGuessLabelsOrBuilderList() { + return bestGuessLabels_; + } + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public int getBestGuessLabelsCount() { + return bestGuessLabels_.size(); + } + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel getBestGuessLabels(int index) { + return bestGuessLabels_.get(index); + } + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabelOrBuilder + getBestGuessLabelsOrBuilder(int index) { + return bestGuessLabels_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < 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); + } + + @java.lang.Override + 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.v1p4beta1.WebDetection)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.WebDetection other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.WebDetection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Relevant information for the image from the Internet.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.WebDetection) + com.google.cloud.vision.v1p4beta1.WebDetectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetection.class, + com.google.cloud.vision.v1p4beta1.WebDetection.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.WebDetectionProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetection_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.WebDetection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection build() { + com.google.cloud.vision.v1p4beta1.WebDetection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection buildPartial() { + com.google.cloud.vision.v1p4beta1.WebDetection result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.WebDetection) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.WebDetection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.WebDetection other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.WebDetection parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity, + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntityOrBuilder> + webEntitiesBuilder_; + + /** + * + * + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder setWebEntities( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder setWebEntities( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addWebEntities(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addWebEntities( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addWebEntities( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public Builder addWebEntities( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.Builder getWebEntitiesBuilder( + int index) { + return getWebEntitiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebEntityOrBuilder> + 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.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.Builder + addWebEntitiesBuilder() { + return getWebEntitiesFieldBuilder() + .addBuilder( + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.getDefaultInstance()); + } + /** + * + * + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.Builder addWebEntitiesBuilder( + int index) { + return getWebEntitiesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.getDefaultInstance()); + } + /** + * + * + *
+     * Deduced entities from similar images on the Internet.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + public java.util.List + getWebEntitiesBuilderList() { + return getWebEntitiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity, + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntityOrBuilder> + getWebEntitiesFieldBuilder() { + if (webEntitiesBuilder_ == null) { + webEntitiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity, + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + fullMatchingImagesBuilder_; + + /** + * + * + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public Builder setFullMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public Builder setFullMatchingImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public Builder addFullMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public Builder addFullMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public Builder addFullMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public Builder addFullMatchingImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + 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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addFullMatchingImagesBuilder() { + return getFullMatchingImagesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + * + * + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addFullMatchingImagesBuilder(int index) { + return getFullMatchingImagesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + * + * + *
+     * Fully matching images from the Internet.
+     * Can include resized copies of the query image.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + public java.util.List + getFullMatchingImagesBuilderList() { + return getFullMatchingImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + getFullMatchingImagesFieldBuilder() { + if (fullMatchingImagesBuilder_ == null) { + fullMatchingImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public Builder setPartialMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public Builder setPartialMatchingImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public Builder addPartialMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public Builder addPartialMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public Builder addPartialMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public Builder addPartialMatchingImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + 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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addPartialMatchingImagesBuilder() { + return getPartialMatchingImagesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addPartialMatchingImagesBuilder(int index) { + return getPartialMatchingImagesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + public java.util.List + getPartialMatchingImagesBuilderList() { + return getPartialMatchingImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + getPartialMatchingImagesFieldBuilder() { + if (partialMatchingImagesBuilder_ == null) { + partialMatchingImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebPageOrBuilder> + pagesWithMatchingImagesBuilder_; + + /** + * + * + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public Builder setPagesWithMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public Builder setPagesWithMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public Builder addPagesWithMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public Builder addPagesWithMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public Builder addPagesWithMatchingImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public Builder addPagesWithMatchingImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.Builder + getPagesWithMatchingImagesBuilder(int index) { + return getPagesWithMatchingImagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.Builder + addPagesWithMatchingImagesBuilder() { + return getPagesWithMatchingImagesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.getDefaultInstance()); + } + /** + * + * + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.Builder + addPagesWithMatchingImagesBuilder(int index) { + return getPagesWithMatchingImagesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.getDefaultInstance()); + } + /** + * + * + *
+     * Web pages containing the matching images from the Internet.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + public java.util.List + getPagesWithMatchingImagesBuilderList() { + return getPagesWithMatchingImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebPageOrBuilder> + getPagesWithMatchingImagesFieldBuilder() { + if (pagesWithMatchingImagesBuilder_ == null) { + pagesWithMatchingImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + visuallySimilarImagesBuilder_; + + /** + * + * + *
+     * The visually similar image results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public Builder setVisuallySimilarImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public Builder setVisuallySimilarImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public Builder addVisuallySimilarImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public Builder addVisuallySimilarImages( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public Builder addVisuallySimilarImages( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public Builder addVisuallySimilarImages( + int index, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + getVisuallySimilarImagesBuilder(int index) { + return getVisuallySimilarImagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The visually similar image results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + getVisuallySimilarImagesOrBuilderList() { + if (visuallySimilarImagesBuilder_ != null) { + return visuallySimilarImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(visuallySimilarImages_); + } + } + /** + * + * + *
+     * The visually similar image results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addVisuallySimilarImagesBuilder() { + return getVisuallySimilarImagesFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + * + * + *
+     * The visually similar image results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder + addVisuallySimilarImagesBuilder(int index) { + return getVisuallySimilarImagesFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.getDefaultInstance()); + } + /** + * + * + *
+     * The visually similar image results.
+     * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + public java.util.List + getVisuallySimilarImagesBuilderList() { + return getVisuallySimilarImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder> + getVisuallySimilarImagesFieldBuilder() { + if (visuallySimilarImagesBuilder_ == null) { + visuallySimilarImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage, + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebLabel, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabelOrBuilder> + bestGuessLabelsBuilder_; + + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public java.util.List + getBestGuessLabelsList() { + if (bestGuessLabelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(bestGuessLabels_); + } else { + return bestGuessLabelsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public int getBestGuessLabelsCount() { + if (bestGuessLabelsBuilder_ == null) { + return bestGuessLabels_.size(); + } else { + return bestGuessLabelsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel getBestGuessLabels(int index) { + if (bestGuessLabelsBuilder_ == null) { + return bestGuessLabels_.get(index); + } else { + return bestGuessLabelsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public Builder setBestGuessLabels( + int index, com.google.cloud.vision.v1p4beta1.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; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public Builder setBestGuessLabels( + int index, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder builderForValue) { + if (bestGuessLabelsBuilder_ == null) { + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.set(index, builderForValue.build()); + onChanged(); + } else { + bestGuessLabelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public Builder addBestGuessLabels( + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel value) { + if (bestGuessLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.add(value); + onChanged(); + } else { + bestGuessLabelsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public Builder addBestGuessLabels( + int index, com.google.cloud.vision.v1p4beta1.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; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public Builder addBestGuessLabels( + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder builderForValue) { + if (bestGuessLabelsBuilder_ == null) { + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.add(builderForValue.build()); + onChanged(); + } else { + bestGuessLabelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public Builder addBestGuessLabels( + int index, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder builderForValue) { + if (bestGuessLabelsBuilder_ == null) { + ensureBestGuessLabelsIsMutable(); + bestGuessLabels_.add(index, builderForValue.build()); + onChanged(); + } else { + bestGuessLabelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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; + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder + getBestGuessLabelsBuilder(int index) { + return getBestGuessLabelsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabelOrBuilder + getBestGuessLabelsOrBuilder(int index) { + if (bestGuessLabelsBuilder_ == null) { + return bestGuessLabels_.get(index); + } else { + return bestGuessLabelsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public java.util.List< + ? extends com.google.cloud.vision.v1p4beta1.WebDetection.WebLabelOrBuilder> + getBestGuessLabelsOrBuilderList() { + if (bestGuessLabelsBuilder_ != null) { + return bestGuessLabelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(bestGuessLabels_); + } + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder + addBestGuessLabelsBuilder() { + return getBestGuessLabelsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.getDefaultInstance()); + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder + addBestGuessLabelsBuilder(int index) { + return getBestGuessLabelsFieldBuilder() + .addBuilder( + index, com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.getDefaultInstance()); + } + /** + * + * + *
+     * The service's best guess as to the topic of the request image.
+     * Inferred from similar images on the open web.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + public java.util.List + getBestGuessLabelsBuilderList() { + return getBestGuessLabelsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabelOrBuilder> + getBestGuessLabelsFieldBuilder() { + if (bestGuessLabelsBuilder_ == null) { + bestGuessLabelsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.Builder, + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabelOrBuilder>( + bestGuessLabels_, + ((bitField0_ & 0x00000020) == 0x00000020), + getParentForChildren(), + isClean()); + bestGuessLabels_ = null; + } + return bestGuessLabelsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.WebDetection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection) + private static final com.google.cloud.vision.v1p4beta1.WebDetection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.WebDetection(); + } + + public static com.google.cloud.vision.v1p4beta1.WebDetection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionOrBuilder.java new file mode 100644 index 000000000000..ac0cabe5a729 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionOrBuilder.java @@ -0,0 +1,392 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/web_detection.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface WebDetectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.WebDetection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + java.util.List getWebEntitiesList(); + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntity getWebEntities(int index); + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + int getWebEntitiesCount(); + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + java.util.List + getWebEntitiesOrBuilderList(); + /** + * + * + *
+   * Deduced entities from similar images on the Internet.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebEntity web_entities = 1; + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebEntityOrBuilder getWebEntitiesOrBuilder( + int index); + + /** + * + * + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage getFullMatchingImages(int index); + /** + * + * + *
+   * Fully matching images from the Internet.
+   * Can include resized copies of the query image.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage full_matching_images = 2; + * + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.WebDetection.WebImage partial_matching_images = 3; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder + getPartialMatchingImagesOrBuilder(int index); + + /** + * + * + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + java.util.List + getPagesWithMatchingImagesList(); + /** + * + * + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebPage getPagesWithMatchingImages(int index); + /** + * + * + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + int getPagesWithMatchingImagesCount(); + /** + * + * + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + java.util.List + getPagesWithMatchingImagesOrBuilderList(); + /** + * + * + *
+   * Web pages containing the matching images from the Internet.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebPage pages_with_matching_images = 4; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebPageOrBuilder + getPagesWithMatchingImagesOrBuilder(int index); + + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + java.util.List + getVisuallySimilarImagesList(); + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebImage getVisuallySimilarImages(int index); + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + int getVisuallySimilarImagesCount(); + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + java.util.List + getVisuallySimilarImagesOrBuilderList(); + /** + * + * + *
+   * The visually similar image results.
+   * 
+ * + * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebImage visually_similar_images = 6; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebImageOrBuilder + getVisuallySimilarImagesOrBuilder(int index); + + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + java.util.List getBestGuessLabelsList(); + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabel getBestGuessLabels(int index); + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + int getBestGuessLabelsCount(); + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + java.util.List + getBestGuessLabelsOrBuilderList(); + /** + * + * + *
+   * The service's best guess as to the topic of the request image.
+   * Inferred from similar images on the open web.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.WebDetection.WebLabel best_guess_labels = 8; + * + */ + com.google.cloud.vision.v1p4beta1.WebDetection.WebLabelOrBuilder getBestGuessLabelsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionParams.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionParams.java new file mode 100644 index 000000000000..ecfcd76e098e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionParams.java @@ -0,0 +1,518 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * Parameters for web detection request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetectionParams} + */ +public final class WebDetectionParams extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 16: + { + includeGeoResults_ = input.readBool(); + 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.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetectionParams.class, + com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (includeGeoResults_ != false) { + output.writeBool(2, includeGeoResults_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + 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.v1p4beta1.WebDetectionParams)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.WebDetectionParams other = + (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetectionParams parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetectionParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetectionParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetectionParams parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.WebDetectionParams parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.WebDetectionParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Parameters for web detection request.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.WebDetectionParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.WebDetectionParams) + com.google.cloud.vision.v1p4beta1.WebDetectionParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.WebDetectionParams.class, + com.google.cloud.vision.v1p4beta1.WebDetectionParams.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + includeGeoResults_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.ImageAnnotatorProto + .internal_static_google_cloud_vision_v1p4beta1_WebDetectionParams_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetectionParams getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.WebDetectionParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetectionParams build() { + com.google.cloud.vision.v1p4beta1.WebDetectionParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetectionParams buildPartial() { + com.google.cloud.vision.v1p4beta1.WebDetectionParams result = + new com.google.cloud.vision.v1p4beta1.WebDetectionParams(this); + result.includeGeoResults_ = includeGeoResults_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.WebDetectionParams) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.WebDetectionParams) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.WebDetectionParams other) { + if (other == com.google.cloud.vision.v1p4beta1.WebDetectionParams.getDefaultInstance()) + return this; + if (other.getIncludeGeoResults() != false) { + setIncludeGeoResults(other.getIncludeGeoResults()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.WebDetectionParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.WebDetectionParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetectionParams) + private static final com.google.cloud.vision.v1p4beta1.WebDetectionParams DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.WebDetectionParams(); + } + + public static com.google.cloud.vision.v1p4beta1.WebDetectionParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.WebDetectionParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionParamsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionParamsOrBuilder.java new file mode 100644 index 000000000000..f918511edc00 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionParamsOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/image_annotator.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface WebDetectionParamsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionProto.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionProto.java new file mode 100644 index 000000000000..2856fb27ba87 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WebDetectionProto.java @@ -0,0 +1,146 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/web_detection.proto + +package com.google.cloud.vision.v1p4beta1; + +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_v1p4beta1_WebDetection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_WebDetection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_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/v1p4beta1/web_dete" + + "ction.proto\022\035google.cloud.vision.v1p4bet" + + "a1\032\034google/api/annotations.proto\"\214\007\n\014Web" + + "Detection\022K\n\014web_entities\030\001 \003(\01325.google" + + ".cloud.vision.v1p4beta1.WebDetection.Web" + + "Entity\022R\n\024full_matching_images\030\002 \003(\01324.g" + + "oogle.cloud.vision.v1p4beta1.WebDetectio" + + "n.WebImage\022U\n\027partial_matching_images\030\003 " + + "\003(\01324.google.cloud.vision.v1p4beta1.WebD" + + "etection.WebImage\022W\n\032pages_with_matching" + + "_images\030\004 \003(\01323.google.cloud.vision.v1p4" + + "beta1.WebDetection.WebPage\022U\n\027visually_s" + + "imilar_images\030\006 \003(\01324.google.cloud.visio" + + "n.v1p4beta1.WebDetection.WebImage\022O\n\021bes" + + "t_guess_labels\030\010 \003(\01324.google.cloud.visi" + + "on.v1p4beta1.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\0320\n\010WebLabel\022\r\n\005la" + + "bel\030\001 \001(\t\022\025\n\rlanguage_code\030\002 \001(\t\032\344\001\n\007Web" + + "Page\022\013\n\003url\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.google.cloud.vision.v1p4beta1.WebDe" + + "tection.WebImage\022U\n\027partial_matching_ima" + + "ges\030\005 \003(\01324.google.cloud.vision.v1p4beta" + + "1.WebDetection.WebImageB\207\001\n!com.google.c" + + "loud.vision.v1p4beta1B\021WebDetectionProto" + + "P\001ZCgoogle.golang.org/genproto/googleapi" + + "s/cloud/vision/v1p4beta1;vision\370\001\001\242\002\004GCV" + + "Nb\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_vision_v1p4beta1_WebDetection_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_WebDetection_descriptor, + new java.lang.String[] { + "WebEntities", + "FullMatchingImages", + "PartialMatchingImages", + "PagesWithMatchingImages", + "VisuallySimilarImages", + "BestGuessLabels", + }); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_descriptor = + internal_static_google_cloud_vision_v1p4beta1_WebDetection_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebEntity_descriptor, + new java.lang.String[] { + "EntityId", "Score", "Description", + }); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_descriptor = + internal_static_google_cloud_vision_v1p4beta1_WebDetection_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebImage_descriptor, + new java.lang.String[] { + "Url", "Score", + }); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_descriptor = + internal_static_google_cloud_vision_v1p4beta1_WebDetection_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebLabel_descriptor, + new java.lang.String[] { + "Label", "LanguageCode", + }); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_descriptor = + internal_static_google_cloud_vision_v1p4beta1_WebDetection_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vision_v1p4beta1_WebDetection_WebPage_descriptor, + new java.lang.String[] { + "Url", "Score", "PageTitle", "FullMatchingImages", "PartialMatchingImages", + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Word.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Word.java new file mode 100644 index 000000000000..2e62a89c31ba --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/Word.java @@ -0,0 +1,1742 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +/** + * + * + *
+ * A word representation.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Word} + */ +public final class Word extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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; + case 10: + { + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder subBuilder = + null; + if (property_ != null) { + subBuilder = property_.toBuilder(); + } + property_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(property_); + property_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = + input.readMessage( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol.parser(), extensionRegistry)); + break; + } + case 37: + { + confidence_ = input.readFloat(); + 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 { + 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.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Word_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Word_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Word.class, + com.google.cloud.vision.v1p4beta1.Word.Builder.class); + } + + private int bitField0_; + public static final int PROPERTY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_; + /** + * + * + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return property_ != null; + } + /** + * + * + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + /** + * + * + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + return getProperty(); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 2; + private com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingBox() { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p4beta1.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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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); + } + + @java.lang.Override + 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.v1p4beta1.Word)) { + return super.equals(obj); + } + com.google.cloud.vision.v1p4beta1.Word other = (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Word parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Word prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A word representation.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1p4beta1.Word} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Word) + com.google.cloud.vision.v1p4beta1.WordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Word_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Word_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1p4beta1.Word.class, + com.google.cloud.vision.v1p4beta1.Word.Builder.class); + } + + // Construct using com.google.cloud.vision.v1p4beta1.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(); + } + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vision.v1p4beta1.TextAnnotationProto + .internal_static_google_cloud_vision_v1p4beta1_Word_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Word getDefaultInstanceForType() { + return com.google.cloud.vision.v1p4beta1.Word.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Word build() { + com.google.cloud.vision.v1p4beta1.Word result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Word buildPartial() { + com.google.cloud.vision.v1p4beta1.Word result = + new com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vision.v1p4beta1.Word) { + return mergeFrom((com.google.cloud.vision.v1p4beta1.Word) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Word other) { + if (other == com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.vision.v1p4beta1.Word parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1p4beta1.Word) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + propertyBuilder_; + /** + * + * + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public boolean hasProperty() { + return propertyBuilder_ != null || property_ != null; + } + /** + * + * + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty() { + if (propertyBuilder_ == null) { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } else { + return propertyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder setProperty( + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public Builder mergeProperty( + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty value) { + if (propertyBuilder_ == null) { + if (property_ != null) { + property_ = + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder + getPropertyBuilder() { + + onChanged(); + return getPropertyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + public com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder + getPropertyOrBuilder() { + if (propertyBuilder_ != null) { + return propertyBuilder_.getMessageOrBuilder(); + } else { + return property_ == null + ? com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.getDefaultInstance() + : property_; + } + } + /** + * + * + *
+     * Additional information detected for the word.
+     * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder> + getPropertyFieldBuilder() { + if (propertyBuilder_ == null) { + propertyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.Builder, + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextPropertyOrBuilder>( + getProperty(), getParentForChildren(), isClean()); + property_ = null; + } + return propertyBuilder_; + } + + private com.google.cloud.vision.v1p4beta1.BoundingPoly boundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox(com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder setBoundingBox( + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public Builder mergeBoundingBox(com.google.cloud.vision.v1p4beta1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + public com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null + ? com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+     * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.BoundingPoly, + com.google.cloud.vision.v1p4beta1.BoundingPoly.Builder, + com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol, + com.google.cloud.vision.v1p4beta1.Symbol.Builder, + com.google.cloud.vision.v1p4beta1.SymbolOrBuilder> + symbolsBuilder_; + + /** + * + * + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public Builder setSymbols(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public Builder setSymbols( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public Builder addSymbols(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public Builder addSymbols(int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public Builder addSymbols(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public Builder addSymbols( + int index, com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p4beta1.Symbol.Builder addSymbolsBuilder() { + return getSymbolsFieldBuilder() + .addBuilder(com.google.cloud.vision.v1p4beta1.Symbol.getDefaultInstance()); + } + /** + * + * + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Symbol symbols = 3; + */ + public com.google.cloud.vision.v1p4beta1.Symbol.Builder addSymbolsBuilder(int index) { + return getSymbolsFieldBuilder() + .addBuilder(index, com.google.cloud.vision.v1p4beta1.Symbol.getDefaultInstance()); + } + /** + * + * + *
+     * List of symbols in the word.
+     * The order of the symbols follows the natural reading order.
+     * 
+ * + * repeated .google.cloud.vision.v1p4beta1.Symbol symbols = 3; + */ + public java.util.List + getSymbolsBuilderList() { + return getSymbolsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Symbol, + com.google.cloud.vision.v1p4beta1.Symbol.Builder, + com.google.cloud.vision.v1p4beta1.SymbolOrBuilder> + getSymbolsFieldBuilder() { + if (symbolsBuilder_ == null) { + symbolsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1p4beta1.Symbol, + com.google.cloud.vision.v1p4beta1.Symbol.Builder, + com.google.cloud.vision.v1p4beta1.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Word) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Word) + private static final com.google.cloud.vision.v1p4beta1.Word DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Word(); + } + + public static com.google.cloud.vision.v1p4beta1.Word getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + 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; + } + + @java.lang.Override + public com.google.cloud.vision.v1p4beta1.Word getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WordOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WordOrBuilder.java new file mode 100644 index 000000000000..24f6d9be0806 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/java/com/google/cloud/vision/v1p4beta1/WordOrBuilder.java @@ -0,0 +1,182 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1p4beta1/text_annotation.proto + +package com.google.cloud.vision.v1p4beta1; + +public interface WordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.Word) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + boolean hasProperty(); + /** + * + * + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty getProperty(); + /** + * + * + *
+   * Additional information detected for the word.
+   * 
+ * + * .google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty property = 1; + */ + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p4beta1.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 vertex order will still be (0, 1, 2, 3).
+   * 
+ * + * .google.cloud.vision.v1p4beta1.BoundingPoly bounding_box = 2; + */ + com.google.cloud.vision.v1p4beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder(); + + /** + * + * + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + com.google.cloud.vision.v1p4beta1.Symbol getSymbols(int index); + /** + * + * + *
+   * List of symbols in the word.
+   * The order of the symbols follows the natural reading order.
+   * 
+ * + * repeated .google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Symbol symbols = 3; + */ + com.google.cloud.vision.v1p4beta1.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-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/geometry.proto b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/geometry.proto new file mode 100644 index 000000000000..60b71fd1ac60 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/geometry.proto @@ -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 +// +// 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.v1p4beta1; + +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "GeometryProto"; +option java_package = "com.google.cloud.vision.v1p4beta1"; +option objc_class_prefix = "GCVN"; + + +// 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 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-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/image_annotator.proto b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/image_annotator.proto new file mode 100644 index 000000000000..3e4e8b614f9c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/image_annotator.proto @@ -0,0 +1,902 @@ +// 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.vision.v1p4beta1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1p4beta1/geometry.proto"; +import "google/cloud/vision/v1p4beta1/product_search.proto"; +import "google/cloud/vision/v1p4beta1/text_annotation.proto"; +import "google/cloud/vision/v1p4beta1/web_detection.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.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/v1p4beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "ImageAnnotatorProto"; +option java_package = "com.google.cloud.vision.v1p4beta1"; +option objc_class_prefix = "GCVN"; + + +// 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: "/v1p4beta1/images:annotate" + body: "*" + }; + } + + // Service that performs image detection and annotation for a batch of files. + // Now only "application/pdf", "image/tiff" and "image/gif" are supported. + // + // This service will extract at most the first 10 frames (gif) or pages + // (pdf or tiff) from each file provided and perform detection and annotation + // for each image extracted. + rpc BatchAnnotateFiles(BatchAnnotateFilesRequest) returns (BatchAnnotateFilesResponse) { + option (google.api.http) = { + post: "/v1p4beta1/files:annotate" + body: "*" + }; + } + + // Run asynchronous image detection and annotation for a list of images. + // + // Progress and results can be retrieved through the + // `google.longrunning.Operations` interface. + // `Operation.metadata` contains `OperationMetadata` (metadata). + // `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + // + // This service will write image annotation outputs to json files in customer + // GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + rpc AsyncBatchAnnotateImages(AsyncBatchAnnotateImagesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p4beta1/images:asyncBatchAnnotate" + 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: "/v1p4beta1/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 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; +} + +// 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. + // 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 [deprecated = true]; + + // 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. + 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. + 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, and with context information. +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. + 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; + + // This field gives the total number of pages in the file. + int32 total_pages = 3; +} + +// 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; +} + +// A request to annotate one single file, e.g. a PDF, TIFF or GIF file. +message AnnotateFileRequest { + // 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; + + // Pages of the file to perform image annotation. + // + // Pages starts from 1, we assume the first page of the file is page 1. + // At most 5 pages are supported per request. Pages can be negative. + // + // Page 1 means the first page. + // Page 2 means the second page. + // Page -1 means the last page. + // Page -2 means the second to the last page. + // + // If the file is GIF instead of PDF or TIFF, page refers to GIF frames. + // + // If this field is empty, by default the service performs image annotation + // for the first 5 pages of the file. + repeated int32 pages = 4; +} + +// A list of requests to annotate files using the BatchAnnotateFiles API. +message BatchAnnotateFilesRequest { + // The list of file annotation requests. Right now we support only one + // AnnotateFileRequest in BatchAnnotateFilesRequest. + repeated AnnotateFileRequest requests = 1; +} + +// A list of file annotation responses. +message BatchAnnotateFilesResponse { + // The list of file annotation responses, each response corresponding to each + // AnnotateFileRequest in BatchAnnotateFilesRequest. + repeated AnnotateFileResponse 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; +} + +// Request for async image annotation for a list of images. +message AsyncBatchAnnotateImagesRequest { + // Individual image annotation requests for this batch. + repeated AnnotateImageRequest requests = 1; + + // Required. The desired output location and metadata (e.g. format). + OutputConfig output_config = 2; +} + +// Response to an async batch image annotation request. +message AsyncBatchAnnotateImagesResponse { + // The output location and metadata from AsyncBatchAnnotateImagesRequest. + 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; + + // File content, represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + // + // Currently, this field only works for BatchAnnotateFiles requests. It does + // not work for AsyncBatchAnnotateFiles requests. + bytes content = 3; + + // 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; +} + +// 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-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/product_search.proto b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/product_search.proto new file mode 100644 index 000000000000..3ec6767b5b50 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/product_search.proto @@ -0,0 +1,97 @@ +// 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.vision.v1p4beta1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1p4beta1/geometry.proto"; +import "google/cloud/vision/v1p4beta1/product_search_service.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "ProductSearchProto"; +option java_package = "com.google.cloud.vision.v1p4beta1"; +option objc_class_prefix = "GCVN"; + + +// Parameters for a product search request. +message ProductSearchParams { + // 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; + + // The resource name of a [ProductSet][google.cloud.vision.v1p4beta1.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", "apparel", or "toys" 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 Result { + // The Product. + Product product = 1; + + // A confidence level on the match, ranging from 0 (no confidence) to + // 1 (full confidence). + float score = 2; + + // The resource name of the image from the product that is the closest match + // to the query. + string image = 3; + } + + // Information about the products similar to a single product in a query + // image. + message GroupedResult { + // The bounding polygon around the product detected in the query image. + BoundingPoly bounding_poly = 1; + + // List of results, one for each product match. + repeated Result results = 2; + } + + // 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 results, one for each product match. + repeated Result results = 5; + + // List of results grouped by products detected in the query image. Each entry + // corresponds to one bounding polygon in the query image, and contains the + // matching products specific to that region. There may be duplicate product + // matches in the union of all the per-product results. + repeated GroupedResult product_grouped_results = 6; +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/product_search_service.proto b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/product_search_service.proto new file mode 100644 index 000000000000..1a20351b63f2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/product_search_service.proto @@ -0,0 +1,835 @@ +// 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.vision.v1p4beta1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1p4beta1/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/v1p4beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "ProductSearchServiceProto"; +option java_package = "com.google.cloud.vision.v1p4beta1"; +option objc_class_prefix = "GCVN"; + + +// 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.v1p4beta1.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.v1p4beta1.Product] resources, named +// `projects/*/locations/*/products/*` +// +// - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p4beta1.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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{product_set.name=projects/*/locations/*/productSets/*}" + body: "product_set" + }; + } + + // Permanently deletes a ProductSet. Products and ReferenceImages in the + // ProductSet are not 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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{name=projects/*/locations/*/products/*}" + }; + } + + // Makes changes to a Product resource. + // Only the `display_name`, `description`, and `labels` fields 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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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: "/v1p4beta1/{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.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + rpc ImportProductSets(ImportProductSetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p4beta1/{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", "apparel", or "toys". + // + // 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 timestamp is the default value + // "1970-01-01T00:00:00Z". + // + // 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 8 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 + // + // The `image-uri`, `product-set-id`, `product-id`, and `product-category` + // columns are required. All other columns are optional. + // + // If the `ProductSet` or `Product` specified by the `product-set-id` and + // `product-id` values does not exist, then the system will create a new + // `ProductSet` or `Product` for the image. In this case, the + // `product-display-name` column refers to + // [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the + // `product-category` column refers to + // [product_category][google.cloud.vision.v1p4beta1.Product.product_category], and the + // `labels` column refers to [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels]. + // + // The `image-id` column is optional but must be unique if provided. If it is + // empty, the system will automatically assign a unique id to the image. + // + // The `product-display-name` column is optional. If it is empty, the system + // sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a + // space (" "). You can update the `display_name` later by using the API. + // + // If a `Product` with the specified `product-id` already exists, then the + // system ignores the `product-display-name`, `product-category`, and `labels` + // columns. + // + // The `labels` column (optional) is a line containing a list of + // comma-separated key-value pairs, in the following format: + // + // "key_1=value_1,key_2=value_2,...,key_n=value_n" + // + // The `bounding-poly` column (optional) identifies one region of + // interest from the image in the same manner as `CreateReferenceImage`. If + // you do not specify the `bounding-poly` column, then the system will try to + // detect regions of interest automatically. + // + // At most one `bounding-poly` column is allowed per line. If the image + // contains multiple regions of interest, add a line to the CSV file that + // includes the same product information, and the `bounding-poly` values for + // each region of interest. + // + // The `bounding-poly` column must contain an even number of comma-separated + // numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use + // non-negative integers for absolute bounding polygons, and float values + // in [0, 1] for normalized bounding polygons. + // + // The system will resize the image if the image resolution is too + // large to process (larger than 20MP). + 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-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/text_annotation.proto b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/text_annotation.proto new file mode 100644 index 000000000000..095d96fa91e7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/text_annotation.proto @@ -0,0 +1,261 @@ +// 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.vision.v1p4beta1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1p4beta1/geometry.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "TextAnnotationProto"; +option java_package = "com.google.cloud.vision.v1p4beta1"; +option objc_class_prefix = "GCVN"; + + +// 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.v1p4beta1.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 vertex 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 vertex 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 vertex 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-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/web_detection.proto b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/web_detection.proto new file mode 100644 index 000000000000..e3f24f52c91e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1p4beta1/src/main/proto/google/cloud/vision/v1p4beta1/web_detection.proto @@ -0,0 +1,108 @@ +// 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.vision.v1p4beta1; + +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; +option java_multiple_files = true; +option java_outer_classname = "WebDetectionProto"; +option java_package = "com.google.cloud.vision.v1p4beta1"; +option objc_class_prefix = "GCVN"; + + +// 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; + } + + // 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; + } + + // 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; + } + + // 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; + + // The service's best guess as to the topic of the request image. + // Inferred from similar images on the open web. + repeated WebLabel best_guess_labels = 8; +} diff --git a/google-cloud-clients/google-cloud-vision/pom.xml b/google-cloud-clients/google-cloud-vision/pom.xml index 275e1c6ca076..0ad02b752fba 100644 --- a/google-cloud-clients/google-cloud-vision/pom.xml +++ b/google-cloud-clients/google-cloud-vision/pom.xml @@ -42,6 +42,10 @@ com.google.api.grpc proto-google-cloud-vision-v1p3beta1
+ + com.google.api.grpc + proto-google-cloud-vision-v1p4beta1 + io.grpc grpc-netty-shaded @@ -86,6 +90,11 @@ grpc-google-cloud-vision-v1p3beta1 test + + com.google.api.grpc + grpc-google-cloud-vision-v1p4beta1 + test + com.google.api diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClient.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClient.java new file mode 100644 index 000000000000..c37fbf36d20e --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClient.java @@ -0,0 +1,604 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +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.v1p4beta1.stub.ImageAnnotatorStub; +import com.google.cloud.vision.v1p4beta1.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 + */ + public 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 + /** + * Service that performs image detection and annotation for a batch of files. Now only + * "application/pdf", "image/tiff" and "image/gif" are supported. + * + *

This service will extract at most the first 10 frames (gif) or pages (pdf or tiff) from each + * file provided and perform detection and annotation for each image extracted. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateFileRequest> requests = new ArrayList<>();
+   *   BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(requests);
+   * }
+   * 
+ * + * @param requests The list of file annotation requests. Right now we support only one + * AnnotateFileRequest in BatchAnnotateFilesRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchAnnotateFilesResponse batchAnnotateFiles(List requests) { + + BatchAnnotateFilesRequest request = + BatchAnnotateFilesRequest.newBuilder().addAllRequests(requests).build(); + return batchAnnotateFiles(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Service that performs image detection and annotation for a batch of files. Now only + * "application/pdf", "image/tiff" and "image/gif" are supported. + * + *

This service will extract at most the first 10 frames (gif) or pages (pdf or tiff) from each + * file provided and perform detection and annotation for each image extracted. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateFileRequest> requests = new ArrayList<>();
+   *   BatchAnnotateFilesRequest request = BatchAnnotateFilesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(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 BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesRequest request) { + return batchAnnotateFilesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Service that performs image detection and annotation for a batch of files. Now only + * "application/pdf", "image/tiff" and "image/gif" are supported. + * + *

This service will extract at most the first 10 frames (gif) or pages (pdf or tiff) from each + * file provided and perform detection and annotation for each image extracted. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateFileRequest> requests = new ArrayList<>();
+   *   BatchAnnotateFilesRequest request = BatchAnnotateFilesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<BatchAnnotateFilesResponse> future = imageAnnotatorClient.batchAnnotateFilesCallable().futureCall(request);
+   *   // Do something
+   *   BatchAnnotateFilesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchAnnotateFilesCallable() { + return stub.batchAnnotateFilesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run asynchronous image detection and annotation for a list of images. + * + *

Progress and results can be retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains + * `AsyncBatchAnnotateImagesResponse` (results). + * + *

This service will write image annotation outputs to json files in customer GCS bucket, each + * json file containing BatchAnnotateImagesResponse proto. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   AsyncBatchAnnotateImagesResponse response = imageAnnotatorClient.asyncBatchAnnotateImagesAsync(requests, outputConfig).get();
+   * }
+   * 
+ * + * @param requests Individual image annotation requests for this batch. + * @param outputConfig Required. The desired output location and metadata (e.g. format). + * @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 + asyncBatchAnnotateImagesAsync( + List requests, OutputConfig outputConfig) { + + AsyncBatchAnnotateImagesRequest request = + AsyncBatchAnnotateImagesRequest.newBuilder() + .addAllRequests(requests) + .setOutputConfig(outputConfig) + .build(); + return asyncBatchAnnotateImagesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run asynchronous image detection and annotation for a list of images. + * + *

Progress and results can be retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains + * `AsyncBatchAnnotateImagesResponse` (results). + * + *

This service will write image annotation outputs to json files in customer GCS bucket, each + * json file containing BatchAnnotateImagesResponse proto. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   AsyncBatchAnnotateImagesRequest request = AsyncBatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   AsyncBatchAnnotateImagesResponse response = imageAnnotatorClient.asyncBatchAnnotateImagesAsync(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 + asyncBatchAnnotateImagesAsync(AsyncBatchAnnotateImagesRequest request) { + return asyncBatchAnnotateImagesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run asynchronous image detection and annotation for a list of images. + * + *

Progress and results can be retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains + * `AsyncBatchAnnotateImagesResponse` (results). + * + *

This service will write image annotation outputs to json files in customer GCS bucket, each + * json file containing BatchAnnotateImagesResponse proto. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   AsyncBatchAnnotateImagesRequest request = AsyncBatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   OperationFuture<AsyncBatchAnnotateImagesResponse, OperationMetadata> future = imageAnnotatorClient.asyncBatchAnnotateImagesOperationCallable().futureCall(request);
+   *   // Do something
+   *   AsyncBatchAnnotateImagesResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationCallable() { + return stub.asyncBatchAnnotateImagesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run asynchronous image detection and annotation for a list of images. + * + *

Progress and results can be retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains + * `AsyncBatchAnnotateImagesResponse` (results). + * + *

This service will write image annotation outputs to json files in customer GCS bucket, each + * json file containing BatchAnnotateImagesResponse proto. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   AsyncBatchAnnotateImagesRequest request = AsyncBatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = imageAnnotatorClient.asyncBatchAnnotateImagesCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + asyncBatchAnnotateImagesCallable() { + return stub.asyncBatchAnnotateImagesCallable(); + } + + // 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.") + public 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<AsyncBatchAnnotateFilesResponse, OperationMetadata> 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/v1p4beta1/ImageAnnotatorSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorSettings.java new file mode 100644 index 000000000000..feadedc82f60 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorSettings.java @@ -0,0 +1,252 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +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.v1p4beta1.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 batchAnnotateFiles. */ + public UnaryCallSettings + batchAnnotateFilesSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateFilesSettings(); + } + + /** Returns the object with the settings used for calls to asyncBatchAnnotateImages. */ + public UnaryCallSettings + asyncBatchAnnotateImagesSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()).asyncBatchAnnotateImagesSettings(); + } + + /** Returns the object with the settings used for calls to asyncBatchAnnotateImages. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()) + .asyncBatchAnnotateImagesOperationSettings(); + } + + /** 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 batchAnnotateFiles. */ + public UnaryCallSettings.Builder + batchAnnotateFilesSettings() { + return getStubSettingsBuilder().batchAnnotateFilesSettings(); + } + + /** Returns the builder for the settings used for calls to asyncBatchAnnotateImages. */ + public UnaryCallSettings.Builder + asyncBatchAnnotateImagesSettings() { + return getStubSettingsBuilder().asyncBatchAnnotateImagesSettings(); + } + + /** Returns the builder for the settings used for calls to asyncBatchAnnotateImages. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationSettings() { + return getStubSettingsBuilder().asyncBatchAnnotateImagesOperationSettings(); + } + + /** 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/v1p4beta1/ProductSearchClient.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchClient.java new file mode 100644 index 000000000000..ddfcd1ee130b --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchClient.java @@ -0,0 +1,3027 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +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.v1p4beta1.stub.ProductSearchStub; +import com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product] resources, + * named `projects/*/locations/*/products/*` + * + *

- Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of + * [ReferenceImage][google.cloud.vision.v1p4beta1.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 + */ + public 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. Products and ReferenceImages in the ProductSet are not + * 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. Products and ReferenceImages in the ProductSet are not + * 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. Products and ReferenceImages in the ProductSet are not + * 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 + */ + public final void deleteProductSet(DeleteProductSetRequest request) { + deleteProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * 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 + */ + public 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 the `display_name`, `description`, and `labels` + * fields 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 the `display_name`, `description`, and `labels` + * fields 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 the `display_name`, `description`, and `labels` + * fields 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 + */ + public 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 + */ + public 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 + */ + public 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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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<ImportProductSetsResponse, BatchOperationMetadata> 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.v1p4beta1.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/v1p4beta1/ProductSearchSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchSettings.java new file mode 100644 index 000000000000..78ea304c2003 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchSettings.java @@ -0,0 +1,402 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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/v1p4beta1/package-info.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/package-info.java new file mode 100644 index 000000000000..be0fbbb10d82 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/package-info.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1p4beta1.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.v1p4beta1.Product] resources, + * named `projects/*/locations/*/products/*` + * + *

- Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of + * [ReferenceImage][google.cloud.vision.v1p4beta1.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.v1p4beta1; diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorCallableFactory.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorCallableFactory.java new file mode 100644 index 000000000000..712fe5e344f4 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud 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/v1p4beta1/stub/GrpcImageAnnotatorStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorStub.java new file mode 100644 index 000000000000..f1ca52a2a51f --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorStub.java @@ -0,0 +1,279 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ImageAnnotator/BatchAnnotateImages") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + batchAnnotateFilesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p4beta1.ImageAnnotator/BatchAnnotateFiles") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchAnnotateFilesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchAnnotateFilesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + asyncBatchAnnotateImagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.vision.v1p4beta1.ImageAnnotator/AsyncBatchAnnotateImages") + .setRequestMarshaller( + ProtoUtils.marshaller(AsyncBatchAnnotateImagesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + asyncBatchAnnotateFilesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.vision.v1p4beta1.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 + batchAnnotateFilesCallable; + private final UnaryCallable + asyncBatchAnnotateImagesCallable; + private final OperationCallable< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationCallable; + 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 + batchAnnotateFilesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchAnnotateFilesMethodDescriptor) + .build(); + GrpcCallSettings + asyncBatchAnnotateImagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(asyncBatchAnnotateImagesMethodDescriptor) + .build(); + GrpcCallSettings + asyncBatchAnnotateFilesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(asyncBatchAnnotateFilesMethodDescriptor) + .build(); + + this.batchAnnotateImagesCallable = + callableFactory.createUnaryCallable( + batchAnnotateImagesTransportSettings, + settings.batchAnnotateImagesSettings(), + clientContext); + this.batchAnnotateFilesCallable = + callableFactory.createUnaryCallable( + batchAnnotateFilesTransportSettings, + settings.batchAnnotateFilesSettings(), + clientContext); + this.asyncBatchAnnotateImagesCallable = + callableFactory.createUnaryCallable( + asyncBatchAnnotateImagesTransportSettings, + settings.asyncBatchAnnotateImagesSettings(), + clientContext); + this.asyncBatchAnnotateImagesOperationCallable = + callableFactory.createOperationCallable( + asyncBatchAnnotateImagesTransportSettings, + settings.asyncBatchAnnotateImagesOperationSettings(), + clientContext, + this.operationsStub); + 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; + } + + public UnaryCallable + batchAnnotateFilesCallable() { + return batchAnnotateFilesCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationCallable() { + return asyncBatchAnnotateImagesOperationCallable; + } + + public UnaryCallable + asyncBatchAnnotateImagesCallable() { + return asyncBatchAnnotateImagesCallable; + } + + @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/v1p4beta1/stub/GrpcProductSearchCallableFactory.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchCallableFactory.java new file mode 100644 index 000000000000..7602529b991e --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud 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/v1p4beta1/stub/GrpcProductSearchStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchStub.java new file mode 100644 index 000000000000..e16aea756ca2 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchStub.java @@ -0,0 +1,633 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1.stub; + +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1p4beta1.BatchOperationMetadata; +import com.google.cloud.vision.v1p4beta1.CreateProductRequest; +import com.google.cloud.vision.v1p4beta1.CreateProductSetRequest; +import com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.DeleteProductRequest; +import com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest; +import com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.GetProductRequest; +import com.google.cloud.vision.v1p4beta1.GetProductSetRequest; +import com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest; +import com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse; +import com.google.cloud.vision.v1p4beta1.ListProductSetsRequest; +import com.google.cloud.vision.v1p4beta1.ListProductSetsResponse; +import com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1p4beta1.ListProductsRequest; +import com.google.cloud.vision.v1p4beta1.ListProductsResponse; +import com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1p4beta1.Product; +import com.google.cloud.vision.v1p4beta1.ProductSet; +import com.google.cloud.vision.v1p4beta1.ReferenceImage; +import com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1p4beta1.UpdateProductRequest; +import com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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/v1p4beta1/stub/ImageAnnotatorStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStub.java new file mode 100644 index 000000000000..4fa39f204d61 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStub.java @@ -0,0 +1,88 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p4beta1.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()"); + } + + public UnaryCallable + batchAnnotateFilesCallable() { + throw new UnsupportedOperationException("Not implemented: batchAnnotateFilesCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: asyncBatchAnnotateImagesOperationCallable()"); + } + + public UnaryCallable + asyncBatchAnnotateImagesCallable() { + throw new UnsupportedOperationException("Not implemented: asyncBatchAnnotateImagesCallable()"); + } + + @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/v1p4beta1/stub/ImageAnnotatorStubSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStubSettings.java new file mode 100644 index 000000000000..1e109ffd0e3c --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStubSettings.java @@ -0,0 +1,472 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AsyncBatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest; +import com.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse; +import com.google.cloud.vision.v1p4beta1.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 + batchAnnotateFilesSettings; + private final UnaryCallSettings + asyncBatchAnnotateImagesSettings; + private final OperationCallSettings< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationSettings; + 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 batchAnnotateFiles. */ + public UnaryCallSettings + batchAnnotateFilesSettings() { + return batchAnnotateFilesSettings; + } + + /** Returns the object with the settings used for calls to asyncBatchAnnotateImages. */ + public UnaryCallSettings + asyncBatchAnnotateImagesSettings() { + return asyncBatchAnnotateImagesSettings; + } + + /** Returns the object with the settings used for calls to asyncBatchAnnotateImages. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationSettings() { + return asyncBatchAnnotateImagesOperationSettings; + } + + /** 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(); + batchAnnotateFilesSettings = settingsBuilder.batchAnnotateFilesSettings().build(); + asyncBatchAnnotateImagesSettings = settingsBuilder.asyncBatchAnnotateImagesSettings().build(); + asyncBatchAnnotateImagesOperationSettings = + settingsBuilder.asyncBatchAnnotateImagesOperationSettings().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 + batchAnnotateFilesSettings; + private final UnaryCallSettings.Builder + asyncBatchAnnotateImagesSettings; + private final OperationCallSettings.Builder< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationSettings; + 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(); + + batchAnnotateFilesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + asyncBatchAnnotateImagesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + asyncBatchAnnotateImagesOperationSettings = OperationCallSettings.newBuilder(); + + asyncBatchAnnotateFilesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + asyncBatchAnnotateFilesOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + batchAnnotateImagesSettings, + batchAnnotateFilesSettings, + asyncBatchAnnotateImagesSettings, + 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("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .batchAnnotateFilesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .asyncBatchAnnotateImagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .asyncBatchAnnotateFilesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .asyncBatchAnnotateImagesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + AsyncBatchAnnotateImagesResponse.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 + .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(); + batchAnnotateFilesSettings = settings.batchAnnotateFilesSettings.toBuilder(); + asyncBatchAnnotateImagesSettings = settings.asyncBatchAnnotateImagesSettings.toBuilder(); + asyncBatchAnnotateImagesOperationSettings = + settings.asyncBatchAnnotateImagesOperationSettings.toBuilder(); + asyncBatchAnnotateFilesSettings = settings.asyncBatchAnnotateFilesSettings.toBuilder(); + asyncBatchAnnotateFilesOperationSettings = + settings.asyncBatchAnnotateFilesOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + batchAnnotateImagesSettings, + batchAnnotateFilesSettings, + asyncBatchAnnotateImagesSettings, + 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 batchAnnotateFiles. */ + public UnaryCallSettings.Builder + batchAnnotateFilesSettings() { + return batchAnnotateFilesSettings; + } + + /** Returns the builder for the settings used for calls to asyncBatchAnnotateImages. */ + public UnaryCallSettings.Builder + asyncBatchAnnotateImagesSettings() { + return asyncBatchAnnotateImagesSettings; + } + + /** Returns the builder for the settings used for calls to asyncBatchAnnotateImages. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> + asyncBatchAnnotateImagesOperationSettings() { + return asyncBatchAnnotateImagesOperationSettings; + } + + /** 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/v1p4beta1/stub/ProductSearchStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStub.java new file mode 100644 index 000000000000..7e93d1b75785 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStub.java @@ -0,0 +1,180 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1.stub; + +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1p4beta1.BatchOperationMetadata; +import com.google.cloud.vision.v1p4beta1.CreateProductRequest; +import com.google.cloud.vision.v1p4beta1.CreateProductSetRequest; +import com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.DeleteProductRequest; +import com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest; +import com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.GetProductRequest; +import com.google.cloud.vision.v1p4beta1.GetProductSetRequest; +import com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest; +import com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse; +import com.google.cloud.vision.v1p4beta1.ListProductSetsRequest; +import com.google.cloud.vision.v1p4beta1.ListProductSetsResponse; +import com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1p4beta1.ListProductsRequest; +import com.google.cloud.vision.v1p4beta1.ListProductsResponse; +import com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1p4beta1.Product; +import com.google.cloud.vision.v1p4beta1.ProductSet; +import com.google.cloud.vision.v1p4beta1.ReferenceImage; +import com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1p4beta1.UpdateProductRequest; +import com.google.cloud.vision.v1p4beta1.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/v1p4beta1/stub/ProductSearchStubSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStubSettings.java new file mode 100644 index 000000000000..0907199de5f7 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStubSettings.java @@ -0,0 +1,1064 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1.stub; + +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1p4beta1.BatchOperationMetadata; +import com.google.cloud.vision.v1p4beta1.CreateProductRequest; +import com.google.cloud.vision.v1p4beta1.CreateProductSetRequest; +import com.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.DeleteProductRequest; +import com.google.cloud.vision.v1p4beta1.DeleteProductSetRequest; +import com.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.GetProductRequest; +import com.google.cloud.vision.v1p4beta1.GetProductSetRequest; +import com.google.cloud.vision.v1p4beta1.GetReferenceImageRequest; +import com.google.cloud.vision.v1p4beta1.ImportProductSetsRequest; +import com.google.cloud.vision.v1p4beta1.ImportProductSetsResponse; +import com.google.cloud.vision.v1p4beta1.ListProductSetsRequest; +import com.google.cloud.vision.v1p4beta1.ListProductSetsResponse; +import com.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1p4beta1.ListProductsRequest; +import com.google.cloud.vision.v1p4beta1.ListProductsResponse; +import com.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1p4beta1.Product; +import com.google.cloud.vision.v1p4beta1.ProductSet; +import com.google.cloud.vision.v1p4beta1.ReferenceImage; +import com.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1p4beta1.UpdateProductRequest; +import com.google.cloud.vision.v1p4beta1.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() != null + ? payload.getProductSetsList() + : ImmutableList.of(); + } + }; + + 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() != null + ? payload.getProductsList() + : ImmutableList.of(); + } + }; + + 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() != null + ? payload.getReferenceImagesList() + : ImmutableList.of(); + } + }; + + 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() != null + ? payload.getProductsList() + : ImmutableList.of(); + } + }; + + 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/v1p4beta1/ImageAnnotatorClientTest.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClientTest.java new file mode 100644 index 000000000000..1cc3fcec80b5 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClientTest.java @@ -0,0 +1,259 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +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 batchAnnotateFilesTest() { + BatchAnnotateFilesResponse expectedResponse = BatchAnnotateFilesResponse.newBuilder().build(); + mockImageAnnotator.addResponse(expectedResponse); + + List requests = new ArrayList<>(); + + BatchAnnotateFilesResponse actualResponse = client.batchAnnotateFiles(requests); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockImageAnnotator.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchAnnotateFilesRequest actualRequest = (BatchAnnotateFilesRequest) actualRequests.get(0); + + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void batchAnnotateFilesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockImageAnnotator.addException(exception); + + try { + List requests = new ArrayList<>(); + + client.batchAnnotateFiles(requests); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void asyncBatchAnnotateImagesTest() throws Exception { + AsyncBatchAnnotateImagesResponse expectedResponse = + AsyncBatchAnnotateImagesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("asyncBatchAnnotateImagesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockImageAnnotator.addResponse(resultOperation); + + List requests = new ArrayList<>(); + OutputConfig outputConfig = OutputConfig.newBuilder().build(); + + AsyncBatchAnnotateImagesResponse actualResponse = + client.asyncBatchAnnotateImagesAsync(requests, outputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockImageAnnotator.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AsyncBatchAnnotateImagesRequest actualRequest = + (AsyncBatchAnnotateImagesRequest) actualRequests.get(0); + + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void asyncBatchAnnotateImagesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockImageAnnotator.addException(exception); + + try { + List requests = new ArrayList<>(); + OutputConfig outputConfig = OutputConfig.newBuilder().build(); + + client.asyncBatchAnnotateImagesAsync(requests, 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 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/v1p4beta1/MockImageAnnotator.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockImageAnnotator.java new file mode 100644 index 000000000000..eda5eca39ce0 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockImageAnnotator.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +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/v1p4beta1/MockImageAnnotatorImpl.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockImageAnnotatorImpl.java new file mode 100644 index 000000000000..d844ff0af7dc --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockImageAnnotatorImpl.java @@ -0,0 +1,121 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.vision.v1p4beta1.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 batchAnnotateFiles( + BatchAnnotateFilesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof BatchAnnotateFilesResponse) { + requests.add(request); + responseObserver.onNext((BatchAnnotateFilesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void asyncBatchAnnotateImages( + AsyncBatchAnnotateImagesRequest 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 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/v1p4beta1/MockProductSearch.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockProductSearch.java new file mode 100644 index 000000000000..9bc4312c77f8 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockProductSearch.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +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/v1p4beta1/MockProductSearchImpl.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockProductSearchImpl.java new file mode 100644 index 000000000000..db40868e3699 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/MockProductSearchImpl.java @@ -0,0 +1,330 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.vision.v1p4beta1.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/v1p4beta1/ProductSearchClientTest.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ProductSearchClientTest.java new file mode 100644 index 000000000000..51a5f85751eb --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ProductSearchClientTest.java @@ -0,0 +1,904 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1p4beta1; + +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1p4beta1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1p4beta1.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/google-cloud-clients/google-cloud-vision/synth.py b/google-cloud-clients/google-cloud-vision/synth.py index 772ead0519f7..bf69af0519ea 100644 --- a/google-cloud-clients/google-cloud-vision/synth.py +++ b/google-cloud-clients/google-cloud-vision/synth.py @@ -21,7 +21,7 @@ gapic = gcp.GAPICGenerator() service = 'vision' -versions = ['v1', 'v1p1beta1', 'v1p2beta1', 'v1p3beta1'] +versions = ['v1', 'v1p1beta1', 'v1p2beta1', 'v1p3beta1', 'v1p4beta1'] config_pattern = '/google/cloud/vision/artman_vision_{version}.yaml' for version in versions: diff --git a/versions.txt b/versions.txt index 1f4efdb0afc6..25104189e735 100644 --- a/versions.txt +++ b/versions.txt @@ -112,6 +112,7 @@ grpc-google-cloud-vision-v1:1.45.0:1.45.1-SNAPSHOT grpc-google-cloud-vision-v1p1beta1:0.46.0:0.46.1-SNAPSHOT grpc-google-cloud-vision-v1p2beta1:1.45.0:1.45.1-SNAPSHOT grpc-google-cloud-vision-v1p3beta1:0.46.0:0.46.1-SNAPSHOT +grpc-google-cloud-vision-v1p4beta1:0.46.0:0.46.1-SNAPSHOT grpc-google-cloud-websecurityscanner-v1alpha:0.46.0:0.46.1-SNAPSHOT proto-google-cloud-asset-v1beta1:0.46.0:0.46.1-SNAPSHOT proto-google-cloud-automl-v1beta1:0.46.0:0.46.1-SNAPSHOT @@ -164,4 +165,5 @@ proto-google-cloud-vision-v1:1.45.0:1.45.1-SNAPSHOT proto-google-cloud-vision-v1p1beta1:0.46.0:0.46.1-SNAPSHOT proto-google-cloud-vision-v1p2beta1:1.45.0:1.45.1-SNAPSHOT proto-google-cloud-vision-v1p3beta1:0.46.0:0.46.1-SNAPSHOT +proto-google-cloud-vision-v1p4beta1:0.46.0:0.46.1-SNAPSHOT proto-google-cloud-websecurityscanner-v1alpha:0.46.0:0.46.1-SNAPSHOT From 3045d5397f9472acbe6a3b86fd174c6ca0d954f1 Mon Sep 17 00:00:00 2001 From: Solomon Duskis Date: Thu, 28 Feb 2019 07:31:04 -0500 Subject: [PATCH 2/3] Updating more pom.xmls --- google-cloud-bom/pom.xml | 10 ++++++++++ google-cloud-clients/pom.xml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 7df2bf06a06a..2145c16f026b 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -820,6 +820,16 @@ grpc-google-cloud-vision-v1p3beta1 0.46.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-vision-v1p4beta1 + 0.46.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-vision-v1p4beta1 + 0.46.1-SNAPSHOT + com.google.cloud google-cloud-video-intelligence diff --git a/google-cloud-clients/pom.xml b/google-cloud-clients/pom.xml index 10f172ab0ac8..c8024587bedf 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -787,7 +787,7 @@ Stub packages - com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquerydatatransfer.v1.stub:com.google.cloud.bigquerystorage.v1beta1.stub:com.google.cloud.bigtable-admin.v2.stub:com.google.cloud.bigtable.v2.stub:com.google.cloud.container.v1.stub:com.google.cloud.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.error-reporting.v1beta1.stub:com.google.cloud.firestore.v1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iamcredentials.v1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.os-login.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.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.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.tasks.v2beta3.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.video-intelligence.v1.stub:com.google.cloud.video-intelligence.v1beta1.stub:com.google.cloud.video-intelligence.v1beta2.stub:com.google.cloud.video-intelligence.v1p1beta1.stub:com.google.cloud.video-intelligence.v1p2beta1.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 + com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquerydatatransfer.v1.stub:com.google.cloud.bigquerystorage.v1beta1.stub:com.google.cloud.bigtable-admin.v2.stub:com.google.cloud.bigtable.v2.stub:com.google.cloud.container.v1.stub:com.google.cloud.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.error-reporting.v1beta1.stub:com.google.cloud.firestore.v1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iamcredentials.v1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.os-login.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.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.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.tasks.v2beta3.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.video-intelligence.v1.stub:com.google.cloud.video-intelligence.v1beta1.stub:com.google.cloud.video-intelligence.v1beta2.stub:com.google.cloud.video-intelligence.v1p1beta1.stub:com.google.cloud.video-intelligence.v1p2beta1.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.vision.v1p4beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub Deprecated packages From e572ba7c2c5c2fe18afa5b5ab2aff23f67443203 Mon Sep 17 00:00:00 2001 From: Solomon Duskis Date: Thu, 28 Feb 2019 08:31:52 -0500 Subject: [PATCH 3/3] Fixing formatting issues --- .../google/cloud/vision/v1p3beta1/ProductSearchParams.java | 6 ++++-- .../google/cloud/vision/v1p3beta1/ProductSearchResults.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 index c4d43412d32c..4f93614ad384 100644 --- 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 @@ -614,7 +614,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory - .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { + .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED + .getNumber()) { output.writeEnum(2, category_); } if (normalizedBoundingPoly_ != null) { @@ -652,7 +653,8 @@ public int getSerializedSize() { } if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory - .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { + .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED + .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, category_); } if (normalizedBoundingPoly_ != null) { 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 index c8288d07be73..93f6100f88dc 100644 --- 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 @@ -2426,7 +2426,8 @@ public final boolean isInitialized() { 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()) { + .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED + .getNumber()) { output.writeEnum(1, category_); } if (indexTime_ != null) { @@ -2452,7 +2453,8 @@ public int getSerializedSize() { size = 0; if (category_ != com.google.cloud.vision.v1p3beta1.ProductSearchCategory - .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED.getNumber()) { + .PRODUCT_SEARCH_CATEGORY_UNSPECIFIED + .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, category_); } if (indexTime_ != null) {